Changeset 4987


Ignore:
Timestamp:
Jul 2, 2021 2:20:10 PM (2 years ago)
Author:
toby
Message:

duplicate Seq->csv export; set svn proxy from environment variables

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4979 r4987  
    27972797        self.addRows = addRows
    27982798        self.size = size
    2799         self.hlp = StripIndents(hlp,True)
     2799        self.hlp = hlp
    28002800        self.lbl = lbl
    28012801        self.CenterOnParent()
     
    56015601    When singleLine is True, all newline are removed, but inserting "%%"
    56025602    into the string will cause a blank line to be inserted at that point
     5603    and %t% will generate a new line and tab (to indent a line)
    56035604
    56045605    :param str msg: a string containing one or more lines of text.
    56055606      spaces or tabs following a newline are removed.
     5607    :param bool singleLine: removes all newlines from the msg so that
     5608      the text may be wrapped.
    56065609    :returns: the string but reformatted
    56075610    '''
     
    56225625            msg1 = msg1.replace('  ',' ')
    56235626        msg = msg.replace('%%','\n\n')
     5627        msg = msg.replace('%t%','\n\t')
    56245628    return msg
    56255629
  • trunk/GSASIIdataGUI.py

    r4979 r4987  
    23572357        command. If a proxy server is needed, the address/host and port
    23582358        can be added supplied here. This will generate command-line options
    2359 
    2360         --config-option servers:global:http-proxy-host=*host*
    2361         --config-option servers:global:http-proxy-port=*port*
    2362 
     2359%t%          --config-option servers:global:http-proxy-host=*host*
     2360%t%          --config-option servers:global:http-proxy-port=*port*
     2361%%
    23632362        Additional subversion command line options can be supplied here
    23642363        by pressing the '+' button. As examples of options that might be of
    23652364        value, use two extra lines to add:
    2366 
    2367         --config-dir
    2368         DIR
    2369 
     2365%t%          --config-dir
     2366%t%          DIR
     2367%%
    23702368        to specify an alternate configuration location.
    2371 
     2369%%
    23722370        Or, use four extra lines to add
    2373 
    2374         --config-option
    2375         servers:global:http-proxy-username=*account*
    2376         --config-option
    2377         servers:global:http-proxy-password=*password*
    2378 
     2371%t%          --config-option
     2372%t%          servers:global:http-proxy-username=*account*
     2373%t%          --config-option
     2374%t%          servers:global:http-proxy-password=*password*
     2375%%
    23792376        to specify a proxy user name and password.
    2380 
     2377%%
    23812378        Note that strings marked *value* are items that will be configured
    23822379        by the user. See http://svnbook.red-bean.com for more information on
     
    58995896                    self.SeqExportLookup[item.GetId()] = (obj,lbl) # lookup table for submenu item
    59005897                    # Bind is in UpdateSeqResults
    5901        
     5898        G2G.Define_wxId('wxID_XPORTSEQCSV')     
     5899        self.SequentialEx.Append(G2G.wxID_XPORTSEQCSV,'Save table as CSV',
     5900            'Save all sequential refinement results as a CSV spreadsheet file')
    59025901        self.PostfillDataMenu()
    59035902           
  • trunk/GSASIIpath.py

    r4976 r4987  
    178178               
    179179def getsvnProxy():
    180     '''Loads a proxy for subversion from the file created by bootstrap.py
     180    '''Loads a proxy for subversion from the proxyinfo.txt file created
     181    by bootstrap.py or File => Edit Proxy...; If not found, then the
     182    standard http_proxy and https_proxy environment variables are scanned
     183    (see https://docs.python.org/3/library/urllib.request.html#urllib.request.getproxies)
     184    with case ignored and that is used.
    181185    '''
    182186    global proxycmds
     
    185189    if not os.path.exists(proxyinfo):
    186190        proxyinfo = os.path.join(path2GSAS2,"proxyinfo.txt")
    187     if not os.path.exists(proxyinfo):
    188         return '','',''
    189     fp = open(proxyinfo,'r')
    190     host = fp.readline().strip()
    191     # allow file to begin with comments
    192     while host.startswith('#'):
     191    if os.path.exists(proxyinfo):
     192        fp = open(proxyinfo,'r')
    193193        host = fp.readline().strip()
    194     port = fp.readline().strip()
    195     etc = []
    196     line = fp.readline()
    197     while line:
    198         etc.append(line.strip())
     194        # allow file to begin with comments
     195        while host.startswith('#'):
     196            host = fp.readline().strip()
     197        port = fp.readline().strip()
     198        etc = []
    199199        line = fp.readline()
    200     fp.close()
    201     setsvnProxy(host,port,etc)
    202     return host,port,etc
     200        while line:
     201            etc.append(line.strip())
     202            line = fp.readline()
     203        fp.close()
     204        setsvnProxy(host,port,etc)
     205        return host,port,etc
     206    import urllib.request
     207    proxdict = urllib.request.getproxies()
     208    varlist = ("https","http")
     209    for var in proxdict:
     210        if var.lower() in varlist:
     211            proxy = proxdict[var]
     212            pl = proxy.split(':')
     213            if len(pl) < 2: continue
     214            host = ':'.join(pl[0:2])
     215            port = ''
     216            if len(pl) == 3:
     217                port = pl[2].strip('/').strip()
     218            return host,port,''
     219    return '','',''
    203220
    204221def setsvnProxy(host,port,etc=[]):
  • trunk/GSASIIseqGUI.py

    r4872 r4987  
    11801180    for id in G2frame.dataWindow.SeqExportLookup:       
    11811181        G2frame.Bind(wx.EVT_MENU, DoSequentialExport, id=id)
     1182    G2frame.Bind(wx.EVT_MENU, OnSaveSeqCSV, id=G2G.wxID_XPORTSEQCSV)
    11821183
    11831184    EnablePseudoVarMenus()
Note: See TracChangeset for help on using the changeset viewer.