pep8 in scripts/*.py

This commit is contained in:
mdipierro
2012-10-19 14:22:42 -05:00
parent d053900032
commit 295084976b
24 changed files with 781 additions and 720 deletions
+7 -7
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
crontab -e
* 3 * * * root path/to/this/file
* 3 * * * root path/to/this/file
"""
USER = 'www-data'
@@ -14,7 +14,7 @@ import os
import urllib
import zipfile
if len(sys.argv)>1 and sys.argv[1] == 'nightly':
if len(sys.argv) > 1 and sys.argv[1] == 'nightly':
version = 'http://web2py.com/examples/static/nightly/web2py_src.zip'
else:
version = 'http://web2py.com/examples/static/web2py_src.zip'
@@ -23,11 +23,11 @@ realpath = os.path.realpath(__file__)
path = os.path.dirname(os.path.dirname(os.path.dirname(realpath)))
os.chdir(path)
try:
old_version = open('web2py/VERSION','r').read().strip()
old_version = open('web2py/VERSION', 'r').read().strip()
except IOError:
old_version = ''
open(TMPFILENAME,'wb').write(urllib.urlopen(version).read())
open(TMPFILENAME, 'wb').write(urllib.urlopen(version).read())
new_version = zipfile.ZipFile(TMPFILENAME).read('web2py/VERSION').strip()
if new_version>old_version:
os.system('sudo -u %s unzip -o %s' % (USER,TMPFILENAME))
if new_version > old_version:
os.system('sudo -u %s unzip -o %s' % (USER, TMPFILENAME))
os.system('apachectl restart | apache2ctl restart')