Changeset 3056 for trunk/python
- Timestamp:
- 10/29/15 14:44:08 (9 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r2929 r3056 59 59 from _asap import srctype 60 60 61 __date__ = '$Date$'.split()[1]61 __date__ = get_asap_revdate() 62 62 __version__ = '4.3.0a' 63 63 __revision__ = get_revision() -
trunk/python/env.py
r2633 r3056 2 2 """ 3 3 __all__ = ["is_casapy", "is_ipython", "setup_env", "get_revision", 4 "is_asap_cli" ]4 "is_asap_cli", "get_asap_revdate"] 5 5 6 6 import sys … … 52 52 os.environ["CASAPATH"] = "%s %s somwhere" % ( asapdata, plf) 53 53 54 def get_revi sion():54 def get_revinfo_file(): 55 55 """Get the revision of the software. Only useful within casapy.""" 56 56 if not is_casapy: … … 59 59 versioninfo = sys.version_info 60 60 pyversion = '%s.%s'%(versioninfo[0],versioninfo[1]) 61 revinfo = None 61 62 if os.path.isdir(casapath[0]+'/'+casapath[1]+'/python/%s/asap'%(pyversion)): 62 63 # for casa developer environment (linux or darwin) … … 68 69 else: 69 70 revinfo=casapath[0]+'/lib/python%s/asap/svninfo.txt'%(pyversion) 71 return revinfo 72 73 def get_revision(): 74 revinfo=get_revinfo_file() 70 75 if os.path.isfile(revinfo): 71 76 f = file(revinfo) … … 75 80 return revsionno.rstrip() 76 81 return ' unknown ' 82 83 84 def get_asap_revdate(): 85 revinfo=get_revinfo_file() 86 if os.path.isfile(revinfo): 87 f = file(revinfo) 88 f.readline() 89 f.readline() 90 revdate=f.readline() 91 return revdate.rstrip().lstrip() 92 return 'unknown' 93 94
Note:
See TracChangeset
for help on using the changeset viewer.