Changeset 4687
- Timestamp:
- Dec 30, 2020 11:44:57 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CifFile/CifFile.py
r4123 r4687 291 291 elif self.diclang == "DDLm": 292 292 self.scoping = 'dictionary' #expose all save frames 293 if do_imports is not'No':293 if do_imports != 'No': 294 294 self.ddlm_import(import_mode=do_imports)#recursively calls this routine 295 295 self.create_alias_table() -
trunk/GSASIIdataGUI.py
r4685 r4687 8675 8675 G2plt.PlotSngl(G2frame,newPlot=True,Data=controls,hklRef=refList) 8676 8676 G2frame.dataWindow.SetDataSize() 8677 # make sure parent histogram item is displayed 8678 if item != G2frame.GPXtree.GetSelection(): 8679 wx.CallAfter(G2frame.GPXtree.SelectItem,item) 8677 8680 8678 8681 ################################################################################ -
trunk/GSASIIfiles.py
r4656 r4687 85 85 (capitalization and additional letters ignored.) 86 86 ''' 87 if G2printLevel is'none': return87 if G2printLevel == 'none': return 88 88 if kwargs.get('mode') is None: 89 89 testStr = str(args[0]).lower() -
trunk/GSASIIpath.py
r4645 r4687 248 248 p = subprocess.Popen([exe_file,'help'],stdout=subprocess.PIPE) 249 249 res = p.stdout.read() 250 if not res: return 250 251 p.communicate() 251 252 svnLocCache = os.path.abspath(exe_file) … … 658 659 for i in cmd: s += i + ' ' 659 660 print(s) 660 if svnCleanup( fpath):661 if svnCleanup(loadpath): 661 662 s = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE) 662 663 out,err = MakeByte2str(s.communicate()) … … 1252 1253 time.sleep(1) # delay to give the main process a chance to exit 1253 1254 # perform an update and restart GSAS-II 1254 project,version = sys.argv[1:3] 1255 try: 1256 project,version = sys.argv[1:3] 1257 except ValueError: 1258 project = None 1259 version = 'trunk' 1255 1260 loc = os.path.dirname(__file__) 1256 1261 if version == 'trunk': -
trunk/GSASIIplot.py
r4671 r4687 1874 1874 Page.plotStyle['qPlot'] = False 1875 1875 Page.plotStyle['dPlot'] = False 1876 elif (event.key == 'e' and 'PWDR' in plottype and G2frame.SinglePlot and ifLimits 1877 and not G2frame.Contour): 1878 Page.excludeMode = not Page.excludeMode 1879 if Page.excludeMode: 1880 try: # fails from key menu 1881 Page.startExclReg = event.xdata 1882 except AttributeError: 1883 G2G.G2MessageBox(G2frame,'To create an excluded region, after clicking on "OK", move to the beginning of the region and press the "e" key. Then move to the end of the region and press "e" again','How to exclude') 1884 return 1885 Plot.axvline(Page.startExclReg,color='b',dashes=(2,3)) 1886 Page.canvas.draw() 1887 Page.savedplot = Page.canvas.copy_from_bbox(Page.figure.gca().bbox) 1888 y1, y2= Page.figure.axes[0].get_ylim() 1889 Page.vLine = Plot.axvline(Page.startExclReg,color='b', 1890 dashes=(2,3)) 1891 Page.canvas.draw() 1892 else: 1893 Page.savedplot = None 1894 wx.CallAfter(PlotPatterns,G2frame,newPlot=False, 1895 plotType=plottype,extraKeys=extraKeys) 1896 if abs(Page.startExclReg - event.xdata) < 0.1: return 1897 LimitId = G2gd.GetGPXtreeItemId(G2frame,PatternId, 'Limits') 1898 data = G2frame.GPXtree.GetItemPyData(LimitId) 1899 mn = min(Page.startExclReg, event.xdata) 1900 mx = max(Page.startExclReg, event.xdata) 1901 data.append([mn,mx]) 1902 G2pdG.UpdateLimitsGrid(G2frame,data,plottype) 1903 return 1876 1904 elif event.key == 'a' and 'PWDR' in plottype and G2frame.SinglePlot and not ( 1877 1905 Page.plotStyle['logPlot'] or Page.plotStyle['sqrtPlot'] or G2frame.Contour): … … 1957 1985 1958 1986 def OnMotion(event): 1959 'Update the status line with info r based on the mouse position'1987 'Update the status line with info based on the mouse position' 1960 1988 SetCursor(Page) 1989 # excluded region animation 1990 if Page.excludeMode and Page.savedplot: 1991 if event.xdata is None or G2frame.GPXtree.GetItemText( 1992 G2frame.GPXtree.GetSelection()) != 'Limits': # reset if out of bounds or not on limits 1993 Page.savedplot = None 1994 Page.excludeMode = False 1995 wx.CallAfter(PlotPatterns,G2frame,newPlot=False, 1996 plotType=plottype,extraKeys=extraKeys) 1997 return 1998 else: 1999 Page.canvas.restore_region(Page.savedplot) 2000 Page.vLine.set_xdata([event.xdata,event.xdata]) 2001 Page.figure.gca().draw_artist(Page.vLine) 2002 Page.canvas.blit(Page.figure.gca().bbox) 2003 return 2004 elif Page.excludeMode or Page.savedplot: # reset if out of mode somehow 2005 Page.savedplot = None 2006 Page.excludeMode = False 2007 wx.CallAfter(PlotPatterns,G2frame,newPlot=False, 2008 plotType=plottype,extraKeys=extraKeys) 2009 return 1961 2010 if event.button and G2frame.Contour and G2frame.TforYaxis: 1962 2011 ytics = imgAx.get_yticks() … … 2218 2267 LimitId = G2gd.GetGPXtreeItemId(G2frame,PatternId, 'Limits') 2219 2268 data = G2frame.GPXtree.GetItemPyData(LimitId) 2269 # likely that these conversions are not needed, Q & d not allowed on limits (BHT) 2220 2270 if Page.plotStyle['qPlot']: #qplot - convert back to 2-theta 2221 2271 xy[0] = G2lat.Dsp2pos(Parms,2*np.pi/xy[0]) … … 2675 2725 global Pattern,mcolors,Plot,Page,imgAx,Temps 2676 2726 plottype = plotType 2677 2727 2678 2728 if not G2frame.PatternId: 2679 2729 return … … 2688 2738 publish = None 2689 2739 new,plotNum,Page,Plot,limits = G2frame.G2plotNB.FindPlotTab('Powder Patterns','mpl',publish=publish) 2740 Page.excludeMode = False # True when defining an excluded region 2741 Page.savedplot = None 2690 2742 #patch 2691 2743 if 'Offset' not in Page.plotStyle and plotType in ['PWDR','SASD','REFD']: #plot offset data … … 2825 2877 Page.Choice += ['o: add obs, calc,... to legend',] 2826 2878 if ifLimits: 2827 Page.Choice += ['s: toggle sqrt plot','w: toggle (Io-Ic)/sig plot', 2828 '+: no selection'] 2879 Page.Choice += ['e: create excluded region', 2880 's: toggle sqrt plot','w: toggle (Io-Ic)/sig plot', 2881 '+: no selection'] 2829 2882 else: 2830 2883 Page.Choice += ['q: toggle q plot','s: toggle sqrt plot', … … 7066 7119 artist = Circle(spot[:2],radius=spot[2]/2,fc='none',ec='r', 7067 7120 picker=True) 7068 GSASIIpath.IPyBreak()7121 #GSASIIpath.IPyBreak() 7069 7122 Page.figure.gca().add_artist(artist) 7070 7123 artist.itemNumber = len(Masks['Points'])-1 -
trunk/makeMacApp.py
r3997 r4687 5 5 6 6 This script creates an AppleScript app bundle to launch GSAS-II. The app is 7 created in the directory where the GSAS-II script (GSASII.py) is located. 8 A softlink to Python is created, but is named GSAS-II, and placed inside 9 the bundle so that GSAS-II shows up as the name of the app rather than 10 Python in the menu bar, etc. A soft link named GSAS-II.py, referencing 11 GSASII.py, is created so that appropriate menu items also are labeled with 12 GSAS-II (but not the right capitalization, alas). 7 created in the directory where the GSAS-II script (.../GSASII/GSASII.py) 8 is located. A softlink to Python is created inside that app bundle, 9 but the softlink name is GSAS-II so that GSAS-II shows up as the name 10 of the app rather than Python in the menu bar, etc. A soft link named 11 GSAS-II.py, referencing the GSASII.py script, is created so that some file 12 menu items also are labeled with GSAS-II (but not the right capitalization, 13 alas). 13 14 14 15 This has been tested with several versions of Python interpreters … … 17 18 it searches for a pythonw image and tries that. 18 19 19 Run this script with no arguments or with one optional argument, 20 a reference to the GSASII.py, with a relative or absolute path. Either way 21 the path will be converted via an absolute path. If no arguments are 22 supplied, the GSASII.py script must be located in the same directory as 23 this file. 24 25 ''' 20 Run this script with no arguments or with one or two arguments. 21 The first argument, if supplied, is a reference to the GSASII.py script, 22 which can have a relative or absolute path (the absolute path is determined). 23 If not supplied, the GSASII.py script will be used from the directory where 24 this (makeMacApp.py) script is found. The second argument, if supplied, 25 provides the name for the app to be created. This can be used to create 26 multiple copies of the app using different Python versions (likely use for 27 development only). 28 ''' 29 26 30 from __future__ import division, print_function 27 31 import sys, os, os.path, stat, shutil, subprocess, plistlib 28 32 def Usage(): 29 print("\n\tUsage: python "+sys.argv[0]+" [<GSAS-II script>] \n")33 print("\n\tUsage: python "+sys.argv[0]+" [<GSAS-II script>] [project]\n") 30 34 sys.exit() 31 35 … … 57 61 )) 58 62 elif len(sys.argv) == 2: 59 script = os.path.abspath(sys.argv[1]) 63 script = os.path.abspath(sys.argv[1]) 64 elif len(sys.argv) == 3: 65 script = os.path.abspath(sys.argv[1]) 66 project = sys.argv[2] 60 67 else: 61 68 Usage() … … 139 146 ''' 140 147 # create a link named GSAS-II.py to the script 141 newScript = os.path.join(scriptdir, project+'.py')148 newScript = os.path.join(scriptdir,'GSAS-II.py') 142 149 if os.path.exists(newScript): # cleanup 143 150 print("\nRemoving sym link",newScript)
Note: See TracChangeset
for help on using the changeset viewer.