Changeset efe730d in sasview for sasview/setup_exe.py
- Timestamp:
- Jun 25, 2016 2:07:33 AM (8 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 899e084
- Parents:
- 9501661
- git-author:
- Paul Kienzle <pkienzle@…> (06/25/16 00:23:59)
- git-committer:
- Paul Kienzle <pkienzle@…> (06/25/16 02:07:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/setup_exe.py
rabb02db refe730d 37 37 sys.path.insert(0, build_path) 38 38 39 import local_config39 from sas.sasview import local_config 40 40 from installer_generator import generate_installer 41 41 … … 174 174 path = os.getcwd() 175 175 176 media_dir = os.path.join(path, "media")177 images_dir = os.path.join(path, "images")178 test_dir = os.path.join(path, "test")179 test_1d_dir = os.path.join(path, "test\\1d_data")180 test_2d_dir = os.path.join(path, "test\\2d_data")181 test_save_dir = os.path.join(path, "test\\save_states")182 test_upcoming_dir = os.path.join(path, "test\\upcoming_formats")183 184 176 matplotlibdatadir = matplotlib.get_data_path() 185 177 matplotlibdata = findall(matplotlibdatadir) … … 188 180 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 189 181 190 data_files= []182 DATA_FILES = [] 191 183 192 184 if tinycc: 193 data_files+= tinycc.data_files()185 DATA_FILES += tinycc.data_files() 194 186 195 187 # Copying SLD data 196 188 import periodictable 197 data_files+= periodictable.data_files()198 199 import sas.sasgui.perspectives.fitting asfitting200 data_files+= fitting.data_files()201 202 import sas.sasgui.perspectives.calculator ascalculator203 data_files+= calculator.data_files()204 205 import sas.sasgui.perspectives.invariant asinvariant206 data_files+= invariant.data_files()207 208 import sas.sasgui.guiframe asguiframe209 data_files+= guiframe.data_files()189 DATA_FILES += periodictable.data_files() 190 191 from sas.sasgui.perspectives import fitting 192 DATA_FILES += fitting.data_files() 193 194 from sas.sasgui.perspectives import calculator 195 DATA_FILES += calculator.data_files() 196 197 from sas.sasgui.perspectives import invariant 198 DATA_FILES += invariant.data_files() 199 200 from sas.sasgui import guiframe 201 DATA_FILES += guiframe.data_files() 210 202 211 203 # precompile sas models into the sasview build path; doesn't matter too much … … 217 209 # include the compiled models as data; coordinate the target path for the 218 210 # data with installer_generator.py 219 data_files.append(('compiled_models', compiled_dlls))211 DATA_FILES.append(('compiled_models', compiled_dlls)) 220 212 221 213 import sasmodels 222 data_files+= sasmodels.data_files()214 DATA_FILES += sasmodels.data_files() 223 215 224 216 for f in matplotlibdata: 225 217 dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:]) 226 data_files.append((os.path.split(dirname)[0], [f]))218 DATA_FILES.append((os.path.split(dirname)[0], [f])) 227 219 228 220 # Copy the settings file for the sas.dataloader file extension associations 229 import sas.sascalc.dataloader.readers 230 f = os.path.join(sas.sascalc.dataloader.readers.get_data_path(), 'defaults.json') 231 if os.path.isfile(f): 232 data_files.append(('.', [f])) 233 f = 'custom_config.py' 234 if os.path.isfile(f): 235 data_files.append(('.', [f])) 236 data_files.append(('config', [f])) 237 f = 'local_config.py' 238 if os.path.isfile(f): 239 data_files.append(('.', [f])) 240 241 f = 'default_categories.json' 242 if os.path.isfile(f): 243 data_files.append(('.', [f])) 221 from sas.sascalc.dataloader import readers 222 reader_config = os.path.join(readers.get_data_path(), 'defaults.json') 223 if os.path.isfile(reader_config): 224 DATA_FILES.append(('.', [reader_config])) 225 226 # Copy the config files 227 sasview_path = os.path.join('..','src','sas','sasview') 228 custom_config_file = os.path.join(sasview_path, 'custom_config.py') 229 local_config_file = os.path.join(sasview_path, 'local_config.py') 230 DATA_FILES.append(('.', [custom_config_file])) 231 DATA_FILES.append(('config', [custom_config_file])) 232 DATA_FILES.append(('.', [local_config_file])) 233 234 # default_categories.json is beside the config files 235 category_config = os.path.join(os.path.dirname(local_config_file), 236 'default_categories.json') 237 if os.path.isfile(category_config): 238 DATA_FILES.append(('.', [category_config])) 244 239 245 240 if os.path.isfile("BUILD_NUMBER"): 246 data_files.append(('.', ["BUILD_NUMBER"])) 241 DATA_FILES.append(('.', ["BUILD_NUMBER"])) 242 243 images_dir = local_config.icon_path 244 media_dir = local_config.media_path 245 images_dir = local_config.icon_path 246 test_dir = local_config.test_path 247 test_1d_dir = os.path.join(test_dir, "1d_data") 248 test_2d_dir = os.path.join(test_dir, "2d_data") 249 test_save_dir = os.path.join(test_dir, "save_states") 250 test_upcoming_dir = os.path.join(test_dir, "upcoming_formats") 247 251 248 252 # Copying the images directory to the distribution directory. 249 253 for f in findall(images_dir): 250 if not ".svn" in f: 251 data_files.append(("images", [f])) 254 DATA_FILES.append(("images", [f])) 252 255 253 256 # Copying the HTML help docs 254 257 for f in findall(media_dir): 255 if not ".svn" in f: 256 data_files.append(("media", [f])) 258 DATA_FILES.append(("media", [f])) 257 259 258 260 # Copying the sample data user data 259 261 for f in findall(test_1d_dir): 260 if not ".svn" in f: 261 data_files.append(("test\\1d_data", [f])) 262 DATA_FILES.append(("test\\1d_data", [f])) 262 263 263 264 # Copying the sample data user data 264 265 for f in findall(test_2d_dir): 265 if not ".svn" in f: 266 data_files.append(("test\\2d_data", [f])) 266 DATA_FILES.append(("test\\2d_data", [f])) 267 267 268 268 # Copying the sample data user data 269 269 for f in findall(test_save_dir): 270 if not ".svn" in f: 271 data_files.append(("test\\save_states", [f])) 270 DATA_FILES.append(("test\\save_states", [f])) 272 271 273 272 # Copying the sample data user data 274 273 for f in findall(test_upcoming_dir): 275 if not ".svn" in f: 276 data_files.append(("test\\upcoming_formats", [f])) 274 DATA_FILES.append(("test\\upcoming_formats", [f])) 277 275 278 276 # Copying opencl include files 279 277 for f in findall(opencl_include_dir): 280 data_files.append(("includes\\pyopencl",[f]))278 DATA_FILES.append(("includes\\pyopencl", [f])) 281 279 282 280 # See if the documentation has been built, and if so include it. … … 286 284 for filename in filenames: 287 285 sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path)) 288 data_files.append((sub_dir, [os.path.join(dirpath, filename)]))286 DATA_FILES.append((sub_dir, [os.path.join(dirpath, filename)])) 289 287 else: 290 288 raise Exception("You must first build the documentation before creating an installer.") … … 292 290 if msvcrtdll_data_files is not None: 293 291 # install the MSVC 9 runtime dll's into the application folder 294 data_files.append(msvcrtdll_data_files)292 DATA_FILES.append(msvcrtdll_data_files) 295 293 296 294 # NOTE: … … 344 342 target_wx_client = Target( 345 343 description = 'SasView', 346 script = 's asview.py',347 icon_resources = [(1, os.path.join(images_dir, "ball.ico"))],344 script = 'startup.py', 345 icon_resources = [(1, local_config.SetupIconFile_win)], 348 346 other_resources = [(24, 1, manifest)], 349 347 dest_base = "SasView" … … 372 370 }, 373 371 }, 374 data_files= data_files,372 data_files=DATA_FILES, 375 373 )
Note: See TracChangeset
for help on using the changeset viewer.