Changeset 5709051 in sasview for build_tools
- Timestamp:
- Mar 7, 2013 3:16:04 PM (12 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- a602942e
- Parents:
- 0d795bf
- Location:
- build_tools
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
build_tools/get_version.py
rbd0a2115 r5709051 3 3 __version__ = "0.0.0" 4 4 5 def get_svn_revision(path=None): 6 rev = None 7 if path is None: 8 path = os.path.dirname(__file__) 9 entries_path = '%s/.svn/entries' % path 5 import subprocess 10 6 11 if os.path.exists(entries_path): 12 entries = open(entries_path, 'r').read() 13 # Versions >= 7 of the entries file are flat text. The first line is 14 # the version number. The next set of digits after 'dir' is the revision. 15 if re.match('(\d+)', entries): 16 rev_match = re.search('\d+\s+dir\s+(\d+)', entries) 17 if rev_match: 18 rev = rev_match.groups()[0] 19 # Older XML versions of the file specify revision as an attribute of 20 # the first entries node. 21 else: 22 from xml.dom import minidom 23 dom = minidom.parse(entries_path) 24 rev = dom.getElementsByTagName('entry')[0].getAttribute('revision') 25 26 if rev: 27 return u'%s' % rev 28 return None 7 def get_svn_revision(): 8 p = subprocess.Popen("svnversion", shell=True, \ 9 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 10 (stdout, stderr) = p.communicate() 11 try: 12 rev = int(stdout.strip()) 13 return str(rev) 14 except: 15 return __revision__ 29 16 30 17 # Get the version number from the sansview module … … 46 33 47 34 48 print "SasView v 35 print "SasView v", __version__, __revision__
Note: See TracChangeset
for help on using the changeset viewer.