Changeset 3056


Ignore:
Timestamp:
10/29/15 14:44:08 (9 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: new methods, get_rev_info_file, get_asap_revdate, to support git

Test Programs:

Put in Release Notes: No

Module(s):

Description: committing changes for git from Ville.


Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/getgitrev.sh

    r3054 r3056  
    99date "+%b %d %Y, %H:%M:%S" >> $OUT
    1010
    11 # Replace svn $date$ witg current date in __init__.py
    12 dat=`date`
    13 INITPY=python/__init__.py
    14 sed s/\\\'\\\$Date\\\$\\\'\\\.split\(\)\\\[1\\\]/replacethisstring/g $INITPY > tmpinit.txt
    15 sed "s/replacethisstring/\"$dat\"/g"  tmpinit.txt > tmpinitmodified.txt
    16 mv tmpinitmodified.txt $INITPY
    17 exit 0
  • trunk/python/__init__.py

    r2929 r3056  
    5959from _asap import srctype
    6060
    61 __date__ = '$Date$'.split()[1]
     61__date__ = get_asap_revdate()
    6262__version__  = '4.3.0a'
    6363__revision__ = get_revision()
  • trunk/python/env.py

    r2633 r3056  
    22"""
    33__all__ = ["is_casapy", "is_ipython", "setup_env", "get_revision",
    4            "is_asap_cli"]
     4           "is_asap_cli", "get_asap_revdate"]
    55
    66import sys
     
    5252        os.environ["CASAPATH"] = "%s %s somwhere" % ( asapdata, plf)
    5353
    54 def get_revision():
     54def get_revinfo_file():
    5555    """Get the revision of the software. Only useful within casapy."""
    5656    if not is_casapy:
     
    5959    versioninfo = sys.version_info
    6060    pyversion = '%s.%s'%(versioninfo[0],versioninfo[1])
     61    revinfo = None
    6162    if os.path.isdir(casapath[0]+'/'+casapath[1]+'/python/%s/asap'%(pyversion)):
    6263        # for casa developer environment (linux or darwin)
     
    6869        else:
    6970            revinfo=casapath[0]+'/lib/python%s/asap/svninfo.txt'%(pyversion)
     71    return revinfo
     72
     73def get_revision():
     74    revinfo=get_revinfo_file()
    7075    if os.path.isfile(revinfo):
    7176        f = file(revinfo)
     
    7580        return revsionno.rstrip()
    7681    return ' unknown '
     82
     83
     84def 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.