projects
/
geekigeeki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04449ae
)
Add support for sorting glob results
author
Bernie Innocenti
<bernie@codewiz.org>
Sun, 16 May 2010 13:18:43 +0000
(09:18 -0400)
committer
Bernie Innocenti
<bernie@codewiz.org>
Sun, 16 May 2010 13:18:43 +0000
(09:18 -0400)
Results can optionally be in reverse order (reverse=1)
geekigeeki.py
patch
|
blob
|
history
diff --git
a/geekigeeki.py
b/geekigeeki.py
index 044c7bfa55600abaebbee95d59a2b307fb1e0bd4..0427f9b3a4f40e538a256bede1ffb7cb4e7b47b5 100755
(executable)
--- 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: