Changeset 23ccf07 in sasview for sansview/perspectives/fitting
- Timestamp:
- Apr 26, 2011 1:20:22 PM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 60642b4
- Parents:
- 168a845
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/help_panel.py
r389c991 r23ccf07 5 5 from wx.lib.splitter import MultiSplitterWindow 6 6 import os 7 import sys 7 8 8 9 9 10 class HelpWindow(wx.Frame): 10 11 """ … … 15 16 contains help info 16 17 """ 17 18 path = os.path.dirname(__file__) 19 temp_path = os.path.join(path,'images') 20 ico_file = os.path.join(temp_path,'ball.ico') 21 if os.path.isfile(ico_file): 22 self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO)) 23 else: 24 temp_path = os.path.join(os.getcwd(),'images') 25 ico_file = os.path.join(temp_path,'ball.ico') 26 if os.path.isfile(ico_file): 27 self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO)) 28 else: 29 ico_file = os.path.join(os.path.dirname(os.path.sys.path[0]), 30 'images', 'ball.ico') 31 if os.path.isfile(ico_file): 32 self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO)) 33 18 34 splitter = MultiSplitterWindow(self, style=wx.SP_LIVE_UPDATE) 19 35 rpanel = wx.Panel(splitter, -1) … … 52 68 # get the media path 53 69 path = models.get_data_path(media='media') 70 if not os.path.isdir(path): 71 path = os.path.dirname(os.path.sys.path[0]) 54 72 self.path = os.path.join(path,"model_functions.html") 55 73 self.path_pd = os.path.join(path,"pd_help.html") … … 61 79 </body> 62 80 </html>""" 63 page="""<html> 81 82 if not os.path.isfile(os.path.join(path, "change_scale_help.html")): 83 path = os.path.join(os.path.dirname(os.path.sys.path[0]), 'media') 84 page = """<html> 64 85 <body> 65 86 <ul> 66 <li><a href ="media/change_scale_help.html" target ="showframe">Change Scale</a><br></li> 67 <li><a href ="media/reset_Graph_help.html" target ="showframe">Graph Help</a><br></li> 68 <li><a href ="media/status_bar_help.html" target ="showframe">Status Bar Help</a><br></li> 69 <li><a href ="media/load_data_help.html" target ="showframe">Load a File</a><br></li> 70 <li><a href ="media/simultaneous_fit_help.html" target ="showframe">Simultaneous Fit</a><br></li> 71 <li><a href ="media/single_fit_help.html" target ="showframe">Single Fit</a><br></li> 72 <li><a href ="media/model_use_help.html" target ="showframe">Visualize Model</a><br></li> 73 <li><a href ="media/averaging_help.html" target ="showframe">Data Averaging</a><br></li> 87 <li><a href ="%s" target ="showframe">Change Scale</a><br></li> 88 """ % str(os.path.join(path, "change_scale_help.html")) 89 page += """ 90 <li><a href ="%s" target ="showframe">Graph Help</a><br></li> 91 """ % str(os.path.join(path, "reset_Graph_help.html")) 92 page += """ 93 <li><a href ="%s" target ="showframe">Status Bar Help</a><br></li> 94 """ % str(os.path.join(path, "status_bar_help.html")) 95 page += """ 96 <li><a href ="%s" target ="showframe">Load a File</a><br></li> 97 """ % str(os.path.join(path, "load_data_help.html")) 98 page += """ 99 <li><a href ="%s" 100 target ="showframe">Simultaneous Fit</a><br></li> 101 """ % str(os.path.join(path, "simultaneous_fit_help.html")) 102 page += """ 103 <li><a href ="%s" 104 target ="showframe">Single Fit</a><br></li> 105 """ % str(os.path.join(path, "single_fit_help.html")) 106 page += """ 107 <li><a href ="%s" 108 target ="showframe">Visualize Model</a><br></li> 109 """ % str(os.path.join(path, "model_use_help.html")) 110 page += """ 111 <li><a href ="%s" 112 target ="showframe">Data Averaging</a><br></li> 113 """ % str(os.path.join(path, "averaging_help.html")) 114 page += """ 74 115 <li><a href ="%s" target ="showframe">Model Functions</a><br></li> 75 <li><a href ="%s" target ="showframe">Polydispersion Distributions</a><br></li> 116 """ % str(self.path) 117 page += """<li><a href ="%s" target ="showframe"> 118 Polydispersion Distributions</a><br></li> 119 """ % str(self.path_pd) 120 page += """ 76 121 <li><a href ="%s" target ="showframe">Smear Computation</a><br></li> 77 <li><a href ="media/key_help.html" target ="showframe">Key Combination</a><br></li> 122 """ % str(self.path_sm) 123 page += """<li><a href ="%s" 124 target ="showframe">Key Combination</a><br></li> 78 125 </ul> 79 126 </body> 80 </html>""" % (self.path, self.path_pd, self.path_sm)127 </html>""" % str(os.path.join(path, "key_help.html")) 81 128 82 129 self.rhelp.SetPage(page1) -
sansview/perspectives/fitting/models.py
r5901bb9 r23ccf07 9 9 # Time is needed by the log method 10 10 import time 11 import logging 11 12 12 13 from sans.guiframe.events import StatusEvent … … 17 18 18 19 PLUGIN_DIR = 'plugins' 20 path = os.path.dirname(os.path.sys.path[0]) 21 file = os.path.join(path, "plugins.log") 22 19 23 20 24 def log(message): 21 25 """ 22 26 """ 23 out = open( "plugins.log", 'a')27 out = open(file, 'a') 24 28 out.write("%10g: %s\n" % (time.clock(), message)) 25 29 out.close() … … 107 111 except: 108 112 # Don't deal with bad plug-in imports. Just skip. 113 msg = "Could not import model plugin: %s\n" % sys.exc_value 114 log(msg) 109 115 pass 110 116 return plugins … … 172 178 in the directory if file were modified 173 179 """ 180 temp = {} 174 181 if self.is_changed(): 175 182 #always recompile the folder plugin 176 183 import compileall 177 compileall.compile_dir(dir=PLUGIN_DIR, force=1) 178 dir = os.path.join(os.getcwd(), 'plugins') 179 log("looking for models in: %s" % str(dir)) 180 return _findModels(PLUGIN_DIR) 181 return {} 182 183 184 if os.path.isdir(os.path.abspath(PLUGIN_DIR)): 185 dir = os.path.abspath(PLUGIN_DIR) 186 else: 187 dir = os.path.join(os.path.dirname(os.path.sys.path[0]), 'plugins') 188 if not os.path.isdir(dir): 189 log("Could not locate models plugins in: %s" % str(dir)) 190 else: 191 log("looking for models in: %s" % str(dir)) 192 compileall.compile_dir(dir=dir, ddir=dir, force=1, quiet=True) 193 return _findModels(dir) 194 logging.info("pluging model : %s\n" % str(temp)) 195 return temp 196 184 197 def _getModelList(self): 185 198 """
Note: See TracChangeset
for help on using the changeset viewer.