From d03337a737727de885db2ac4734352045f3b5378 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 30 Sep 2016 11:24:55 -0500 Subject: [PATCH] compile views with . separator anot _ seperator --- applications/examples/static/css/stupid.css | 6 +++--- fabfile.py | 20 ++++++++++++++++++++ gluon/compileapp.py | 3 ++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/applications/examples/static/css/stupid.css b/applications/examples/static/css/stupid.css index 80bf9b09..3e68bedd 100644 --- a/applications/examples/static/css/stupid.css +++ b/applications/examples/static/css/stupid.css @@ -54,8 +54,8 @@ header, main, footer {display:block; with:100%} /* IE fix */ .right {right:0; text-align:right} .middle div {vertical-align:middle} .bottom div {vertical-align:bottom} -.xscroll {overflow-x:scroll} -.yscroll {overflow-y:scroll} +.xscroll {overflow-x:scroll !important} +.yscroll {overflow-y:scroll !important} .nowrap {white-space:nowrap; overflow-x:hidden} .fill {width:100%} .lifted {box-shadow:5px 5px 10px #666} @@ -75,7 +75,7 @@ input:invalid, input.error, textarea:invalid, textarea.error {background: #ffdfd /*** grid ***/ .container {margin-right:-20px} .container>.quarter, .container>.half, .container>.third, .container>.twothirds, .container>.threequarters {display:inline-block; padding: 0 20px 0 0; vertical-align:top} -.container>.fill{display: inline-block} +.container>.fill{display: inline-block; padding-right: 20px; margin-right:-10px} .container img, .container video {max-width:100%} .max900 {margin-left:auto; margin-right:auto} diff --git a/fabfile.py b/fabfile.py index 2e7db9e8..00a52c02 100644 --- a/fabfile.py +++ b/fabfile.py @@ -136,6 +136,26 @@ def deploy(appname=None, all=False): if backup: print 'TO RESTORE: fab restore:%s' % backup + +def deploynobackup(appname=None): + """fab -H username@host deploy:appname,all""" + appname = appname or os.path.split(os.getcwd())[-1] + appfolder = applications+'/'+appname + zipfile = os.path.join(appfolder, '_update.zip') + if os.path.exists(zipfile): + os.unlink(zipfile) + + local('zip -r _update.zip */*.py */*/*.py views/*.html views/*/*.html static/*') + + put('_update.zip','/tmp/_update.zip') + try: + with cd(appfolder): + 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""" diff --git a/gluon/compileapp.py b/gluon/compileapp.py index 459c2848..7ba67e8e 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -487,7 +487,8 @@ def compile_views(folder, skip_failed_views=False): else: raise Exception("%s in %s" % (e, fname)) else: - filename = ('views/%s.py' % fname).replace('/', '_').replace('\\', '_') + filename = 'views.%s.py' % fname.replace(os.path.sep, '.') + # filename = ('views/%s.py' % fname).replace('/', '_').replace('\\', '_') filename = pjoin(folder, 'compiled', filename) write_file(filename, data) save_pyc(filename)