fixed some layout problems
This commit is contained in:
+8
-4
@@ -373,12 +373,16 @@ def check_new_version(myversion, version_URL):
|
||||
the most up-to-version available
|
||||
"""
|
||||
try:
|
||||
from urllib import urlopen
|
||||
version = parse_version(urlopen(version_URL).read())
|
||||
except Exception:
|
||||
from urllib import urlopen
|
||||
version = urlopen(version_URL).read()
|
||||
pversion = parse_version(version)
|
||||
pmyversion = parse_version(myversion)
|
||||
except Exception,e:
|
||||
import traceback
|
||||
print traceback.format_exc()
|
||||
return -1, myversion
|
||||
|
||||
if version > myversion:
|
||||
if pversion[:3]+pversion[-6:] > pmyversion[:3]+pmyversion[-6:]:
|
||||
return True, version
|
||||
else:
|
||||
return False, version
|
||||
|
||||
+2
-2
@@ -47,8 +47,8 @@ __all__ = [
|
||||
|
||||
def parse_semantic(version="Version 1.99.0-rc.1+timestamp.2011.09.19.08.23.26"):
|
||||
"http://semver.org/"
|
||||
re_version = re.compile('Version (\d+)\.(\d+)\.(\d+)(\-(?P<pre>[^\s+]*))?(\+(?P<build>\S*))')
|
||||
m = re_version.match(version)
|
||||
re_version = re.compile('(\d+)\.(\d+)\.(\d+)(\-(?P<pre>[^\s+]*))?(\+(?P<build>\S*))')
|
||||
m = re_version.match(version.strip().split()[-1])
|
||||
if not m:
|
||||
return None
|
||||
a, b, c = int(m.group(1)), int(m.group(2)), int(m.group(3))
|
||||
|
||||
+6
-8
@@ -102,16 +102,14 @@ requests = 0 # gc timer
|
||||
# pattern used to validate client address
|
||||
regex_client = re.compile('[\w\-:]+(\.[\w\-]+)*\.?') # ## to account for IPV6
|
||||
|
||||
#try:
|
||||
if 1:
|
||||
try:
|
||||
version_info = open(pjoin(global_settings.gluon_parent, 'VERSION'), 'r')
|
||||
raw_version_string = version_info.read().strip()
|
||||
raw_version_string = version_info.read().split()[-1].strip()
|
||||
version_info.close()
|
||||
global_settings.web2py_version = parse_version(raw_version_string)
|
||||
#except:
|
||||
# raise RuntimeError("Cannot determine web2py version")
|
||||
|
||||
web2py_version = global_settings.web2py_version
|
||||
global_settings.web2py_version = raw_version_string
|
||||
web2py_version = global_settings.web2py_version
|
||||
except:
|
||||
raise RuntimeError("Cannot determine web2py version")
|
||||
|
||||
try:
|
||||
import rocket
|
||||
|
||||
Reference in New Issue
Block a user