Changeset 1961


Ignore:
Timestamp:
Aug 25, 2015 4:41:05 PM (6 years ago)
Author:
toby
Message:

save package info in GPX; display only in Debug mode

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1960 r1961  
    36763676        self.main.Show()
    36773677        self.SetTopWindow(self.main)
     3678        # save the current package versions
     3679        self.main.PackageVersions = {}
     3680        self.main.PackageVersions['Python'] = sys.version.split()[0]
     3681        for p in (wx,mpl,np,sp,ogl):
     3682            self.main.PackageVersions[p.__name__] = p.__version__
     3683        try:
     3684            self.main.PackageVersions[Image.__name__] = Image.VERSION
     3685        except:
     3686            try:
     3687                from PIL import PILLOW_VERSION
     3688                self.main.PackageVersions[Image.__name__] = PILLOW_VERSION
     3689            except:
     3690                pass
     3691        self.main.PackageVersions[' Platform'] = sys.platform+' '+platform.architecture()[0]+' '+platform.machine()
    36783692        # DEBUG: jump to sequential results
    36793693        #Id = G2gd.GetPatternTreeItemId(self.main,self.main.root,'Sequential results')
     
    36923706    #     self.main.OnFileOpen(None,filename)
    36933707    # removed because this gets triggered when a file is on the command line in canopy 1.4 -- not likely used anyway
    3694    
     3708       
    36953709def main():
    36963710    '''Start up the GSAS-II application'''
  • trunk/GSASIIIO.py

    r1960 r1961  
    10031003                if datum[0] == 'Controls' and 'LastSavedUsing' in datum[1]:
    10041004                    LastSavedUsing = datum[1]['LastSavedUsing']
     1005                if datum[0] == 'Controls' and 'PythonVersions' in datum[1] and GSASIIpath.GetConfigValue('debug'):
     1006                    print('Packages used to create .GPX file:')
     1007                    for p in sorted(datum[1]['PythonVersions'],key=lambda s: s.lower()):
     1008                        print("{:>14s}: {:s}".format(p,datum[1]['PythonVersions'][p]))
    10051009            for datus in data[1:]:
    10061010                sub = G2frame.PatternTree.AppendItem(Id,datus[0])
     
    10391043        file = open(G2frame.GSASprojectfile,'wb')
    10401044        print 'save to file: ',G2frame.GSASprojectfile
    1041         # stick the file name into the tree, if possible
     1045        # stick the file name into the tree and version info into tree so they are saved.
     1046        # (Controls should always be created at this point)
    10421047        try:
    10431048            Controls = G2frame.PatternTree.GetItemPyData(
     
    10451050            Controls['LastSavedAs'] = os.path.abspath(G2frame.GSASprojectfile)
    10461051            Controls['LastSavedUsing'] = str(GSASIIpath.GetVersionNumber())
     1052            Controls['PythonVersions'] = G2frame.PackageVersions
    10471053        except:
    10481054            pass
Note: See TracChangeset for help on using the changeset viewer.