Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tooling around with getting the VERSION right.

git-svn-id: http://tranquil.googlecode.com/svn/trunk@17 66ac46bf-b33b-0410-90a4-43c7d5e8004f
  • Loading branch information...
commit 2e1a13156c9430d5ea4f6e97d556b5f0dec733d8 1 parent 66982e8
@davisp davisp authored
Showing with 6 additions and 39 deletions.
  1. +1 −1  VERSION
  2. +5 −38 setup.py
View
2  VERSION
@@ -1 +1 @@
-13:15M
+0.1dev
View
43 setup.py
@@ -1,48 +1,15 @@
from distutils.core import setup
-def _read(file):
+def _read_version():
+ import os
+ file = os.path.join( os.path.dirname( __file__ ), 'VERSION' )
curr = open( file, 'r' )
- data = ''.join( [ l for l in curr ] )
+ data = ''.join( [ l for l in curr ] ).strip()
curr.close()
return data
-def _write(file,VERSION):
- curr = open( file, 'w' )
- curr.write( '%s\n', VERSION )
- curr.close()
-
-def _parse(data):
- import re
- pattern = re.compile( r'(?P<from>\d+)(:(?P<to>\d+)(\w+)?)?' )
- dict = pattern.match( data ).groupdict()
- if dict.get( 'to' ) is not None:
- return dict['to']
- elif dict.get( 'from' ) is not None:
- return dict['from']
- else:
- return None
-
-def _get_version():
- import os
- path = os.path.join( os.path.dirname( __file__ ), 'VERSION' )
- curr = _parse( _read( path ).strip() )
- os.system( 'svnversion > %s' % path )
- next = _parse( _read( path ).strip() )
- if curr is None and next is None:
- return 'alpha'
- elif curr is not None and next is None:
- return curr
- elif curr is None and next is not None:
- return next
- elif int( curr ) > int( next ):
- return curr
- else:
- _write(path,next)
- return next
-
-VERSION=_get_version()
-print "VERSION: %s" % VERSION
+VERSION=_read_version()
PACKAGES=[
'tranquil',
Please sign in to comment.
Something went wrong with that request. Please try again.