Changeset 7c105e8 in sasview for run.py


Ignore:
Timestamp:
May 2, 2017 8:32:16 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
c6bdb3b
Parents:
ed03b99
Message:

make run.py work again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • run.py

    red03b99 r7c105e8  
    139139    sys.path.append(build_path) 
    140140 
     141    set_git_tag() 
    141142    # print "\n".join(sys.path) 
     143 
     144def set_git_tag(): 
     145    try: 
     146        import subprocess 
     147        import os 
     148        import platform 
     149        FNULL = open(os.devnull, 'w') 
     150        if platform.system() == "Windows": 
     151            args = ['git', 'describe', '--tags'] 
     152        else: 
     153            args = ['git describe --tags'] 
     154        git_revision = subprocess.check_output(args, stderr=FNULL, shell=True) 
     155        import sas.sasview 
     156        sas.sasview.__build__ = str(git_revision).strip() 
     157    except subprocess.CalledProcessError as cpe: 
     158        logger.warning("Error while determining build number\n  Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output)) 
    142159 
    143160 
Note: See TracChangeset for help on using the changeset viewer.