Changes in / [a42fb8e:b854587] in sasview
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
run.py
r64ca561 rf36e01f 1 # -*- coding: utf-8 -*- 1 2 #!/usr/bin/env python 3 2 4 """ 3 5 Run sasview in place. This allows sasview to use the python … … 14 16 """ 15 17 18 import imp 16 19 import os 17 20 import sys 18 import imp19 import logging20 import logging.config21 22 21 from contextlib import contextmanager 23 from os.path import abspath, dirname, join as joinpath 22 from os.path import join as joinpath 23 from os.path import abspath, dirname 24 24 25 25 26 LOGGER_CONFIG_FILE = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'sasview/logging.ini')27 logging.config.fileConfig(LOGGER_CONFIG_FILE, disable_existing_loggers=True)28 logger = logging.getLogger(__name__)29 30 def update_all_logs_to_debug(logger):31 '''32 This updates all loggers and respective handlers to DEBUG33 '''34 for handler in logger.handlers or logger.parent.handlers:35 handler.setLevel(logging.DEBUG)36 for name,_ in logging.Logger.manager.loggerDict.items():37 logging.getLogger(name).setLevel(logging.DEBUG)38 39 26 def addpath(path): 40 27 """ … … 50 37 sys.path.insert(0, path) 51 38 39 52 40 @contextmanager 53 41 def cd(path): … … 60 48 os.chdir(old_dir) 61 49 50 62 51 def import_package(modname, path): 63 52 """Import a package into a particular point in the python namespace""" 64 mod = imp.load_source(modname, abspath(joinpath(path, '__init__.py')))53 mod = imp.load_source(modname, abspath(joinpath(path, '__init__.py'))) 65 54 sys.modules[modname] = mod 66 55 mod.__path__ = [abspath(path)] 67 56 return mod 57 68 58 69 59 def import_dll(modname, build_path): … … 72 62 ext = sysconfig.get_config_var('SO') 73 63 # build_path comes from context 74 path = joinpath(build_path, *modname.split('.')) +ext75 # print "importing", modname, "from", path64 path = joinpath(build_path, *modname.split('.')) + ext 65 # print "importing", modname, "from", path 76 66 return imp.load_dynamic(modname, path) 67 77 68 78 69 def prepare(): … … 86 77 from distutils.util import get_platform 87 78 root = abspath(dirname(__file__)) 88 platform = '%s-%s' %(get_platform(),sys.version[:3])89 build_path = joinpath(root, 'build', 'lib.'+platform)79 platform = '%s-%s' % (get_platform(), sys.version[:3]) 80 build_path = joinpath(root, 'build', 'lib.' + platform) 90 81 91 82 # Notify the help menu that the Sphinx documentation is in a different … … 98 89 #if not os.path.exists(mplconfig): os.mkdir(mplconfig) 99 90 #import matplotlib 100 # matplotlib.use('Agg')101 # print matplotlib.__file__91 # matplotlib.use('Agg') 92 # print matplotlib.__file__ 102 93 #import pylab; pylab.hold(False) 103 94 # add periodictable to the path 104 try: import periodictable 105 except: addpath(joinpath(root, '..','periodictable')) 95 try: 96 import periodictable 97 except: 98 addpath(joinpath(root, '..', 'periodictable')) 106 99 107 try: import bumps 108 except: addpath(joinpath(root, '..','bumps')) 100 try: 101 import bumps 102 except: 103 addpath(joinpath(root, '..', 'bumps')) 109 104 110 105 # select wx version … … 126 121 # be better to just store the package in src/sas/sasview. 127 122 import sas 128 sas.sasview = import_package('sas.sasview', joinpath(root, 'sasview'))123 sas.sasview = import_package('sas.sasview', joinpath(root, 'sasview')) 129 124 130 125 # The sas.models package Compiled Model files should be pulled in from the build directory even though … … 135 130 import sas.sascalc.pr 136 131 sas.sascalc.pr.core = import_package('sas.sascalc.pr.core', 137 joinpath(build_path, 'sas', 'sascalc', 'pr', 'core'))132 joinpath(build_path, 'sas', 'sascalc', 'pr', 'core')) 138 133 139 134 # Compiled modules need to be pulled from the build directory. … … 141 136 import sas.sascalc.file_converter 142 137 sas.sascalc.file_converter.core = import_package('sas.sascalc.file_converter.core', 143 joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core'))138 joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core')) 144 139 145 140 # Compiled modules need to be pulled from the build directory. … … 147 142 import sas.sascalc.calculator 148 143 sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core', 149 joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core'))144 joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core')) 150 145 151 146 sys.path.append(build_path) 152 147 153 #print "\n".join(sys.path) 148 # print "\n".join(sys.path) 149 154 150 155 151 if __name__ == "__main__": 156 update_all_logs_to_debug(logger) 152 # Need to add absolute path before actual prepare call, 153 # so logging can be done during initialization process too 154 root = abspath(dirname(__file__)) 155 addpath(joinpath(root, 'sasview')) 156 from logger_config import SetupLogger 157 logger = SetupLogger(__name__).config_development() 158 159 logger.debug("Starting SASVIEW in debug mode.") 157 160 prepare() 158 161 from sas.sasview.sasview import run 159 162 run() 160 163 logger.debug("Ending SASVIEW in debug mode.") -
sasview/logging.ini
r64ca561 rfc22533 16 16 17 17 [formatter_detailed] 18 format=%(asctime)s:%(name)s:%(levelname)s: %(lineno)d: %(message)s 18 #format=%(asctime)s : %(levelname)s : %(name)s: %(lineno)d: %(message)s 19 format=%(asctime)s : %(levelname)s : %(name)s (%(filename)s:%(lineno)s) :: %(message)s 19 20 20 21 ############################################################################### … … 27 28 class=logging.StreamHandler 28 29 formatter=simple 29 level= INFO30 level=WARNING 30 31 args=tuple() 31 32 32 33 [handler_log_file] 33 34 class=logging.FileHandler 34 level= INFO35 level=DEBUG 35 36 formatter=detailed 36 37 args=(os.path.join(os.path.expanduser("~"),'sasview.log'),"a") … … 43 44 44 45 [logger_root] 45 level= INFO46 level=DEBUG 46 47 formatter=default 47 48 handlers=console,log_file … … 60 61 61 62 [logger_sasgui] 62 level= INFO63 level=DEBUG 63 64 qualname=sas.sasgui 64 65 handlers=console,log_file -
sasview/sasview.py
r3608cd1 rf36e01f 1 # -*- coding: utf-8 -*- 1 2 """ 2 3 Base module for loading and running the main SasView application. 3 4 """ 4 5 ################################################################################ 5 # This software was developed by the University of Tennessee as part of the6 # Distributed Data Analysis of Neutron Scattering Experiments (DANSE)7 # project funded by the US National Science Foundation.6 # This software was developed by the University of Tennessee as part of the 7 # Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 8 # project funded by the US National Science Foundation. 8 9 # 9 # See the license text in license.txt10 # See the license text in license.txt 10 11 # 11 # copyright 2009, University of Tennessee12 # copyright 2009, University of Tennessee 12 13 ################################################################################ 13 14 import os 15 import os.path 14 16 import sys 15 import logging16 import logging.config17 17 import traceback 18 18 19 logger = logging.getLogger(__name__) 20 if not logger.root.handlers: 21 LOGGER_CONFIG_FILE = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'logging.ini') 22 logging.config.fileConfig(LOGGER_CONFIG_FILE, disable_existing_loggers=False) 23 logging.captureWarnings(True) 19 from sas.sasview.logger_config import SetupLogger 20 21 logger = SetupLogger(__name__).config_production() 22 24 23 25 24 # Log the start of the session … … 55 54 import wxcruft 56 55 wxcruft.call_later_fix() 57 # wxcruft.trace_new_id()56 # wxcruft.trace_new_id() 58 57 59 # Always use private .matplotlib setup to avoid conflicts with other60 # uses of matplotlib61 # Have to check if .sasview exists first58 # Always use private .matplotlib setup to avoid conflicts with other 59 # uses of matplotlib 60 # Have to check if .sasview exists first 62 61 sasdir = os.path.join(os.path.expanduser("~"),'.sasview') 63 62 if not os.path.exists(sasdir): … … 72 71 from sas.sasgui.guiframe.gui_style import GUIFRAME 73 72 from welcome_panel import WelcomePanel 74 # For py2exe, import config here 75 import local_config 73 76 74 PLUGIN_MODEL_DIR = 'plugin_models' 77 75 APP_NAME = 'SasView' … … 87 85 """ 88 86 """ 89 # from gui_manager import ViewApp87 # from gui_manager import ViewApp 90 88 self.gui = gui_manager.SasViewApp(0) 91 89 # Set the application manager for the GUI … … 116 114 logger.error(traceback.format_exc()) 117 115 118 # Invariant perspective116 # Invariant perspective 119 117 try: 120 118 import sas.sasgui.perspectives.invariant as module … … 134 132 logger.error("Unable to load corfunc module") 135 133 136 # Calculator perspective134 # Calculator perspective 137 135 try: 138 136 import sas.sasgui.perspectives.calculator as module … … 153 151 APP_NAME) 154 152 logger.error(traceback.format_exc()) 155 156 153 157 154 # Add welcome page … … 174 171 if len(sys.argv) > 1: 175 172 ## Run sasview as an interactive python interpreter 176 # if sys.argv[1] == "-i":173 # if sys.argv[1] == "-i": 177 174 # sys.argv = ["ipython", "--pylab"] 178 175 # from IPython import start_ipython … … 188 185 SasView() 189 186 187 190 188 if __name__ == "__main__": 191 189 run() -
sasview/setup_exe.py
r8b645cc rf36e01f 62 62 sys.argv.remove('--extrapath') 63 63 except: 64 print 65 sys.exc_value 64 print("Error processing extra python path needed to build SasView\n %s" % \ 65 sys.exc_value) 66 66 67 67 … … 83 83 modulefinder.AddPackagePath(win32_folder, p) 84 84 for extra in ["win32com.shell", "win32com.adsi", "win32com.axcontrol", 85 "win32com.axscript", "win32com.bits", "win32com.ifilter", 86 "win32com.internet", "win32com.mapi", "win32com.propsys", 87 "win32com.taskscheduler"]: 88 89 __import__(extra) 90 m = sys.modules[extra] 91 for p in m.__path__[1:]: 92 modulefinder.AddPackagePath(extra, p) 85 "win32com.axscript", "win32com.bits", "win32com.ifilter", 86 "win32com.internet", "win32com.mapi", "win32com.propsys", 87 "win32com.taskscheduler"]: 88 __import__(extra) 89 m = sys.modules[extra] 90 for p in m.__path__[1:]: 91 modulefinder.AddPackagePath(extra, p) 93 92 94 93 except ImportError: … … 167 166 self.copyright = "copyright 2009 - 2016" 168 167 self.name = "SasView" 169 168 170 169 # 171 170 # Adapted from http://www.py2exe.org/index.cgi/MatPlotLib … … 236 235 data_files.append(('config', [f])) 237 236 f = 'local_config.py' 237 if os.path.isfile(f): 238 data_files.append(('.', [f])) 239 240 f = 'logging.ini' 238 241 if os.path.isfile(f): 239 242 data_files.append(('.', [f])) … … 337 340 ]) 338 341 packages.append('periodictable.core') # not found automatically 339 # packages.append('IPython')342 # packages.append('IPython') 340 343 includes = ['site', 'lxml._elementpath', 'lxml.etree'] 341 344 … … 370 373 other_resources = [(24, 1, manifest)], 371 374 dest_base = "SasView" 372 375 ) 373 376 374 377 # bundle_option = 2 -
sasview/setup_mac.py
r235f514 rcfa88ee 50 50 #CANSAxml reader data files 51 51 RESOURCES_FILES.append(os.path.join(sas.sascalc.dataloader.readers.get_data_path(),'defaults.json')) 52 53 DATA_FILES.append('logging.ini') 52 54 53 55 # Locate libxml2 library -
setup.py
r14bb7a4 r14bb7a4 1 # -*- coding: utf-8 -*- 2 #!/usr/bin/env python 3 1 4 """ 2 5 Setup for SasView 3 #TODO: Add checks to see that all the dependencies are on the system6 TODO: Add checks to see that all the dependencies are on the system 4 7 """ 5 import sys 8 6 9 import os 7 10 import subprocess 8 11 import shutil 9 from setuptools import setup, Extension 12 import sys 10 13 from distutils.command.build_ext import build_ext 11 14 from distutils.core import Command 15 12 16 import numpy as np 17 from setuptools import Extension, setup 13 18 14 19 # Manage version number ###################################### 15 20 import sasview 21 16 22 VERSION = sasview.__version__ 17 23 ############################################################## … … 26 32 # except when there is no such file 27 33 # Todo : make this list generic 28 # plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py',34 # plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py', 29 35 # 'sum_Ap1_1_Ap2.py', 'sum_p1_p2.py', 30 36 # 'testmodel_2.py', 'testmodel.py', … … 36 42 SASVIEW_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") 37 43 38 sas_dir = os.path.join(os.path.expanduser("~"), '.sasview')44 sas_dir = os.path.join(os.path.expanduser("~"), '.sasview') 39 45 if os.path.isdir(sas_dir): 40 46 f_path = os.path.join(sas_dir, "sasview.log") … … 48 54 os.remove(f_path) 49 55 #f_path = os.path.join(sas_dir, 'plugin_models') 50 # if os.path.isdir(f_path):56 # if os.path.isdir(f_path): 51 57 # for f in os.listdir(f_path): 52 58 # if f in plugin_model_list: … … 54 60 # os.remove(file_path) 55 61 if os.path.exists(SASVIEW_BUILD): 56 print("Removing existing build directory", SASVIEW_BUILD, "for a clean build") 62 print("Removing existing build directory", 63 SASVIEW_BUILD, "for a clean build") 57 64 shutil.rmtree(SASVIEW_BUILD) 58 65 … … 64 71 enable_openmp = False 65 72 66 if sys.platform == 'darwin':73 if sys.platform == 'darwin': 67 74 if not is_64bits: 68 75 # Disable OpenMP … … 78 85 79 86 # Options to enable OpenMP 80 copt = 81 'mingw32': ['-fopenmp'],82 'unix': ['-fopenmp']}83 lopt = 84 'mingw32': ['-fopenmp'],85 'unix': ['-lgomp']}87 copt = {'msvc': ['/openmp'], 88 'mingw32': ['-fopenmp'], 89 'unix': ['-fopenmp']} 90 lopt = {'msvc': ['/MANIFEST'], 91 'mingw32': ['-fopenmp'], 92 'unix': ['-lgomp']} 86 93 87 94 # Platform-specific link options 88 platform_lopt = {'msvc' 95 platform_lopt = {'msvc': ['/MANIFEST']} 89 96 platform_copt = {} 90 97 91 98 # Set copts to get compile working on OS X >= 10.9 using clang 92 if sys.platform == 'darwin':99 if sys.platform == 'darwin': 93 100 try: 94 101 darwin_ver = int(os.uname()[2].split('.')[0]) 95 102 if darwin_ver >= 13 and darwin_ver < 14: 96 platform_copt = {'unix' : ['-Wno-error=unused-command-line-argument-hard-error-in-future']} 103 platform_copt = { 104 'unix': ['-Wno-error=unused-command-line-argument-hard-error-in-future']} 97 105 except: 98 106 print("PROBLEM determining Darwin version") 107 99 108 100 109 class DisableOpenMPCommand(Command): … … 115 124 pass 116 125 117 class build_ext_subclass( build_ext ): 126 127 class build_ext_subclass(build_ext): 118 128 def build_extensions(self): 119 129 # Get 64-bitness … … 125 135 if c in copt: 126 136 for e in self.extensions: 127 e.extra_compile_args = copt[ c]137 e.extra_compile_args = copt[c] 128 138 if c in lopt: 129 139 for e in self.extensions: 130 e.extra_link_args = lopt[ c]140 e.extra_link_args = lopt[c] 131 141 132 142 # Platform-specific build options 133 143 if c in platform_lopt: 134 144 for e in self.extensions: 135 e.extra_link_args = platform_lopt[ c]145 e.extra_link_args = platform_lopt[c] 136 146 137 147 if c in platform_copt: 138 148 for e in self.extensions: 139 e.extra_compile_args = platform_copt[ c ] 140 149 e.extra_compile_args = platform_copt[c] 141 150 142 151 build_ext.build_extensions(self) 152 143 153 144 154 class BuildSphinxCommand(Command): … … 174 184 build_sphinx.rebuild() 175 185 186 176 187 # sas module 177 188 package_dir["sas"] = os.path.join("src", "sas") … … 187 198 188 199 # sas.sascalc.invariant 189 package_dir["sas.sascalc.invariant"] = os.path.join("src", "sas", "sascalc", "invariant") 200 package_dir["sas.sascalc.invariant"] = os.path.join( 201 "src", "sas", "sascalc", "invariant") 190 202 packages.extend(["sas.sascalc.invariant"]) 191 203 … … 193 205 guiframe_path = os.path.join("src", "sas", "sasgui", "guiframe") 194 206 package_dir["sas.sasgui.guiframe"] = guiframe_path 195 package_dir["sas.sasgui.guiframe.local_perspectives"] = os.path.join(os.path.join(guiframe_path, "local_perspectives")) 207 package_dir["sas.sasgui.guiframe.local_perspectives"] = os.path.join( 208 os.path.join(guiframe_path, "local_perspectives")) 196 209 package_data["sas.sasgui.guiframe"] = ['images/*', 'media/*'] 197 packages.extend(["sas.sasgui.guiframe", "sas.sasgui.guiframe.local_perspectives"]) 210 packages.extend( 211 ["sas.sasgui.guiframe", "sas.sasgui.guiframe.local_perspectives"]) 198 212 # build local plugin 199 213 for d in os.listdir(os.path.join(guiframe_path, "local_perspectives")): … … 201 215 package_name = "sas.sasgui.guiframe.local_perspectives." + d 202 216 packages.append(package_name) 203 package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", d) 217 package_dir[package_name] = os.path.join( 218 guiframe_path, "local_perspectives", d) 204 219 205 220 # sas.sascalc.dataloader 206 package_dir["sas.sascalc.dataloader"] = os.path.join("src", "sas", "sascalc", "dataloader") 207 package_data["sas.sascalc.dataloader.readers"] = ['defaults.json', 'schema/*.xsd'] 208 packages.extend(["sas.sascalc.dataloader", "sas.sascalc.dataloader.readers", "sas.sascalc.dataloader.readers.schema"]) 221 package_dir["sas.sascalc.dataloader"] = os.path.join( 222 "src", "sas", "sascalc", "dataloader") 223 package_data["sas.sascalc.dataloader.readers"] = [ 224 'defaults.json', 'schema/*.xsd'] 225 packages.extend(["sas.sascalc.dataloader", "sas.sascalc.dataloader.readers", 226 "sas.sascalc.dataloader.readers.schema"]) 227 209 228 210 229 # sas.sascalc.calculator 211 230 gen_dir = os.path.join("src", "sas", "sascalc", "calculator", "c_extensions") 212 231 package_dir["sas.sascalc.calculator.core"] = gen_dir 213 package_dir["sas.sascalc.calculator"] = os.path.join("src", "sas", "sascalc", "calculator") 214 packages.extend(["sas.sascalc.calculator","sas.sascalc.calculator.core"]) 215 ext_modules.append( Extension("sas.sascalc.calculator.core.sld2i", 216 sources = [ 217 os.path.join(gen_dir, "sld2i_module.cpp"), 218 os.path.join(gen_dir, "sld2i.cpp"), 219 os.path.join(gen_dir, "libfunc.c"), 220 os.path.join(gen_dir, "librefl.c"), 221 ], 222 include_dirs=[gen_dir], 223 ) 224 ) 232 package_dir["sas.sascalc.calculator"] = os.path.join( 233 "src", "sas", "sascalc", "calculator") 234 packages.extend(["sas.sascalc.calculator", "sas.sascalc.calculator.core"]) 235 ext_modules.append(Extension("sas.sascalc.calculator.core.sld2i", 236 sources=[ 237 os.path.join(gen_dir, "sld2i_module.cpp"), 238 os.path.join(gen_dir, "sld2i.cpp"), 239 os.path.join(gen_dir, "libfunc.c"), 240 os.path.join(gen_dir, "librefl.c"), 241 ], 242 include_dirs=[gen_dir], 243 ) 244 ) 225 245 226 246 # sas.sascalc.pr 227 srcdir 247 srcdir = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 228 248 package_dir["sas.sascalc.pr.core"] = srcdir 229 249 package_dir["sas.sascalc.pr"] = os.path.join("src", "sas", "sascalc", "pr") 230 packages.extend(["sas.sascalc.pr","sas.sascalc.pr.core"]) 231 ext_modules.append( Extension("sas.sascalc.pr.core.pr_inversion", 232 sources = [os.path.join(srcdir, "Cinvertor.c"), 233 os.path.join(srcdir, "invertor.c"), 234 ], 235 include_dirs=[], 236 ) ) 250 packages.extend(["sas.sascalc.pr", "sas.sascalc.pr.core"]) 251 ext_modules.append(Extension("sas.sascalc.pr.core.pr_inversion", 252 sources=[os.path.join(srcdir, "Cinvertor.c"), 253 os.path.join(srcdir, "invertor.c"), 254 ], 255 include_dirs=[], 256 )) 257 237 258 238 259 # sas.sascalc.file_converter 239 260 mydir = os.path.join("src", "sas", "sascalc", "file_converter", "c_ext") 240 261 package_dir["sas.sascalc.file_converter.core"] = mydir 241 package_dir["sas.sascalc.file_converter"] = os.path.join("src", "sas", "sascalc", "file_converter") 242 packages.extend(["sas.sascalc.file_converter", "sas.sascalc.file_converter.core"]) 243 ext_modules.append( Extension("sas.sascalc.file_converter.core.bsl_loader", 244 sources = [os.path.join(mydir, "bsl_loader.c")], 245 include_dirs=[np.get_include()], 246 ) ) 247 248 #sas.sascalc.corfunc 249 package_dir["sas.sascalc.corfunc"] = os.path.join("src", "sas", "sascalc", "corfunc") 262 package_dir["sas.sascalc.file_converter"] = os.path.join( 263 "src", "sas", "sascalc", "file_converter") 264 packages.extend(["sas.sascalc.file_converter", 265 "sas.sascalc.file_converter.core"]) 266 ext_modules.append(Extension("sas.sascalc.file_converter.core.bsl_loader", 267 sources=[os.path.join(mydir, "bsl_loader.c")], 268 include_dirs=[np.get_include()], 269 )) 270 271 # sas.sascalc.corfunc 272 package_dir["sas.sascalc.corfunc"] = os.path.join( 273 "src", "sas", "sascalc", "corfunc") 274 250 275 packages.extend(["sas.sascalc.corfunc"]) 251 276 … … 255 280 256 281 # Perspectives 257 package_dir["sas.sasgui.perspectives"] = os.path.join("src", "sas", "sasgui", "perspectives") 258 package_dir["sas.sasgui.perspectives.pr"] = os.path.join("src", "sas", "sasgui", "perspectives", "pr") 259 packages.extend(["sas.sasgui.perspectives","sas.sasgui.perspectives.pr"]) 282 package_dir["sas.sasgui.perspectives"] = os.path.join( 283 "src", "sas", "sasgui", "perspectives") 284 package_dir["sas.sasgui.perspectives.pr"] = os.path.join( 285 "src", "sas", "sasgui", "perspectives", "pr") 286 packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.pr"]) 260 287 package_data["sas.sasgui.perspectives.pr"] = ['media/*'] 261 288 262 package_dir["sas.sasgui.perspectives.invariant"] = os.path.join("src", "sas", "sasgui", "perspectives", "invariant") 289 package_dir["sas.sasgui.perspectives.invariant"] = os.path.join( 290 "src", "sas", "sasgui", "perspectives", "invariant") 263 291 packages.extend(["sas.sasgui.perspectives.invariant"]) 264 package_data['sas.sasgui.perspectives.invariant'] = [os.path.join("media",'*')] 265 266 package_dir["sas.sasgui.perspectives.fitting"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting") 267 package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting", "plugin_models") 268 packages.extend(["sas.sasgui.perspectives.fitting", "sas.sasgui.perspectives.fitting.plugin_models"]) 269 package_data['sas.sasgui.perspectives.fitting'] = ['media/*', 'plugin_models/*'] 270 271 packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 292 package_data['sas.sasgui.perspectives.invariant'] = [ 293 os.path.join("media", '*')] 294 295 package_dir["sas.sasgui.perspectives.fitting"] = os.path.join( 296 "src", "sas", "sasgui", "perspectives", "fitting") 297 package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join( 298 "src", "sas", "sasgui", "perspectives", "fitting", "plugin_models") 299 packages.extend(["sas.sasgui.perspectives.fitting", 300 "sas.sasgui.perspectives.fitting.plugin_models"]) 301 package_data['sas.sasgui.perspectives.fitting'] = [ 302 'media/*', 'plugin_models/*'] 303 304 packages.extend(["sas.sasgui.perspectives", 305 "sas.sasgui.perspectives.calculator"]) 272 306 package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 273 307 274 package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join("src", "sas", "sasgui", "perspectives", "corfunc") 308 package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join( 309 "src", "sas", "sasgui", "perspectives", "corfunc") 275 310 packages.extend(["sas.sasgui.perspectives.corfunc"]) 276 311 package_data['sas.sasgui.perspectives.corfunc'] = ['media/*'] 277 312 278 package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join("src", "sas", "sasgui", "perspectives", "file_converter") 313 package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join( 314 "src", "sas", "sasgui", "perspectives", "file_converter") 279 315 packages.extend(["sas.sasgui.perspectives.file_converter"]) 280 316 package_data['sas.sasgui.perspectives.file_converter'] = ['media/*'] 281 317 282 318 # Data util 283 package_dir["sas.sascalc.data_util"] = os.path.join("src", "sas", "sascalc", "data_util") 319 package_dir["sas.sascalc.data_util"] = os.path.join( 320 "src", "sas", "sascalc", "data_util") 284 321 packages.append("sas.sascalc.data_util") 285 322 286 323 # Plottools 287 package_dir["sas.sasgui.plottools"] = os.path.join("src", "sas", "sasgui", "plottools") 324 package_dir["sas.sasgui.plottools"] = os.path.join( 325 "src", "sas", "sasgui", "plottools") 288 326 packages.append("sas.sasgui.plottools") 289 327 … … 293 331 294 332 EXTENSIONS = [".c", ".cpp"] 333 295 334 296 335 def append_file(file_list, dir_path): … … 312 351 file_list.append(os.path.join(sub_dir, new_f)) 313 352 353 314 354 # Comment out the following to avoid rebuilding all the models 315 355 file_sources = [] 316 356 append_file(file_sources, gen_dir) 317 357 318 # Wojtek's hacky way to add doc files while bundling egg319 # def add_doc_files(directory):358 # Wojtek's hacky way to add doc files while bundling egg 359 # def add_doc_files(directory): 320 360 # paths = [] 321 361 # for (path, directories, filenames) in os.walk(directory): … … 330 370 package_data['sas.sasview'] = ['images/*', 331 371 'media/*', 372 'logging.ini', 332 373 'test/*.txt', 333 374 'test/1d_data/*', … … 349 390 'lxml', 'h5py', 350 391 351 # #The following dependecies won't install automatically, so assume them352 # #The numbers should be bumped up for matplotlib and wxPython as well.392 # The following dependecies won't install automatically, so assume them 393 # The numbers should be bumped up for matplotlib and wxPython as well. 353 394 # 'numpy>=1.4.1', 'scipy>=0.7.2', 'matplotlib>=0.99.1.1', 354 395 # 'wxPython>=2.8.11', 'pil', 355 356 357 if os.name =='nt':396 ] 397 398 if os.name == 'nt': 358 399 required.extend(['html5lib', 'reportlab']) 359 400 else: … … 364 405 setup( 365 406 name="sasview", 366 version =VERSION,367 description ="SasView application",368 author ="SasView Team",369 author_email ="developers@sasview.org",370 url ="http://sasview.org",371 license ="PSF",372 keywords ="small-angle x-ray and neutron scattering analysis",373 download_url ="https://github.com/SasView/sasview.git",374 package_dir =package_dir,375 packages =packages,376 package_data =package_data,377 ext_modules =ext_modules,378 install_requires =required,379 zip_safe =False,380 entry_points ={381 'console_scripts':[382 383 384 385 cmdclass ={'build_ext': build_ext_subclass,386 387 388 407 version=VERSION, 408 description="SasView application", 409 author="SasView Team", 410 author_email="developers@sasview.org", 411 url="http://sasview.org", 412 license="PSF", 413 keywords="small-angle x-ray and neutron scattering analysis", 414 download_url="https://github.com/SasView/sasview.git", 415 package_dir=package_dir, 416 packages=packages, 417 package_data=package_data, 418 ext_modules=ext_modules, 419 install_requires=required, 420 zip_safe=False, 421 entry_points={ 422 'console_scripts': [ 423 "sasview = sas.sasview.sasview:run", 424 ] 425 }, 426 cmdclass={'build_ext': build_ext_subclass, 427 'docs': BuildSphinxCommand, 428 'disable_openmp': DisableOpenMPCommand} 429 ) -
src/sas/sasgui/guiframe/gui_manager.py
r49165488 r38beeab 77 77 # clean all these module variables and put them into a config class 78 78 # that can be passed by sasview.py. 79 logger. info(sys.executable)80 logger. info(str(sys.argv))79 logger.debug(sys.executable) 80 logger.debug(str(sys.argv)) 81 81 from sas import sasview as sasview 82 82 app_path = os.path.dirname(sasview.__file__) 83 logger. info("Using application path: %s", app_path)83 logger.debug("Using application path: %s", app_path) 84 84 return app_path 85 85 … … 109 109 if fObj is not None: 110 110 fObj.close() 111 logger. info("GuiManager loaded %s/%s" % (path, file))111 logger.debug("GuiManager loaded %s/%s" % (path, file)) 112 112 return config_module 113 113 … … 126 126 # Didn't find local config, load the default 127 127 import sas.sasgui.guiframe.config as config 128 logger. info("using default local_config")128 logger.debug("using default local_config") 129 129 else: 130 logger. info("found local_config in %s" % os.getcwd())130 logger.debug("found local_config in %s" % os.getcwd()) 131 131 else: 132 logger. info("found local_config in %s" % PATH_APP)132 logger.debug("found local_config in %s" % PATH_APP) 133 133 134 134 from sas.sasgui.guiframe.customdir import SetupCustom … … 139 139 if custom_config is None: 140 140 msgConfig = "Custom_config file was not imported" 141 logger. info(msgConfig)141 logger.debug(msgConfig) 142 142 else: 143 logger. info("using custom_config in %s" % os.getcwd())143 logger.debug("using custom_config in %s" % os.getcwd()) 144 144 else: 145 logger. info("using custom_config from %s" % c_conf_dir)145 logger.debug("using custom_config from %s" % c_conf_dir) 146 146 147 147 # read some constants from config … … 2156 2156 if response is not None: 2157 2157 try: 2158 #2159 2158 content = response.read().strip() 2160 logger.info("Connected to www.sasview.org. Latest version: %s" 2161 % (content)) 2159 logger.info("Connected to www.sasview.org. Latest version: %s", content) 2162 2160 version_info = json.loads(content) 2163 2161 except:
Note: See TracChangeset
for help on using the changeset viewer.