semantic version support in admin

This commit is contained in:
mdipierro
2012-12-20 15:47:46 -06:00
parent c1f47cdc44
commit 76ad8258f5
5 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ update:
echo "remember that pymysql was tweaked"
src:
### Use semantic versioning
echo 'Version 2.3.2-alpha.1+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
echo 'Version 2.4.1-alpha.1+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
### rm -f all junk files
make clean
### clean up baisc apps
+1 -1
View File
@@ -1 +1 @@
Version 2.3.2-alpha.1+timestamp.2012.12.20.15.39.20
Version 2.4.1-alpha.1+timestamp.2012.12.20.15.47.02
+1 -1
View File
@@ -62,7 +62,7 @@
<!-- VERSION -->
{{if is_manager():}}
<div class="box">
<h3>{{=T("Version %s.%s.%s (%s) %s", myversion)}}</h3>
<h3>{{=T("Version %s.%s.%s %s (%s)", myversion)}}</h3>
{{if session.check_version:}}
<p id="check_version">
{{=T('Checking for upgrades...')}}
+4 -5
View File
@@ -67,11 +67,10 @@ def parse_legacy(version="Version 1.99.0 (2011-09-19 08:23:26)"):
return (a, b, c, pre_release, build)
def parse_version(version):
items = parse_semantic(version)
if not items:
items = parse_legacy(version)
(a, b, c, pre_release, build) = items
return (a, b, c, build, pre_release) # build, pre_releas intentionally reversed
version_tuple = parse_semantic(version)
if not version_tuple:
version_tuple = parse_legacy(version)
return version_tuple
def read_file(filename, mode='r'):
"returns content from filename, making sure to close the file explicitly on exit."
+4 -3
View File
@@ -101,13 +101,14 @@ requests = 0 # gc timer
# pattern used to validate client address
regex_client = re.compile('[\w\-:]+(\.[\w\-]+)*\.?') # ## to account for IPV6
try:
#try:
if 1:
version_info = open(pjoin(global_settings.gluon_parent, 'VERSION'), 'r')
raw_version_string = version_info.read().strip()
version_info.close()
global_settings.web2py_version = parse_version(raw_version_string)
except:
raise RuntimeError("Cannot determine web2py version")
#except:
# raise RuntimeError("Cannot determine web2py version")
web2py_version = global_settings.web2py_version