Merge pull request #237 from alfonsodg/master
Added gitignore restrictions and changes for admin.py
This commit is contained in:
@@ -55,3 +55,4 @@ applications/admin/cron/cron.master
|
||||
HOWTO-web2py-devel
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
.idea/*
|
||||
|
||||
+5
-6
@@ -353,7 +353,7 @@ def plugin_install(app, fobj, request, filename):
|
||||
return False
|
||||
|
||||
|
||||
def check_new_version(myversion, version_URL):
|
||||
def check_new_version(myversion, version_url):
|
||||
"""
|
||||
Compares current web2py's version with the latest stable web2py version.
|
||||
|
||||
@@ -374,7 +374,7 @@ def check_new_version(myversion, version_URL):
|
||||
"""
|
||||
try:
|
||||
from urllib import urlopen
|
||||
version = urlopen(version_URL).read()
|
||||
version = urlopen(version_url).read()
|
||||
pversion = parse_version(version)
|
||||
pmyversion = parse_version(myversion)
|
||||
except IOError:
|
||||
@@ -398,7 +398,7 @@ def unzip(filename, dir, subfolder=''):
|
||||
raise RuntimeError('Not a valid zipfile')
|
||||
zf = zipfile.ZipFile(filename)
|
||||
if not subfolder.endswith('/'):
|
||||
subfolder = subfolder + '/'
|
||||
subfolder += '/'
|
||||
n = len(subfolder)
|
||||
for name in sorted(zf.namelist()):
|
||||
if not name.startswith(subfolder):
|
||||
@@ -432,11 +432,11 @@ def upgrade(request, url='http://web2py.com'):
|
||||
web2py_version = request.env.web2py_version
|
||||
gluon_parent = request.env.gluon_parent
|
||||
if not gluon_parent.endswith('/'):
|
||||
gluon_parent = gluon_parent + '/'
|
||||
gluon_parent += '/'
|
||||
(check, version) = check_new_version(web2py_version,
|
||||
url + '/examples/default/version')
|
||||
if not check:
|
||||
return (False, 'Already latest version')
|
||||
return False, 'Already latest version'
|
||||
if os.path.exists(os.path.join(gluon_parent, 'web2py.exe')):
|
||||
version_type = 'win'
|
||||
destination = gluon_parent
|
||||
@@ -452,7 +452,6 @@ def upgrade(request, url='http://web2py.com'):
|
||||
|
||||
full_url = url + '/examples/static/web2py_%s.zip' % version_type
|
||||
filename = abspath('web2py_%s_downloaded.zip' % version_type)
|
||||
file = None
|
||||
try:
|
||||
write_file(filename, urllib.urlopen(full_url).read(), 'wb')
|
||||
except Exception, e:
|
||||
|
||||
+1
-3
@@ -19,7 +19,6 @@ When web2py is running on Google App Engine,
|
||||
caching will be provided by the GAE memcache
|
||||
(see gluon.contrib.gae_memcache)
|
||||
"""
|
||||
import traceback
|
||||
import time
|
||||
import portalocker
|
||||
import shelve
|
||||
@@ -278,7 +277,7 @@ class CacheOnDisk(CacheAbstract):
|
||||
storage = shelve.open(self.shelve_name)
|
||||
except:
|
||||
logger.error('corrupted cache file %s, will try rebuild it'
|
||||
% (self.shelve_name))
|
||||
% self.shelve_name)
|
||||
storage = None
|
||||
if not storage and os.path.exists(self.shelve_name):
|
||||
os.unlink(self.shelve_name)
|
||||
@@ -479,7 +478,6 @@ class Cache(object):
|
||||
if not session_ and public_:
|
||||
cache_control += ', public'
|
||||
expires = (current.request.utcnow + datetime.timedelta(seconds=time_expire)).strftime('%a, %d %b %Y %H:%M:%S GMT')
|
||||
vary = None
|
||||
else:
|
||||
cache_control += ', private'
|
||||
expires = 'Fri, 01 Jan 1990 00:00:00 GMT'
|
||||
|
||||
+2
-2
@@ -1005,7 +1005,7 @@ def console():
|
||||
if not os.path.exists('applications/__init__.py'):
|
||||
write_file('applications/__init__.py', '')
|
||||
|
||||
return (options, args)
|
||||
return options, args
|
||||
|
||||
|
||||
def check_existent_app(options, appname):
|
||||
@@ -1022,7 +1022,7 @@ def get_code_for_scheduler(app, options):
|
||||
code = code % ("','".join(app[1:]))
|
||||
app_ = app[0]
|
||||
if not check_existent_app(options, app_):
|
||||
print "Application '%s' doesn't exist, skipping" % (app_)
|
||||
print "Application '%s' doesn't exist, skipping" % app_
|
||||
return None, None
|
||||
return app_, code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user