From: Bernie Innocenti Date: Mon, 7 Sep 2009 19:54:21 +0000 (+0200) Subject: Do not try to glob URLs and non glob strings X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=aec3ecd7af2dcf1f757c1594f0c006d2ac57c551;p=geekigeeki.git Do not try to glob URLs and non glob strings --- diff --git a/geekigeeki.py b/geekigeeki.py index 5b26b55..9a05b85 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -146,7 +146,7 @@ def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=Fal editable = name and writable and config_get('privileged_url') is not None if editable: print(' ' \ - % (privileged_path() + '?a=edit&q=' + name)) + % relative_url('?a=edit&q=' + name, privileged=True)) history = config_get('history_url') if history is not None: @@ -157,7 +157,7 @@ def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=Fal # Body if editable: - print('') + print('') else: print('') @@ -237,10 +237,13 @@ def link_inline(name, descr=None, kvargs={}): % (url, url, name) def link_inline_glob(pattern, descr=None, kvargs={}): - s = '' - for name in glob.glob(pattern): - s += link_inline(name, descr, kvargs) - return s + if not url_re.match(pattern) and bool(set(pattern) & set('?*[')): + s = '' + for name in glob.glob(pattern): + s += link_inline(name, descr, kvargs) + return s + else: + return link_inline(pattern, descr, kvargs) # Search ---------------------------------------------------