--- a/viewer.py Mon Jul 18 18:38:43 2016 +0800
+++ b/viewer.py Mon Jul 18 18:44:12 2016 +0800
+def urlencode(**kwargs):
+ def joinparams(params):
+ return ','.join(quote_plus(i, '(),') for i in params)
+ return '&'.join(quote_plus(k) + '=' + joinparams(v) for k, v in kwargs.items())
class BaseHandler(RequestHandler):
self.conn = sqlite3.connect(DBPATH)
- def urlencode(self, **kwargs):
- def joinparams(params):
- return ','.join(quote_plus(i, '(),') for i in params)
- return '&'.join(quote_plus(k) + '=' + joinparams(v) for k, v in kwargs.items())
def setlocal(self, value=None):
kwargs = self.request.arguments.copy()
kwargs['local'] = [str(value)]
- return '?' + self.urlencode(**kwargs)
+ return '?' + urlencode(**kwargs)
kwargs['rev'] = ['rev({})'.format(value)]
- return '?' + self.urlencode(**kwargs)
+ return '?' + urlencode(**kwargs)
- return '?' + self.urlencode(**kwargs)
+ return '?' + urlencode(**kwargs)