@@ -60,7 +60,7 @@ def GetConfigValue(key,default=None,getDefault=False):
6060def SetConfigValue (parmdict ):
6161 '''Set configuration variables. Note that parmdict is a dictionary
6262 from :func:`GSASIIctrlGUI.GetConfigValsDocs` where each element is a
63- lists . The first item in list is the default value, the second is
63+ list . The first item in list is the default value, the second is
6464 the value to use for that configuration variable. Most of the
6565 information gathered in GetConfigValsDocs is no longer used.
6666 '''
@@ -76,6 +76,15 @@ def SetConfigValue(parmdict):
7676 if parmdict [var ][0 ] == parmdict [var ][1 ]: continue
7777 configDict [var ] = parmdict [var ][1 ]
7878
79+ def AddConfigValue (valsdict ):
80+ '''Set configuration variables.
81+
82+ :param dict valsdict: a dictionary of values that are added
83+ directly to configDict.
84+ '''
85+ global configDict
86+ configDict .update (valsdict )
87+
7988def GetConfigDefault (key ):
8089 '''Return the default value for a config value
8190
@@ -2168,7 +2177,11 @@ def openInNewTerm(project=None,g2script=None,pythonapp=sys.executable):
21682177 # allows this to be done in the background.
21692178 import requests
21702179 url = 'https://github.com/AdvancedPhotonSource/GSAS-II/tags'
2171- releases = requests .get (url = url )
2180+ try :
2181+ releases = requests .get (url = url )
2182+ except :
2183+ print ('background get tags failed' )
2184+ sys .exit ()
21722185 taglist = [tag .split ('"' )[0 ] for tag in releases .text .split ('AdvancedPhotonSource/GSAS-II/releases/tag/' )[1 :]]
21732186 lastver = sorted ([t for t in taglist if 'v' in t ])[- 1 ]
21742187 lastnum = sorted ([t for t in taglist if 'v' not in t ],key = int )[- 1 ]
0 commit comments