Changeset 10a483f in sasview for src/sas/guiframe
- Timestamp:
- Feb 14, 2015 11:19:06 AM (10 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:
- 30d7fb5
- Parents:
- b3efb7d (diff), 61f32d2b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/guiframe
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/guiframe/gui_manager.py
rb9a5f0e rad8872e 24 24 import logging 25 25 import httplib 26 import webbrowser 27 26 28 27 29 from sas.guiframe.events import EVT_CATEGORY … … 1325 1327 def _add_help_menu(self): 1326 1328 """ 1327 add help menu 1329 add help menu to menu bar. Includes welcome page, about page, 1330 tutorial PDF and documentation pages. 1328 1331 """ 1329 1332 # Help menu … … 1336 1339 id = wx.NewId() 1337 1340 self._help_menu.Append(id, '&Welcome', '') 1338 self._help_menu.AppendSeparator()1339 1341 wx.EVT_MENU(self, id, self.show_welcome_panel) 1340 1342 1341 # Look for help item in plug-ins 1342 for item in self.plugins: 1343 if hasattr(item, "help"): 1344 id = wx.NewId() 1345 self._help_menu.Append(id,'&%s Help' % item.sub_menu, '') 1346 wx.EVT_MENU(self, id, item.help) 1347 1348 # Only show new Sphinx docs link if version of wx supports displaying 1349 # it correctly. 1350 show_sphinx_docs = float(wx.__version__[:3]) >= 2.9 1351 if show_sphinx_docs: 1352 self._help_menu.AppendSeparator() 1353 id = wx.NewId() 1354 self._help_menu.Append(id, '&Sphinx Documentation', '') 1355 wx.EVT_MENU(self, id, self._onSphinxDocs) 1343 self._help_menu.AppendSeparator() 1344 id = wx.NewId() 1345 self._help_menu.Append(id, '& Documentation', '') 1346 wx.EVT_MENU(self, id, self._onSphinxDocs) 1356 1347 1357 1348 if config._do_tutorial and (IS_WIN or sys.platform =='darwin'): … … 2162 2153 def _onSphinxDocs(self, evt): 2163 2154 """ 2164 Pop up a Sphinx Documentation dialog. 2155 Bring up Sphinx Documentation. If Wx 2.9 or higher is installed 2156 with proper HTML support then Pop up a Sphinx Documentation dialog 2157 locally. If not pop up a new tab in the default system browser 2158 calling the documentation website. 2165 2159 2166 2160 :param evt: menu event … … 2168 2162 # Running SasView "in-place" using run.py means the docs will be in a 2169 2163 # different place than they would otherwise. 2170 SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 2171 if SPHINX_DOC_ENV in os.environ: 2172 docs_path = os.path.join(os.environ[SPHINX_DOC_ENV], "index.html") 2164 2165 show_sphinx_docs = float(wx.__version__[:3]) >= 2.9 2166 if show_sphinx_docs: 2167 SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 2168 if SPHINX_DOC_ENV in os.environ: 2169 docs_path = os.path.join(os.environ[SPHINX_DOC_ENV], "index.html") 2170 else: 2171 docs_path = os.path.join(PATH_APP, "..", "..", "doc", "index.html") 2172 2173 if os.path.exists(docs_path): 2174 from documentation_window import DocumentationWindow 2175 2176 sphinx_doc_viewer = DocumentationWindow(None, -1, docs_path) 2177 sphinx_doc_viewer.Show() 2178 else: 2179 logging.error("Could not find Sphinx documentation at '%' -- has it been built?" % docs_path) 2173 2180 else: 2174 docs_path = os.path.join(PATH_APP, "..", "..", "doc", "index.html") 2175 2176 if os.path.exists(docs_path): 2177 from documentation_window import DocumentationWindow 2178 2179 sphinx_doc_viewer = DocumentationWindow(None, -1, docs_path) 2180 sphinx_doc_viewer.Show() 2181 else: 2182 logging.error("Could not find Sphinx documentation at '%' -- has it been built?" % docs_path) 2181 #For red hat and maybe others who do not have Wx 3.0 2182 #just send to webpage of documentation 2183 webbrowser.open_new_tab('http://www.sasview.org/sasview') 2183 2184 2184 2185 def set_manager(self, manager): -
src/sas/guiframe/gui_statusbar.py
r79492222 rb3efb7d 315 315 if msg == "error": 316 316 e_msg = "Error(s) Occurred:\n" 317 e_msg += event.status 317 e_msg += "\t" + event.status + "\n\n" 318 e_msg += "Further information might be available in " 319 e_msg += "the Console log (bottom right corner)." 318 320 wx.MessageBox(e_msg, style=wx.ICON_ERROR) 319 321 -
src/sas/guiframe/local_perspectives/data_loader/data_loader.py
r7a04dbb rb3efb7d 171 171 file) for file in os.listdir(path)] 172 172 173 def _process_data_and_errors(self, item, p_file, output, message): 174 """ 175 Check to see if data set loaded with any errors. If so, append to 176 error message to be sure user knows the issue. 177 """ 178 data_error = False 179 for error_data in item.errors: 180 data_error = True 181 message += "\tError: {0}\n".format(error_data) 182 data = self.parent.create_gui_data(item, p_file) 183 output[data.id] = data 184 return output, message, data_error 185 173 186 def get_data(self, path, format=None): 174 187 """ … … 178 191 output = {} 179 192 any_error = False 193 data_error = False 180 194 error_message = "" 181 195 for p_file in path: 182 196 info = "info" 183 197 basename = os.path.basename(p_file) 184 root, extension = os.path.splitext(basename)198 _, extension = os.path.splitext(basename) 185 199 if extension.lower() in EXTENSIONS: 186 200 any_error = True … … 194 208 195 209 try: 210 message = "Loading Data... " + str(p_file) + "\n" 211 self.load_update(output=output, message=message, info=info) 196 212 temp = self.loader.load(p_file, format) 197 213 if temp.__class__.__name__ == "list": 198 214 for item in temp: 199 data = self.parent.create_gui_data(item, p_file) 200 output[data.id] = data 215 output, error_message, data_error = \ 216 self._process_data_and_errors(item, 217 p_file, 218 output, 219 error_message) 201 220 else: 202 data = self.parent.create_gui_data(temp, p_file) 203 output[data.id] = data 204 message = "Loading Data..." + str(p_file) + "\n" 205 self.load_update(output=output, message=message, info=info) 221 output, error_message, data_error = \ 222 self._process_data_and_errors(temp, 223 p_file, 224 output, 225 error_message) 206 226 except: 207 227 any_error = True 208 if error_message == "": 209 error = "Error: " + str(sys.exc_value) + "\n" 210 error += "while loading Data: \n%s\n" % str(p_file) 211 error_message = "The data file you selected could not be loaded.\n" 212 error_message += "Make sure the content of your file" 213 error_message += " is properly formatted.\n\n" 214 error_message += "When contacting the DANSE team, mention the" 215 error_message += " following:\n%s" % str(error) 216 else: 217 error_message += "%s\n"% str(p_file) 218 info = "error" 219 self.load_update(output=output, message=error_message, 228 if any_error or error_message != "": 229 if error_message == "": 230 error = "Error: " + str(sys.exc_value) + "\n" 231 error += "while loading Data: \n%s\n" % str(p_file) 232 error_message = "The data file you selected could not be loaded.\n" 233 error_message += "Make sure the content of your file" 234 error_message += " is properly formatted.\n\n" 235 error_message += "When contacting the DANSE team, mention the" 236 error_message += " following:\n%s" % str(error) 237 elif data_error: 238 base_message = "Errors occurred while loading {0}\n".format(p_file) 239 base_message += "The data file loaded but with errors.\n" 240 error_message = base_message + error_message 241 else: 242 error_message += "%s\n"% str(p_file) 243 info = "error" 244 self.load_update(output=output, message=error_message, 220 245 info=info) 221 246 222 message = "Loading Data Complete! " 247 else: 248 message = "Loading Data Complete! " 223 249 message += log_msg 224 if error_message != "":225 info = 'error'226 250 self.load_complete(output=output, error_message=error_message, 227 251 message=message, path=path, info=info)
Note: See TracChangeset
for help on using the changeset viewer.