description % should not be escaped, reverting
This commit is contained in:
Vendored
+6
-6
@@ -27,7 +27,7 @@ def create_user(username):
|
|||||||
run('EDITOR="cp /tmp/sudoers.new" visudo')
|
run('EDITOR="cp /tmp/sudoers.new" visudo')
|
||||||
uncomment('~%s/.bashrc' % username, '#force_color_prompt=yes')
|
uncomment('~%s/.bashrc' % username, '#force_color_prompt=yes')
|
||||||
|
|
||||||
def install_web2py():
|
def install_web2py():
|
||||||
"""fab -H username@host install_web2py"""
|
"""fab -H username@host install_web2py"""
|
||||||
sudo('wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/%s' % INSTALL_SCRIPT)
|
sudo('wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/%s' % INSTALL_SCRIPT)
|
||||||
sudo('chmod +x %s' % INSTALL_SCRIPT)
|
sudo('chmod +x %s' % INSTALL_SCRIPT)
|
||||||
@@ -119,7 +119,7 @@ def deploy(appname=None, all=False):
|
|||||||
os.unlink(zipfile)
|
os.unlink(zipfile)
|
||||||
|
|
||||||
backup = mkdir_or_backup(appname)
|
backup = mkdir_or_backup(appname)
|
||||||
|
|
||||||
if all=='all' or not backup:
|
if all=='all' or not backup:
|
||||||
local('zip -r _update.zip * -x *~ -x .* -x \#* -x *.bak -x *.bak2')
|
local('zip -r _update.zip * -x *~ -x .* -x \#* -x *.bak -x *.bak2')
|
||||||
else:
|
else:
|
||||||
@@ -131,10 +131,10 @@ def deploy(appname=None, all=False):
|
|||||||
sudo('unzip -o /tmp/_update.zip')
|
sudo('unzip -o /tmp/_update.zip')
|
||||||
sudo('chown -R www-data:www-data *')
|
sudo('chown -R www-data:www-data *')
|
||||||
sudo('echo "%s" > DATE_DEPLOYMENT' % now)
|
sudo('echo "%s" > DATE_DEPLOYMENT' % now)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
sudo('rm /tmp/_update.zip')
|
sudo('rm /tmp/_update.zip')
|
||||||
|
|
||||||
if backup:
|
if backup:
|
||||||
print 'TO RESTORE: fab restore:%s' % backup
|
print 'TO RESTORE: fab restore:%s' % backup
|
||||||
|
|
||||||
@@ -154,10 +154,10 @@ def deploynobackup(appname=None):
|
|||||||
sudo('unzip -o /tmp/_update.zip')
|
sudo('unzip -o /tmp/_update.zip')
|
||||||
sudo('chown -R www-data:www-data *')
|
sudo('chown -R www-data:www-data *')
|
||||||
sudo('echo "%s" > DATE_DEPLOYMENT' % now)
|
sudo('echo "%s" > DATE_DEPLOYMENT' % now)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
sudo('rm /tmp/_update.zip')
|
sudo('rm /tmp/_update.zip')
|
||||||
|
|
||||||
def restore(backup):
|
def restore(backup):
|
||||||
"""fab -H username@host restore:backupfilename"""
|
"""fab -H username@host restore:backupfilename"""
|
||||||
appname = backup.split('/')[-1].split('.')[0]
|
appname = backup.split('/')[-1].split('.')[0]
|
||||||
|
|||||||
+1
-1
@@ -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*\}\})"""
|
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):
|
def apath(path='', r=None):
|
||||||
"""Builds a path inside an application folder
|
"""Builds a path inside an application folder
|
||||||
|
|
||||||
|
|||||||
@@ -444,7 +444,6 @@ class AuthAPI(object):
|
|||||||
if type(description).__name__ == 'lazyT':
|
if type(description).__name__ == 'lazyT':
|
||||||
description = description.m
|
description = description.m
|
||||||
if not user_id or self.table_user()[user_id]:
|
if not user_id or self.table_user()[user_id]:
|
||||||
description = description.replace('%', '%%')
|
|
||||||
self.table_event().insert(
|
self.table_event().insert(
|
||||||
description=str(description % vars), origin=origin, user_id=user_id)
|
description=str(description % vars), origin=origin, user_id=user_id)
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -2666,7 +2666,7 @@ class SQLFORM(FORM):
|
|||||||
otablename, ofieldname = order.split('~')[-1].split('.', 1)
|
otablename, ofieldname = order.split('~')[-1].split('.', 1)
|
||||||
sort_field = db[otablename][ofieldname]
|
sort_field = db[otablename][ofieldname]
|
||||||
orderby = sort_field if order[:1] != '~' else ~sort_field
|
orderby = sort_field if order[:1] != '~' else ~sort_field
|
||||||
|
|
||||||
orderby = fix_orderby(orderby)
|
orderby = fix_orderby(orderby)
|
||||||
|
|
||||||
# expcolumns start with the visible columns, which
|
# expcolumns start with the visible columns, which
|
||||||
@@ -2815,11 +2815,11 @@ class SQLFORM(FORM):
|
|||||||
if key == order.lstrip('~'):
|
if key == order.lstrip('~'):
|
||||||
if inverted:
|
if inverted:
|
||||||
if key == order:
|
if key == order:
|
||||||
key, marker = 'None', asc_icon
|
key, marker = 'None', asc_icon
|
||||||
else:
|
else:
|
||||||
key, marker = order[1:], desc_icon
|
key, marker = order[1:], desc_icon
|
||||||
else:
|
else:
|
||||||
if key == order:
|
if key == order:
|
||||||
key, marker = '~' + order, asc_icon
|
key, marker = '~' + order, asc_icon
|
||||||
else:
|
else:
|
||||||
key, marker = 'None', desc_icon
|
key, marker = 'None', desc_icon
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
from pydal.validators import *
|
from pydal.validators import *
|
||||||
from pydal.validators import simple_hash, get_digest, Validator, ValidationError, translate, __all__
|
from pydal.validators import simple_hash, get_digest, Validator, ValidationError, translate, __all__
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user