From 9efa432b57111d0dda80034d151a0dad1204990f Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sun, 16 May 2010 09:18:43 -0400 Subject: [PATCH] Add support for sorting glob results Results can optionally be in reverse order (reverse=1) --- geekigeeki.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geekigeeki.py b/geekigeeki.py index 044c7bf..0427f9b 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -173,7 +173,7 @@ def link_inline(name, descr=None, kvargs={}): def link_inline_glob(pattern, descr=None, kvargs={}): if not url_re.match(pattern) and bool(set(pattern) & set('?*[')): s = '' - for name in glob.glob(pattern): + for name in sorted(glob.glob(pattern), reverse=bool(int(kvargs.get('reverse', '0'))) ): s += link_inline(name, descr, kvargs) return s else: -- 2.25.1