[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[minion-cvs] More work with versions
Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv1789/lib/mixminion
Modified Files:
__init__.py
Log Message:
More work with versions
Index: __init__.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/__init__.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- __init__.py 9 Feb 2003 22:30:58 -0000 1.23
+++ __init__.py 12 Feb 2003 01:22:14 -0000 1.24
@@ -8,9 +8,41 @@
# This version string is generated from setup.py; don't edit it.
__version__ = "0.0.3alpha"
-# DOCDOC
-version_info = (0, 0, 3, 'a', 0)
+# This 5-tuple encodes the version number for comparison. Don't edit it.
+# The first 3 numbers are the version number; the 4th is:
+# 0 for alpha
+# 50 for beta
+# 99 for release candidate
+# 100 for release.
+# The 5th is a patchlevel. If -1, it is suppressed.
+# Either the 4th or 5th number may be a string. If so, it is not meant to
+# succeed or preceed any other sub-version with the same a.b.c version
+# number.
+version_info = (0, 0, 3, 0, -1)
__all__ = [ 'server', 'directory' ]
+
+def version_tuple_to_string(t):
+ assert len(t) == 5
+ if t[3] == 0:
+ s1 = "alpha"
+ elif t[3] == 50:
+ s1 = "beta"
+ elif t[3] == 99:
+ s1 = "rc"
+ elif t[3] == 100:
+ s1 = ""
+ else:
+ s1 = "(%s)"%t[3]
+ if t[4] > -1:
+ if s1:
+ s2 = "p%s"%t[4]
+ else:
+ s2 = str(t[4])
+ else:
+ s2 = ""
+ return "%s.%s.%s%s%s" % (t[0],t[1],t[2],s1,s2)
+
+assert __version__ == version_tuple_to_string(version_info)
## This next segment keeps pychecker from making spurious complaints.
import sys