Changeset 1701


Ignore:
Timestamp:
Mar 13, 2015 6:41:45 PM (7 years ago)
Author:
toby
Message:

more tutorial fixes

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrls.py

    r1696 r1701  
    20942094        self.dataLoc.SetLabel(tutorialPath)
    20952095        self.EndModal(wx.ID_OK)
     2096        wx.BeginBusyCursor()
    20962097        if self.BrowseMode == 0:
    20972098            # xfer data & web page locally, then open web page
     
    21142115            ShowWebPage(URL,self.frame)
    21152116        else:
     2117            wx.EndBusyCursor()
    21162118            raise Exception("How did this happen!")
     2119        wx.EndBusyCursor()
    21172120    def ValidateTutorialDir(self,fullpath=tutorialPath,baseURL=G2BaseURL):
    21182121        '''Load help to new directory or make sure existing directory looks correctly set up
     
    21222125            if os.path.exists(os.path.join(fullpath,"help")):
    21232126                if not GSASIIpath.svnGetRev(os.path.join(fullpath,"help")):
    2124                     raise Exception("Problem with "+fullpath+" dir help exists but is not in SVN")
    2125             else:
    2126                 raise Exception("Problem: dir "+fullpath+" exists does not contain help")
     2127                    print("Problem with "+fullpath+" dir help exists but is not in SVN")
     2128                    raise Exception
    21272129            if os.path.exists(os.path.join(fullpath,"Exercises")):
    21282130                if not GSASIIpath.svnGetRev(os.path.join(fullpath,"Exercises")):
    2129                     raise Exception("Problem with "+fullpath+" dir Exercises exists but is not in SVN")
    2130             else:
    2131                 raise Exception("Problem: dir "+fullpath+" exists does not contain Exercises")
    2132         else:
    2133             if not GSASIIpath.svnInstallDir(baseURL+"/MT",fullpath):
    2134                 raise Exception("Problem transferring empty directory from web")
     2131                    print("Problem with "+fullpath+" dir Exercises exists but is not in SVN")
     2132                    raise Exception
     2133            if (os.path.exists(os.path.join(fullpath,"help")) and
     2134                    os.path.exists(os.path.join(fullpath,"Exercises"))):
     2135                return True # both good
     2136            elif (os.path.exists(os.path.join(fullpath,"help")) or
     2137                    os.path.exists(os.path.join(fullpath,"Exercises"))):
     2138                print("Problem: dir "+fullpath+" exists has either help or Exercises, not both")
     2139                raise Exception
     2140        wx.BeginBusyCursor()
     2141        if not GSASIIpath.svnInstallDir(baseURL+"/MT",fullpath):
     2142            wx.EndBusyCursor()
     2143            print("Problem transferring empty directory from web")
     2144            raise Exception
     2145        wx.EndBusyCursor()
    21352146        return True
    21362147
     
    21392150        if GSASIIpath.svnSwitchDir("help",tutorialname,baseURL+"/Tutorials",fullpath):
    21402151            return True
    2141         raise Exception("Problem transferring Tutorial from web")
     2152        print("Problem transferring Tutorial from web")
     2153        raise Exception
    21422154       
    21432155    def LoadExercise(self,tutorialname,fullpath=tutorialPath,baseURL=G2BaseURL):
     
    21452157        if GSASIIpath.svnSwitchDir("Exercises",tutorialname,baseURL+"/Exercises",fullpath):
    21462158            return True
    2147         raise Exception("Problem transferring Exercise from web")
     2159        print ("Problem transferring Exercise from web")
     2160        raise Exception
    21482161       
    21492162    def SelectDownloadLoc(self,event):
     
    21672180                os.makedirs(pth)
    21682181            except OSError:
    2169                 G2MessageBox(self.frame,
    2170                 '''The selected directory is not valid.
    2171                
    2172                 It appears you do not have write access to this location.
    2173                 ''')
     2182                msg = 'The selected directory is not valid.\n\t'
     2183                msg += pth
     2184                msg += '\n\nAn attempt to create the directory failed'
     2185                G2MessageBox(self.frame,msg)
    21742186                return
     2187        self.ValidateTutorialDir(pth,G2BaseURL)
    21752188        try:
    21762189            self.ValidateTutorialDir(pth,G2BaseURL)
  • trunk/GSASIIddataGUI.py

    r1700 r1701  
    858858    def OnSelSpin(event):
    859859        hist = keyList[selSpin.GetValue()]
     860        selSpin.Destroy() # remove button to discourage pressing too fast
    860861        G2plt.PlotSizeStrainPO(G2frame,data)
    861862        wx.CallLater(100,UpdateDData,G2frame,DData,data,hist)
     
    870871    selSpin.SetValue(keyList.index(hist))
    871872    selSpin.SetRange(0,len(keyList)-1)
    872     selSpin.Bind(wx.EVT_SPIN,OnSelSpin)
    873873    selSizer.Add(selSpin)
    874874    select = wx.ListBox(DData,choices=keyList,style=wx.LB_SINGLE,size=(-1,100))
     
    997997    mainSizer.Add((5,5),0)
    998998    G2phsGUI.SetPhaseWindow(G2frame.dataFrame,DData,mainSizer)
     999    selSpin.Bind(wx.EVT_SPIN,OnSelSpin)
  • trunk/GSASIIpath.py

    r1696 r1701  
    400400    svn = whichsvn()
    401401    if not svn: return
    402     if os.path.exists(loadpath):
    403         raise Exception("Error: Attempting to create existing directory "+loadpath)
    404402    cmd = [svn,'co',URL,loadpath,'--non-interactive']
    405403    if svnVersionNumber() >= 1.6: cmd += ['--trust-server-cert']
Note: See TracChangeset for help on using the changeset viewer.