From: Bernie Innocenti Date: Tue, 12 Oct 2010 13:35:09 +0000 (-0400) Subject: Simplify url of editor page X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d400842f95d61fa17e706ac4afd57414b2d5b962;p=geekigeeki.git Simplify url of editor page --- diff --git a/geekigeeki.py b/geekigeeki.py index 7880060..147b129 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -230,7 +230,7 @@ def handle_atom(pagename, form): Page(pagename).send_atom() def handle_edit(pagename, form): - pg = Page(form['q'].value) + pg = Page(pagename) if 'save' in form: if form['file'].value: pg.save(form['file'].file.read(), form['changelog'].value) @@ -575,7 +575,7 @@ class Page: except IOError, err: if err.errno == errno.ENOENT: if default is None: - default = '//[[?a=edit&q=%s|Describe %s]]//' % (self.page_name, self.page_name) + default = '//[[%s?a=edit|Describe %s]]//' % (self.page_name, self.page_name) return default if err.errno == errno.EISDIR: return self.format_dir() @@ -663,7 +663,7 @@ class Page: editable = name and self.can_write() and is_privileged() if editable: print(' ' \ - % relative_url('?a=edit&q=' + name, privileged=True)) + % relative_url(name + '?a=edit', privileged=True)) history = config_get('history_url') if history is not None: @@ -674,7 +674,7 @@ class Page: # BODY if editable: - print('') + print('') else: print('') @@ -701,13 +701,13 @@ class Page: print(' | ' + link_tag(name + '?a=raw', 'Raw Text', cssclass='navlink')) if config_get('privileged_url') is not None: if self.can_write(): - print(' | ' + link_tag('?a=edit&q=' + name, 'Edit', cssclass='navlink', privileged=True)) + print(' | ' + link_tag(name + '?a=edit', 'Edit', cssclass='navlink', privileged=True)) else: - print(' | ' + link_tag(name, 'Login', cssclass='navlink', privileged=True)) + print(' | ' + link_tag(name, 'Login', cssclass='login', privileged=True)) user = remote_user() if user != 'AnonymousCoward': - print(' | ' + link_tag('User/' + user, user) + '') + print(' | ' + link_tag('user/' + user, user, cssclass='login')) print('
')