Changeset 1020


Ignore:
Timestamp:
Aug 7, 2013 5:38:21 PM (8 years ago)
Author:
toby
Message:

fix Matt's path bug; minor disagl cleanup

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1006 r1020  
    216216        #pathlist = sys.path[:]
    217217        #if path2GSAS2 not in pathlist: pathlist.append(path2GSAS2)
    218         path2GSAS2 = os.path.join(
    219             os.path.dirname(os.path.realpath(__file__)), # location of this file
    220             'imports')
     218        #path2GSAS2 = os.path.join(
     219        #    os.path.dirname(os.path.realpath(__file__)), # location of this file
     220        #    'imports')
    221221        pathlist = sys.path[:]
    222         if path2GSAS2 not in pathlist: pathlist.append(path2GSAS2)
     222        #if path2GSAS2 not in pathlist: pathlist.append(path2GSAS2)
    223223
    224224        filelist = []
     
    10401040            except:
    10411041                pass
    1042         path2GSAS2 = os.path.join(
    1043             os.path.dirname(os.path.realpath(__file__)), # location of this file
    1044             'exports')
    1045         if path2GSAS2 not in sys.path: sys.path.append(path2GSAS2)
     1042        #path2GSAS2 = os.path.join(
     1043        #    os.path.dirname(os.path.realpath(__file__)), # location of this file
     1044        #    'exports')
     1045        #if path2GSAS2 not in sys.path: sys.path.append(path2GSAS2)
    10461046        #reload(G2IO)
    10471047        import G2cif
  • trunk/GSASIIIO.py

    r1010 r1020  
    15521552                 G2frame,
    15531553                 formatName,
     1554                 extension,
    15541555                 longFormatName=None,
    15551556                 ):
    15561557        self.G2frame = G2frame
    15571558        self.formatName = formatName # short string naming file type
     1559        self.extension = extension
    15581560        if longFormatName: # longer string naming file type
    15591561            self.longFormatName = longFormatName
     
    16771679            for key2 in self.Histograms[key1]:
    16781680                print '      ',key2,Show(self.Histograms[key1][key2])
     1681
     1682    def defSaveFile(self):
     1683        return os.path.abspath(
     1684            os.path.splitext(self.G2frame.GSASprojectfile
     1685                             )[0]+self.extension)
     1686       
     1687    def askSaveFile(self):
     1688        '''Ask the user to supply a file name
     1689
     1690        :returns: a file name (str)
     1691        '''
     1692        defnam = os.path.splitext(
     1693            os.path.split(self.G2frame.GSASprojectfile)[1]
     1694            )[0]+self.extension
     1695        dlg = wx.FileDialog(
     1696            self.G2frame, 'Input name for file to write', '.', defnam,
     1697            self.longFormatName+' (*'+self.extension+')|*'+self.extension,
     1698            wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT|wx.CHANGE_DIR)
     1699        try:
     1700            if dlg.ShowModal() == wx.ID_OK:
     1701                filename = dlg.GetPath()
     1702                # make sure extension is correct
     1703                filename = os.path.splitext(filename)[0]+self.extension
     1704            else:
     1705                filename = None
     1706        finally:
     1707            dlg.Destroy()
     1708        return filename
     1709       
    16791710                   
    16801711######################################################################
  • trunk/GSASIIpath.py

    r989 r1020  
    3737    else:
    3838        bindir = 'binlinux%d.%d' % sys.version_info[0:2]
    39 for loc in sys.path[0],os.path.split(__file__)[0]:
     39for loc in sys.path[0],os.path.abspath(os.path.split(__file__)[0]):
    4040    if bindir:
    4141        if os.path.exists(os.path.join(loc,bindir)) and os.path.join(loc,bindir) not in sys.path:
     
    5050if bindir == None:
    5151    raise Exception,"**** ERROR GSAS-II binary libraries not found, GSAS-II fails ****"
    52 
     52# add the data import and export directory to the search path
     53path2GSAS2 = os.path.join(
     54    os.path.dirname(os.path.realpath(__file__)), # location of this file
     55    'imports')
     56pathlist = sys.path[:]
     57if path2GSAS2 not in sys.path: sys.path.append(path2GSAS2)
     58path2GSAS2 = os.path.join(
     59    os.path.dirname(os.path.realpath(__file__)), # location of this file
     60    'exports')
     61if path2GSAS2 not in sys.path: sys.path.append(path2GSAS2)
    5362# routines for looking a version numbers in files
    5463version = -1
  • trunk/GSASIIphsGUI.py

    r1016 r1020  
    8787
    8888    '''
    89        
     89
    9090#patch
    9191    if 'RBModels' not in data:
     
    15641564            if dlg.ShowModal() == wx.ID_OK:
    15651565                DisAglCtls = dlg.GetData()
     1566            else:
     1567                dlg.Destroy()
     1568                return
    15661569            dlg.Destroy()
    15671570            generalData['DisAglCtls'] = DisAglCtls
     
    15861589            except KeyError:        # inside DistAngle for missing atom types in DisAglCtls
    15871590                print '**** ERROR - try again but do "Reset" to fill in missing atom types ****'
    1588                
     1591        else:
     1592                print "select one or more rows of atoms"
     1593                G2frame.ErrorDialog('Select atom',"select one or more rows of atoms then redo")
     1594                       
    15891595    def OnReImport(event):
    15901596        print 'reimport atoms from file to be developed'
Note: See TracChangeset for help on using the changeset viewer.