- Timestamp:
- Mar 6, 2020 5:17:15 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r4334 r4346 2123 2123 '''Edit the proxy information used by subversion 2124 2124 ''' 2125 h,p = host,port = GSASIIpath.getsvnProxy() 2125 h,p,e = host,port,etc = GSASIIpath.getsvnProxy() 2126 if e: 2127 proxyinfo = os.path.join(GSASIIpath.path2GSAS2,"proxyinfo.txt") 2128 G2G.G2MessageBox(self,'File {} has manually-'.format(proxyinfo)+ 2129 'entered information. Please edit this by hand', 2130 'Unable to edit') 2131 return 2126 2132 dlg = G2G.MultiStringDialog(self,'Enter proxy values', 2127 2133 ['Proxy address','proxy port'], 2128 2134 [host,port],size=300) 2129 #dlg.SetSize((300,-1))2130 2135 if dlg.Show(): 2131 2136 h,p = dlg.GetValues() -
trunk/GSASIIpath.py
r4213 r4346 170 170 fp = open(proxyinfo,'r') 171 171 host = fp.readline().strip() 172 # allow file to begin with comments 173 while host.startswith('#'): 174 host = fp.readline().strip() 172 175 port = fp.readline().strip() 176 etc = [] 177 line = fp.readline() 178 while line: 179 etc.append(line.strip()) 180 line = fp.readline() 173 181 fp.close() 174 setsvnProxy(host,port )182 setsvnProxy(host,port,etc) 175 183 if not host.strip(): return '','' 176 return host,port 177 return '','' 178 179 def setsvnProxy(host,port ):184 return host,port,etc 185 return '','','' 186 187 def setsvnProxy(host,port,etc=[]): 180 188 '''Sets the svn commands needed to use a proxy 181 189 ''' … … 184 192 host = host.strip() 185 193 port = port.strip() 186 if not host: return187 proxycmds.append('--config-option')188 proxycmds.append('servers:global:http-proxy-host='+host)194 if host: 195 proxycmds.append('--config-option') 196 proxycmds.append('servers:global:http-proxy-host='+host) 189 197 if port: 190 198 proxycmds.append('--config-option') 191 199 proxycmds.append('servers:global:http-proxy-port='+port) 200 for item in etc: 201 proxycmds.append(item) 192 202 193 203 def whichsvn(): … … 206 216 svnprog = 'svn' 207 217 if sys.platform.startswith('win'): svnprog += '.exe' 208 host,port = getsvnProxy()218 host,port,etc = getsvnProxy() 209 219 if GetConfigValue('debug') and host: 210 220 print('DBG_Using proxy host {} port {}'.format(host,port)) … … 333 343 cmd += ['--non-interactive', '--trust-server-cert'] 334 344 if proxycmds: cmd += proxycmds 345 # if GetConfigValue('debug'): 346 # s = 'subversion command:\n ' 347 # for i in cmd: s += i + ' ' 348 # print(s) 335 349 s = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.PIPE) 336 350 out,err = MakeByte2str(s.communicate()) … … 429 443 cmd += ['--trust-server-cert'] 430 444 if proxycmds: cmd += proxycmds 445 #if verbose or GetConfigValue('debug'): 431 446 if verbose: 432 447 s = 'subversion command:\n '
Note: See TracChangeset
for help on using the changeset viewer.