Changeset 660


Ignore:
Timestamp:
Jun 29, 2012 4:13:28 PM (9 years ago)
Author:
toby
Message:

try revision number tracking

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r655 r660  
    5858# load the GSAS routines
    5959import GSASIIpath
     60GSASIIpath.SetVersionNumber("$Revision$")
    6061import GSASIIIO as G2IO
    6162import GSASIIgrid as G2gd
     
    8687__version__ = '0.2.0'
    8788G2gd.__version__ = __version__
    88 print "This is GSAS-II version:     ",__version__
     89print "This is GSAS-II version:     ",__version__,' revision '+str(GSASIIpath.GetVersionNumber())
    8990
    9091# useful degree trig functions
     
    402403
    403404    def _init_Import_Phase(self,parent):
    404         '''import all the G2importphase*.py files that are found in the
     405        '''import all the G2phase*.py files that are found in the
    405406        path and configure the Import Phase menus accordingly
    406407        '''
     
    456457       
    457458    def _init_Import_Sfact(self,parent):
    458         '''import all the G2importsfact*.py files that are found in the
     459        '''import all the G2sfact*.py files that are found in the
    459460        path and configure the Import Structure Factor menus accordingly
    460461        '''
     
    512513
    513514    def _init_Import_powder(self,parent):
    514         '''import all the G2importpwd*.py files that are found in the
     515        '''import all the G2pwd*.py files that are found in the
    515516        path and configure the Import Powder Data menus accordingly
    516517        '''
     
    789790        return # success
    790791
     792    def _init_Exports(self,parent):
     793        '''
     794        '''
     795        #self.Exportlist = []
     796        #self._init_Import_routines(parent,'phase',
     797        #                           self.ImportPhaseReaderlist,
     798        #                           'Phase')
     799        submenu = wx.Menu()
     800        item = parent.AppendMenu(
     801            wx.ID_ANY, 'entire project',
     802            submenu, help='Export entire project')
     803        item = submenu.Append(
     804            wx.ID_ANY,
     805            help='this is a module for testing',
     806            kind=wx.ITEM_NORMAL,
     807            text='to test file')
     808        #self.ImportMenuId[item.GetId()] = reader
     809        self.Bind(wx.EVT_MENU, self.OnExportTest, id=item.GetId())
     810        # for reader in self.ImportPhaseReaderlist:
     811        #     item = submenu.Append(wx.ID_ANY,
     812        #         help='to Import specific format phase data',
     813        #         kind=wx.ITEM_NORMAL,text='from '+reader.formatName+' file')
     814        #     self.ImportMenuId[item.GetId()] = reader
     815        #     self.Bind(wx.EVT_MENU, self.OnImportPhase, id=item.GetId())
     816        # item = submenu.Append(wx.ID_ANY,
     817        #                       help='Import phase data, use file to try to determine format',
     818        #                       kind=wx.ITEM_NORMAL,
     819        #                       text='guess format from file')
     820        # self.Bind(wx.EVT_MENU, self.OnImportPhase, id=item.GetId())
     821        import G2export
     822       
     823    def OnExportTest(self,event):
     824        import G2export
     825        reload(G2export)
     826        G2export.ProjExport(self)
     827       
     828
     829
    791830    def _init_coll_Export_Items(self,parent):
    792831        self.ExportPattern = parent.Append(help='Select PWDR item to enable',id=wxID_EXPORTPATTERN, kind=wx.ITEM_NORMAL,
     
    832871        self._init_Import_Sfact(self.Import)
    833872        self._init_coll_Export_Items(self.Export)
     873        self._init_Exports(self.Export)
    834874       
    835875    def _init_ctrls(self, parent):
     
    16701710            if self.dataFrame:
    16711711                self.dataFrame.Clear()
    1672             dlg = wx.MessageDialog(self, 'Overwrite?','Project exists!',  wx.OK | wx.CANCEL)
     1712            dlg = wx.MessageDialog(
     1713                self,
     1714                'Do you want to overwrite the current project? '
     1715                'Any unsaved changes will be lost. Press OK to continue.',
     1716                'Overwrite?',  wx.OK | wx.CANCEL)
    16731717            try:
    16741718                result = dlg.ShowModal()
     
    17461790                self.GSASprojectfile = dlg.GetPath()
    17471791                self.GSASprojectfile = G2IO.FileDlgFixExt(dlg,self.GSASprojectfile)
    1748                 self.PatternTree.SetItemText(self.root,'Loaded Data: '+self.GSASprojectfile)
     1792                self.PatternTree.SetItemText(self.root,'Saving project as'+self.GSASprojectfile)
    17491793                G2IO.ProjFileSave(self)
    17501794                self.dirname = dlg.GetDirectory()
  • trunk/GSASIIpath.py

    r584 r660  
    3434if bindir == None:
    3535    print "Warning GSAS-II binary libraries not found, some sections of code will not function"
     36
     37# track the latest version number here
     38version = -1
     39def SetVersionNumber(RevString):
     40    '''RevString is something like "$Revision$" that is set by subversion when
     41    the file is retrieved from subversion.
     42    '''
     43    try:
     44        RevVersion = int(RevString.split(':')[1].split()[0])
     45        global version
     46        version = max(version,RevVersion)
     47    except:
     48        pass
     49       
     50def GetVersionNumber():
     51    return version
  • trunk/GSASIIstruct.py

    r657 r660  
    1818import scipy.optimize as so
    1919import GSASIIpath
     20GSASIIpath.SetVersionNumber("$Revision$")
    2021import GSASIIElem as G2el
    2122import GSASIIlattice as G2lat
Note: See TracChangeset for help on using the changeset viewer.