description % should not be escaped, reverting

This commit is contained in:
mdipierro
2019-05-25 01:01:32 -07:00
parent 1c5b2d7fce
commit ce25d8dc31
5 changed files with 10 additions and 12 deletions

12
fabfile.py vendored
View File

@@ -27,7 +27,7 @@ def create_user(username):
run('EDITOR="cp /tmp/sudoers.new" visudo')
uncomment('~%s/.bashrc' % username, '#force_color_prompt=yes')
def install_web2py():
def install_web2py():
"""fab -H username@host install_web2py"""
sudo('wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/%s' % INSTALL_SCRIPT)
sudo('chmod +x %s' % INSTALL_SCRIPT)
@@ -119,7 +119,7 @@ def deploy(appname=None, all=False):
os.unlink(zipfile)
backup = mkdir_or_backup(appname)
if all=='all' or not backup:
local('zip -r _update.zip * -x *~ -x .* -x \#* -x *.bak -x *.bak2')
else:
@@ -131,10 +131,10 @@ def deploy(appname=None, all=False):
sudo('unzip -o /tmp/_update.zip')
sudo('chown -R www-data:www-data *')
sudo('echo "%s" > DATE_DEPLOYMENT' % now)
finally:
sudo('rm /tmp/_update.zip')
if backup:
print 'TO RESTORE: fab restore:%s' % backup
@@ -154,10 +154,10 @@ def deploynobackup(appname=None):
sudo('unzip -o /tmp/_update.zip')
sudo('chown -R www-data:www-data *')
sudo('echo "%s" > DATE_DEPLOYMENT' % now)
finally:
sudo('rm /tmp/_update.zip')
def restore(backup):
"""fab -H username@host restore:backupfilename"""
appname = backup.split('/')[-1].split('.')[0]

View File

@@ -36,7 +36,7 @@ REGEX_EXTEND = r"""^\s*(?P<all>\{\{\s*extend\s+['"](?P<name>[^'"]+)['"]\s*\}\})"
REGEX_INCLUDE = r"""(?P<all>\{\{\s*include\s+['"](?P<name>[^'"]+)['"]\s*\}\})"""
# TODO: swap arguments, let first ('r' or whatever) be mandatory
# TODO: swap arguments, let first ('r' or whatever) be mandatory
def apath(path='', r=None):
"""Builds a path inside an application folder

View File

@@ -444,7 +444,6 @@ class AuthAPI(object):
if type(description).__name__ == 'lazyT':
description = description.m
if not user_id or self.table_user()[user_id]:
description = description.replace('%', '%%')
self.table_event().insert(
description=str(description % vars), origin=origin, user_id=user_id)

View File

@@ -2666,7 +2666,7 @@ class SQLFORM(FORM):
otablename, ofieldname = order.split('~')[-1].split('.', 1)
sort_field = db[otablename][ofieldname]
orderby = sort_field if order[:1] != '~' else ~sort_field
orderby = fix_orderby(orderby)
# expcolumns start with the visible columns, which
@@ -2815,11 +2815,11 @@ class SQLFORM(FORM):
if key == order.lstrip('~'):
if inverted:
if key == order:
key, marker = 'None', asc_icon
key, marker = 'None', asc_icon
else:
key, marker = order[1:], desc_icon
else:
if key == order:
if key == order:
key, marker = '~' + order, asc_icon
else:
key, marker = 'None', desc_icon

View File

@@ -1,3 +1,2 @@
from pydal.validators import *
from pydal.validators import simple_hash, get_digest, Validator, ValidationError, translate, __all__