Changeset 96814e1 in sasview for fittingview
- Timestamp:
- Dec 15, 2011 11:15:21 AM (13 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:
- ca6481c
- Parents:
- 8ff5cb3
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/models.py
r916f5c0 r96814e1 11 11 import logging 12 12 import py_compile 13 import shutil 13 14 from sans.guiframe.events import StatusEvent 14 15 # Explicitly import from the pluginmodel module so that py2exe … … 71 72 def find_plugins_dir(): 72 73 """ 73 Find path of the plugins dir 74 """ 75 dir = os.path.abspath(PLUGIN_DIR) 74 Find path of the plugins directory. 75 The plugin directory is located in the user's home directory. 76 """ 77 dir = os.path.join(os.path.expanduser("~"),'.sansview',PLUGIN_DIR) 78 79 # If the plugin directory doesn't exist, create it 76 80 if not os.path.isdir(dir): 77 dir = os.path.join(os.getcwd(), PLUGIN_DIR) 78 if not os.path.isdir(dir): 79 dir = os.path.join(os.path.dirname(__file__), PLUGIN_DIR) 80 if not os.path.isdir(dir): 81 dir = os.path.join(os.path.dirname(os.path.sys.path[0]), PLUGIN_DIR) 81 os.makedirs(dir) 82 83 # Place example user models as needed 84 if not os.path.isfile(os.path.join(dir,"testmodel.py")): 85 shutil.copy(os.path.join(os.path.dirname(__file__),"plugin_models","testmodel.py"), dir) 86 if not os.path.isfile(os.path.join(dir,"testmodel_2.py")): 87 shutil.copy(os.path.join(os.path.dirname(__file__),"plugin_models","testmodel_2.py"), dir) 88 if not os.path.isfile(os.path.join(dir,"sum_p1_p2.py")): 89 shutil.copy(os.path.join(os.path.dirname(__file__),"plugin_models","sum_p1_p2.py"), dir) 90 82 91 return dir 83 92 … … 471 480 """ 472 481 is_modified = False 473 if os.path.isdir(PLUGIN_DIR): 474 temp = os.path.getmtime(PLUGIN_DIR) 482 plugin_dir = find_plugins_dir() 483 if os.path.isdir(plugin_dir): 484 temp = os.path.getmtime(plugin_dir) 475 485 if self.last_time_dir_modified != temp: 476 486 is_modified = True
Note: See TracChangeset
for help on using the changeset viewer.