Changeset 5069


Ignore:
Timestamp:
Nov 6, 2021 12:32:37 AM (7 months ago)
Author:
toby
Message:

Make svn location a config option

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpath.py

    r5049 r5069  
    253253    if GetConfigValue('debug') and host:
    254254        print('DBG_Using proxy host {} port {}'.format(host,port))
     255    if GetConfigValue('svn_exec'):
     256        exe_file = GetConfigValue('svn_exec')
     257        print('Using ',exe_file)
     258        if is_exe(exe_file):
     259            try:
     260                p = subprocess.Popen([exe_file,'help'],stdout=subprocess.PIPE)
     261                res = p.stdout.read()
     262                if not res: return
     263                p.communicate()
     264                svnLocCache = os.path.abspath(exe_file)
     265                return svnLocCache
     266            except:
     267                pass
    255268    # add likely places to find subversion when installed with GSAS-II
    256269    pathlist = os.environ["PATH"].split(os.pathsep)
     
    11571170    newpath = os.path.join(path2GSAS2,'exports')
    11581171    if newpath not in sys.path: sys.path.append(newpath)
    1159 
     1172    LoadConfig(printInfo)
     1173
     1174def LoadConfig(printInfo=True):
    11601175    # setup read of config.py, if present
    11611176    global configDict
     
    13011316    '''What follows is called to update (or downdate) GSAS-II in a separate process.
    13021317    '''
     1318    LoadConfig()
    13031319    import time
    13041320    time.sleep(1) # delay to give the main process a chance to exit
  • trunk/config_example.py

    r5047 r5069  
    267267This option is under development and is not fully tested.
    268268'''
     269
     270svn_exec = None
     271'''Defines the full path to a subversion executable.
     272If None (the default), GSAS-II will search for a svn or svn.exe file
     273in the current path or in the location where the current Python is located.
     274'''
Note: See TracChangeset for help on using the changeset viewer.