Changeset 8ab3302 in sasview
- Timestamp:
- Dec 22, 2011 11:55:32 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:
- 273801b
- Parents:
- 7983000f
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/models.py
r7c8d3093 r8ab3302 18 18 from sans.models.pluginmodel import Model1DPlugin 19 19 20 PLUGIN_DIR = 'plugin s'20 PLUGIN_DIR = 'plugin_models' 21 21 22 22 def log(message): … … 75 75 The plugin directory is located in the user's home directory. 76 76 """ 77 dir = os.path.join(os.path.expanduser("~"),'.sansview', PLUGIN_DIR)77 dir = os.path.join(os.path.expanduser("~"),'.sansview', PLUGIN_DIR) 78 78 79 79 # If the plugin directory doesn't exist, create it … … 81 81 os.makedirs(dir) 82 82 83 # Find paths needed 84 try: 85 # For source 86 if os.path.isdir(os.path.dirname(__file__)): 87 p_dir = os.path.join(os.path.dirname(__file__), PLUGIN_DIR) 88 else: 89 raise 90 except: 91 # Check for data path next to exe/zip file. 92 #Look for maximum n_dir up of the current dir to find plugins dir 93 n_dir = 12 94 p_dir = None 95 f_dir = os.path.join(os.path.dirname(__file__)) 96 for i in range(n_dir): 97 if i > 1: 98 f_dir, _ = os.path.split(f_dir) 99 plugin_path = os.path.join(f_dir, PLUGIN_DIR) 100 if os.path.isdir(plugin_path): 101 p_dir = plugin_path 102 break 103 if not p_dir: 104 raise 105 83 106 # 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 107 for file in os.listdir(p_dir): 108 file_path = os.path.join(p_dir, file) 109 if os.path.isfile(file_path): 110 if file.split(".")[-1] == 'py' and\ 111 file.split(".")[0] != '__init__': 112 if not os.path.isfile(os.path.join(dir, file)): 113 shutil.copy(file_path, dir) 91 114 return dir 92 115 -
sansguiframe/src/sans/guiframe/customdir.py
rf9505c30 r8ab3302 12 12 The plugin directory is located in the user's home directory. 13 13 """ 14 dir = os.path.join(os.path.expanduser("~"), ("." + APPLICATION_NAME), CONF_DIR) 14 dir = os.path.join(os.path.expanduser("~"), 15 ("." + APPLICATION_NAME), CONF_DIR) 15 16 16 17 return dir … … 26 27 file = os.path.join(dir, "custom_config.py") 27 28 # Place example user models as needed 28 if not os.path.isfile(file): 29 shutil.copyfile(os.path.join(path, "custom_config.py"), file) 29 try: 30 if not os.path.isfile(file): 31 shutil.copyfile(os.path.join(path, "custom_config.py"), file) 32 except: 33 # Check for data path next to exe/zip file. 34 #Look for maximum n_dir up of the current dir to find plugins dir 35 n_dir = 12 36 is_dir = False 37 f_dir = path 38 for i in range(n_dir): 39 if i > 1: 40 f_dir, _ = os.path.split(f_dir) 41 temp_path = os.path.join(f_dir, "custom_config.py") 42 if os.path.isfile(temp_path): 43 shutil.copyfile(temp_path, file) 44 is_dir = True 45 break 46 if not is_dir: 47 raise 30 48 31 49 return dir -
sansview/installer_new.iss
rf9505c30 r8ab3302 68 68 Source: "dist\SansView.exe"; DestDir: "{app}"; Flags: ignoreversion 69 69 Source: "dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs 70 Source: "dist\plugin_models\*"; DestDir: "{userappdata}\..\.sansview\plugin s"; Flags: recursesubdirs createallsubdirs71 Source: "dist\config\custom_config.py"; DestDir: "{userappdata}\..\.sansview\config"; Flags: recursesubdirs createallsubdirs 70 Source: "dist\plugin_models\*"; DestDir: "{userappdata}\..\.sansview\plugin_models"; Flags: recursesubdirs createallsubdirs 71 Source: "dist\config\custom_config.py"; DestDir: "{userappdata}\..\.sansview\config"; Flags: recursesubdirs createallsubdirs 72 72 ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 73 73 -
sansview/setup_exe.py
r7983000f r8ab3302 222 222 f = 'custom_config.py' 223 223 if os.path.isfile(f): 224 data_files.append(('.', [f])) 224 225 data_files.append(('config', [f])) 225 226 f = 'local_config.py' -
setup.py
r5c77050 r8ab3302 3 3 #TODO: Add checks to see that all the dependencies are on the system 4 4 """ 5 # [command] can be any of the following: 6 # -nomp: no openmp: Use this flag; C-lib without openmp as well as numpy < 1.6 7 5 8 import sys 6 7 9 import os 8 10 import platform … … 16 18 try: 17 19 import numpy 18 NUMPY_INC = os.path.join(os.path.split(numpy.__file__)[0],"core","include") 20 NUMPY_INC = os.path.join(os.path.split(numpy.__file__)[0], 21 "core","include") 19 22 except: 20 print "\nNumpy is needed to build SansView. Try easy_install numpy.\n %s" % str(sys.exc_value) 23 msg = "\nNumpy is needed to build SansView. " 24 print msg, "Try easy_install numpy.\n %s" % str(sys.exc_value) 21 25 sys.exit(0) 22 26 … … 31 35 ext_modules = [] 32 36 37 # Remove all files that should be updated by this setup 38 # We do this here because application updates these files from .sansview 39 # except when there is no such file 40 # Todo : make this list generic 41 plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py', 42 'sum_Ap1_1_Ap2.py', 'sum_p1_p2.py', 43 'testmodel_2.py', 'testmodel.py'] 44 sans_dir = os.path.join(os.path.expanduser("~"),'.sansview') 45 if os.path.isdir(sans_dir): 46 f_path = os.path.join(sans_dir, "sansview.log") 47 if os.path.isfile(f_path): 48 os.remove(f_path) 49 f_path = os.path.join(sans_dir, 'config', "custom_config.py") 50 if os.path.isfile(f_path): 51 os.remove(f_path) 52 f_path = os.path.join(sans_dir, 'plugin_models') 53 if os.path.isdir(f_path): 54 for file in os.listdir(f_path): 55 if file in plugin_model_list: 56 file_path = os.path.join(f_path, file) 57 os.remove(file_path) 58 33 59 if sys.argv[-1] == "-nomp": 34 60 # Disable OpenMP … … 56 82 print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 57 83 58 if not (sys.platform =='darwin' and not is_64bits):84 if not (sys.platform =='darwin' and not is_64bits): 59 85 if copt.has_key(c): 60 86 for e in self.extensions: … … 74 100 guiframe_path = os.path.join("sansguiframe", "src", "sans", "guiframe") 75 101 package_dir["sans.guiframe"] = guiframe_path 76 package_dir["sans.guiframe.local_perspectives"] = os.path.join(guiframe_path, "local_perspectives") 102 package_dir["sans.guiframe.local_perspectives"] = os.path.join(guiframe_path, 103 "local_perspectives") 77 104 package_data["sans.guiframe"] = ['images/*', 'media/*'] 78 105 packages.extend(["sans.guiframe", "sans.guiframe.local_perspectives"]) … … 82 109 package_name = "sans.guiframe.local_perspectives." + dir 83 110 packages.append(package_name) 84 package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", dir) 111 package_dir[package_name] = os.path.join(guiframe_path, 112 "local_perspectives", dir) 85 113 86 114 # sans.dataloader 87 package_dir["sans.dataloader"] = os.path.join("sansdataloader", "src", "sans", "dataloader") 115 package_dir["sans.dataloader"] = os.path.join("sansdataloader", 116 "src", "sans", "dataloader") 88 117 package_data["sans.dataloader.readers"] = ['defaults.xml'] 89 118 packages.extend(["sans.dataloader","sans.dataloader.readers"]) … … 120 149 121 150 # Invariant view 122 package_dir["sans.perspectives"] = os.path.join("invariantview", "src", "sans", "perspectives") 123 package_dir["sans.perspectives.invariant"] = os.path.join("invariantview", "src", "sans", "perspectives", "invariant") 151 package_dir["sans.perspectives"] = os.path.join("invariantview", "src", 152 "sans", "perspectives") 153 package_dir["sans.perspectives.invariant"] = os.path.join("invariantview", 154 "src", "sans", "perspectives", "invariant") 124 155 125 156 package_data['sans.perspectives.invariant'] = [os.path.join("media",'*')] … … 127 158 128 159 # Fitting view 129 package_dir["sans.perspectives"] = os.path.join("fittingview", "src", "sans", "perspectives"), 130 package_dir["sans.perspectives.fitting"] = os.path.join("fittingview", "src", "sans", "perspectives", "fitting") 160 fitting_path = os.path.join("fittingview", "src", "sans", 161 "perspectives", "fitting") 162 package_dir["sans.perspectives"] = os.path.join("fittingview", 163 "src", "sans", "perspectives"), 164 package_dir["sans.perspectives.fitting"] = fitting_path 165 package_dir["sans.perspectives.fitting.plugin_models"] = \ 166 os.path.join(fitting_path, "plugin_models") 131 167 package_data['sans.perspectives.fitting'] = ['media/*','plugin_models/*'] 132 packages.extend(["sans.perspectives", "sans.perspectives.fitting"]) 168 packages.extend(["sans.perspectives", "sans.perspectives.fitting", 169 "sans.perspectives.fitting.plugin_models"]) 133 170 134 171 # Calculator view 135 172 package_dir["sans.perspectives"] = "calculatorview/src/sans/perspectives" 136 package_dir["sans.perspectives.calculator"] = os.path.join("calculatorview", "src", "sans", "perspectives", "calculator") 173 package_dir["sans.perspectives.calculator"] = os.path.join("calculatorview", 174 "src", "sans", "perspectives", "calculator") 137 175 package_data['sans.perspectives.calculator'] = ['images/*', 'media/*'] 138 176 packages.extend(["sans.perspectives", "sans.perspectives.calculator"]) … … 144 182 # Plottools 145 183 package_dir["danse"] = os.path.join("plottools", "src", "danse") 146 package_dir["danse.common"] = os.path.join("plottools", "src", "danse", "common") 147 package_dir["danse.common.plottools"] = os.path.join("plottools", "src", "danse", "common", "plottools") 184 package_dir["danse.common"] = os.path.join("plottools", "src", 185 "danse", "common") 186 package_dir["danse.common.plottools"] = os.path.join("plottools", 187 "src", "danse", "common", "plottools") 148 188 packages.extend(["danse", "danse.common", "danse.common.plottools"]) 149 189 … … 153 193 package_data["park"] = ['park-1.2.1/*.txt', 'park-1.2.1/park.epydoc'] 154 194 ext_modules.append( Extension("park._modeling", 155 sources = [ os.path.join("park-1.2.1", "park", "lib", "modeling.cc"), 156 os.path.join("park-1.2.1", "park", "lib", "resolution.c"), 195 sources = [ os.path.join("park-1.2.1", 196 "park", "lib", "modeling.cc"), 197 os.path.join("park-1.2.1", 198 "park", "lib", "resolution.c"), 157 199 ], 158 200 ) ) … … 225 267 ext_modules.extend( [ Extension("sans.models.sans_extension.c_models", 226 268 sources=model_sources, 227 include_dirs=[igordir, srcdir, c_model_dir, numpy_incl_path], 269 include_dirs=[igordir, srcdir, 270 c_model_dir, numpy_incl_path], 228 271 ), 229 272 # Smearer extension 230 273 Extension("sans.models.sans_extension.smearer", 231 274 sources = smearer_sources, 232 include_dirs=[igordir, smear_dir, numpy_incl_path], 275 include_dirs=[igordir, 276 smear_dir, numpy_incl_path], 233 277 ), 234 278 235 279 Extension("sans.models.sans_extension.smearer2d_helper", 236 280 sources = [os.path.join(smear_dir, 237 "smearer2d_helper_module.cpp"), 238 os.path.join(smear_dir, "smearer2d_helper.cpp"),], 281 "smearer2d_helper_module.cpp"), 282 os.path.join(smear_dir, 283 "smearer2d_helper.cpp"),], 239 284 include_dirs=[smear_dir,numpy_incl_path], 240 285 ) … … 246 291 packages.append("sans.sansview") 247 292 248 #required = ['lxml>=2.2.2', 'numpy>=1.4.1', 'matplotlib>=0.99.1.1', 'wxPython>=2.8.11', 249 # 'pil','periodictable>=1.3.0', 'scipy>=0.7.2'] 293 #required = ['lxml>=2.2.2', 'numpy>=1.4.1', 'matplotlib>=0.99.1.1', 294 # 'wxPython>=2.8.11', 'pil', 295 # 'periodictable>=1.3.0', 'scipy>=0.7.2'] 250 296 required = ['lxml','periodictable>=1.3.0'] 251 297 """ 252 298 if os.name=='nt': 253 299 #required.extend(['comtypes', 'pisa', 'html5lib', 'reportlab']) 254 required.extend(['pisa', 'html5lib'])300 #required.extend(['pisa', 'html5lib']) 255 301 if sys.version_info < (2, 7): 256 302 required.append('comtypes')
Note: See TracChangeset
for help on using the changeset viewer.