Changeset f36e01f in sasview


Ignore:
Timestamp:
Apr 11, 2017 4:08:57 AM (7 years ago)
Author:
Ricardo Ferraz Leal <ricleal@…>
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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b854587
Parents:
09983d1
Message:

Some pylint enhancements

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • run.py

    r7fb59b2 rf36e01f  
    11# -*- coding: utf-8 -*- 
    22#!/usr/bin/env python 
     3 
    34""" 
    45Run sasview in place.  This allows sasview to use the python 
     
    1617 
    1718import imp 
    18 import logging 
    19 import logging.config 
    2019import os 
    2120import sys 
     
    3837    sys.path.insert(0, path) 
    3938 
     39 
    4040@contextmanager 
    4141def cd(path): 
     
    4848    os.chdir(old_dir) 
    4949 
     50 
    5051def import_package(modname, path): 
    5152    """Import a package into a particular point in the python namespace""" 
    52     mod = imp.load_source(modname, abspath(joinpath(path,'__init__.py'))) 
     53    mod = imp.load_source(modname, abspath(joinpath(path, '__init__.py'))) 
    5354    sys.modules[modname] = mod 
    5455    mod.__path__ = [abspath(path)] 
    5556    return mod 
     57 
    5658 
    5759def import_dll(modname, build_path): 
     
    6062    ext = sysconfig.get_config_var('SO') 
    6163    # build_path comes from context 
    62     path = joinpath(build_path, *modname.split('.'))+ext 
    63     #print "importing", modname, "from", path 
     64    path = joinpath(build_path, *modname.split('.')) + ext 
     65    # print "importing", modname, "from", path 
    6466    return imp.load_dynamic(modname, path) 
     67 
    6568 
    6669def prepare(): 
     
    7477    from distutils.util import get_platform 
    7578    root = abspath(dirname(__file__)) 
    76     platform = '%s-%s'%(get_platform(),sys.version[:3]) 
    77     build_path = joinpath(root, 'build','lib.'+platform) 
     79    platform = '%s-%s' % (get_platform(), sys.version[:3]) 
     80    build_path = joinpath(root, 'build', 'lib.' + platform) 
    7881 
    7982    # Notify the help menu that the Sphinx documentation is in a different 
     
    8689    #if not os.path.exists(mplconfig): os.mkdir(mplconfig) 
    8790    #import matplotlib 
    88     #matplotlib.use('Agg') 
    89     #print matplotlib.__file__ 
     91    # matplotlib.use('Agg') 
     92    # print matplotlib.__file__ 
    9093    #import pylab; pylab.hold(False) 
    9194    # add periodictable to the path 
    92     try: import periodictable 
    93     except: addpath(joinpath(root, '..','periodictable')) 
     95    try: 
     96        import periodictable 
     97    except: 
     98        addpath(joinpath(root, '..', 'periodictable')) 
    9499 
    95     try: import bumps 
    96     except: addpath(joinpath(root, '..','bumps')) 
     100    try: 
     101        import bumps 
     102    except: 
     103        addpath(joinpath(root, '..', 'bumps')) 
    97104 
    98105    # select wx version 
     
    114121    # be better to just store the package in src/sas/sasview. 
    115122    import sas 
    116     sas.sasview = import_package('sas.sasview', joinpath(root,'sasview')) 
     123    sas.sasview = import_package('sas.sasview', joinpath(root, 'sasview')) 
    117124 
    118125    # The sas.models package Compiled Model files should be pulled in from the build directory even though 
     
    123130    import sas.sascalc.pr 
    124131    sas.sascalc.pr.core = import_package('sas.sascalc.pr.core', 
    125                                   joinpath(build_path, 'sas', 'sascalc', 'pr', 'core')) 
     132                                         joinpath(build_path, 'sas', 'sascalc', 'pr', 'core')) 
    126133 
    127134    # Compiled modules need to be pulled from the build directory. 
     
    129136    import sas.sascalc.file_converter 
    130137    sas.sascalc.file_converter.core = import_package('sas.sascalc.file_converter.core', 
    131                                   joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core'))                     
     138                                                     joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core')) 
    132139 
    133140    # Compiled modules need to be pulled from the build directory. 
     
    135142    import sas.sascalc.calculator 
    136143    sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core', 
    137                                   joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core')) 
     144                                                 joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core')) 
    138145 
    139146    sys.path.append(build_path) 
    140147 
    141     #print "\n".join(sys.path) 
     148    # print "\n".join(sys.path) 
     149 
    142150 
    143151if __name__ == "__main__": 
    144     #Need to add absolute path before actual prepare call, 
    145     #so logging can be done during initialization process too 
     152    # Need to add absolute path before actual prepare call, 
     153    # so logging can be done during initialization process too 
    146154    root = abspath(dirname(__file__)) 
    147155    addpath(joinpath(root, 'sasview')) 
  • sasview/logger_config.py

    r09983d1 rf36e01f  
    11from __future__ import print_function 
     2 
     3import logging 
     4import logging.config 
     5import os 
     6import os.path 
     7 
     8import pkg_resources 
     9 
    210 
    311''' 
     
    513''' 
    614 
    7 import logging 
    8 import logging.config 
    9 import os 
    10 import os.path 
    11 import pkg_resources 
    1215 
    1316class SetupLogger(object): 
     
    2124 
    2225    def config_production(self): 
    23         ''' 
    24         ''' 
    2526        logger = logging.getLogger(self.name) 
    2627        if not logger.root.handlers: 
     
    4041 
    4142    def _read_config_file(self): 
    42         ''' 
    43         ''' 
    4443        if self.config_file is not None: 
    4544            logging.config.fileConfig(self.config_file) 
  • sasview/sasview.py

    ra5a74e9 rf36e01f  
    44""" 
    55################################################################################ 
    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. 
     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. 
    99# 
    10 #See the license text in license.txt 
     10# See the license text in license.txt 
    1111# 
    12 #copyright 2009, University of Tennessee 
     12# copyright 2009, University of Tennessee 
    1313################################################################################ 
    1414import os 
    1515import os.path 
    1616import sys 
    17 import logging 
    18 import logging.config 
    1917import traceback 
    2018 
     
    2220 
    2321logger = SetupLogger(__name__).config_production() 
     22 
    2423 
    2524# Log the start of the session 
     
    5554import wxcruft 
    5655wxcruft.call_later_fix() 
    57 #wxcruft.trace_new_id() 
     56# wxcruft.trace_new_id() 
    5857 
    59 #Always use private .matplotlib setup to avoid conflicts with other 
    60 #uses of matplotlib 
    61 #Have to check if .sasview exists first 
     58# Always use private .matplotlib setup to avoid conflicts with other 
     59# uses of matplotlib 
     60# Have to check if .sasview exists first 
    6261sasdir = os.path.join(os.path.expanduser("~"),'.sasview') 
    6362if not os.path.exists(sasdir): 
     
    7271from sas.sasgui.guiframe.gui_style import GUIFRAME 
    7372from welcome_panel import WelcomePanel 
    74 # For py2exe, import config here 
    75 import local_config 
     73 
    7674PLUGIN_MODEL_DIR = 'plugin_models' 
    7775APP_NAME = 'SasView' 
     
    8785        """ 
    8886        """ 
    89         #from gui_manager import ViewApp 
     87        # from gui_manager import ViewApp 
    9088        self.gui = gui_manager.SasViewApp(0) 
    9189        # Set the application manager for the GUI 
     
    116114            logger.error(traceback.format_exc()) 
    117115 
    118         #Invariant perspective 
     116        # Invariant perspective 
    119117        try: 
    120118            import sas.sasgui.perspectives.invariant as module 
     
    134132            logger.error("Unable to load corfunc module") 
    135133 
    136         #Calculator perspective 
     134        # Calculator perspective 
    137135        try: 
    138136            import sas.sasgui.perspectives.calculator as module 
     
    153151                                                        APP_NAME) 
    154152            logger.error(traceback.format_exc()) 
    155  
    156153 
    157154        # Add welcome page 
     
    174171    if len(sys.argv) > 1: 
    175172        ## Run sasview as an interactive python interpreter 
    176         #if sys.argv[1] == "-i": 
     173        # if sys.argv[1] == "-i": 
    177174        #    sys.argv = ["ipython", "--pylab"] 
    178175        #    from IPython import start_ipython 
     
    188185        SasView() 
    189186 
     187 
    190188if __name__ == "__main__": 
    191189    run() 
  • sasview/setup_exe.py

    rc04fb72 rf36e01f  
    6262        sys.argv.remove('--extrapath') 
    6363except: 
    64     print "Error processing extra python path needed to build SasView\n  %s" % \ 
    65                 sys.exc_value 
     64    print("Error processing extra python path needed to build SasView\n  %s" % \ 
     65                sys.exc_value) 
    6666 
    6767 
     
    8383        modulefinder.AddPackagePath(win32_folder, p) 
    8484    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) 
    9392 
    9493except ImportError: 
     
    167166        self.copyright = "copyright 2009 - 2016" 
    168167        self.name = "SasView" 
    169          
     168 
    170169# 
    171170# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib 
     
    341340    ]) 
    342341packages.append('periodictable.core') # not found automatically 
    343 #packages.append('IPython') 
     342# packages.append('IPython') 
    344343includes = ['site', 'lxml._elementpath', 'lxml.etree'] 
    345344 
     
    374373    other_resources = [(24, 1, manifest)], 
    375374    dest_base = "SasView" 
    376     ) 
     375) 
    377376 
    378377# bundle_option = 2 
  • setup.py

    r2a8b4756 rf36e01f  
     1# -*- coding: utf-8 -*- 
     2#!/usr/bin/env python 
     3 
    14""" 
    25    Setup for SasView 
    3     #TODO: Add checks to see that all the dependencies are on the system 
     6    TODO: Add checks to see that all the dependencies are on the system 
    47""" 
    5 import sys 
     8 
    69import os 
    710import shutil 
    8 from setuptools import setup, Extension 
     11import sys 
    912from distutils.command.build_ext import build_ext 
    1013from distutils.core import Command 
     14 
    1115import numpy as np 
     16from setuptools import Extension, setup 
    1217 
    1318# Manage version number ###################################### 
    1419import sasview 
     20 
    1521VERSION = sasview.__version__ 
    1622############################################################## 
     
    2531# except when there is no such file 
    2632# Todo : make this list generic 
    27 #plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py', 
     33# plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py', 
    2834#                      'sum_Ap1_1_Ap2.py', 'sum_p1_p2.py', 
    2935#                      'testmodel_2.py', 'testmodel.py', 
     
    3541SASVIEW_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") 
    3642 
    37 sas_dir = os.path.join(os.path.expanduser("~"),'.sasview') 
     43sas_dir = os.path.join(os.path.expanduser("~"), '.sasview') 
    3844if os.path.isdir(sas_dir): 
    3945    f_path = os.path.join(sas_dir, "sasview.log") 
     
    4753        os.remove(f_path) 
    4854    #f_path = os.path.join(sas_dir, 'plugin_models') 
    49     #if os.path.isdir(f_path): 
     55    # if os.path.isdir(f_path): 
    5056    #     for f in os.listdir(f_path): 
    5157    #         if f in plugin_model_list: 
     
    5359    #             os.remove(file_path) 
    5460    if os.path.exists(SASVIEW_BUILD): 
    55         print("Removing existing build directory", SASVIEW_BUILD, "for a clean build") 
     61        print("Removing existing build directory", 
     62              SASVIEW_BUILD, "for a clean build") 
    5663        shutil.rmtree(SASVIEW_BUILD) 
    5764 
     
    6370enable_openmp = False 
    6471 
    65 if sys.platform =='darwin': 
     72if sys.platform == 'darwin': 
    6673    if not is_64bits: 
    6774        # Disable OpenMP 
     
    7784 
    7885# Options to enable OpenMP 
    79 copt =  {'msvc': ['/openmp'], 
    80          'mingw32' : ['-fopenmp'], 
    81          'unix' : ['-fopenmp']} 
    82 lopt =  {'msvc': ['/MANIFEST'], 
    83          'mingw32' : ['-fopenmp'], 
    84          'unix' : ['-lgomp']} 
     86copt = {'msvc': ['/openmp'], 
     87        'mingw32': ['-fopenmp'], 
     88        'unix': ['-fopenmp']} 
     89lopt = {'msvc': ['/MANIFEST'], 
     90        'mingw32': ['-fopenmp'], 
     91        'unix': ['-lgomp']} 
    8592 
    8693# Platform-specific link options 
    87 platform_lopt = {'msvc' : ['/MANIFEST']} 
     94platform_lopt = {'msvc': ['/MANIFEST']} 
    8895platform_copt = {} 
    8996 
    9097# Set copts to get compile working on OS X >= 10.9 using clang 
    91 if sys.platform =='darwin': 
     98if sys.platform == 'darwin': 
    9299    try: 
    93100        darwin_ver = int(os.uname()[2].split('.')[0]) 
    94101        if darwin_ver >= 13 and darwin_ver < 14: 
    95             platform_copt = {'unix' : ['-Wno-error=unused-command-line-argument-hard-error-in-future']} 
     102            platform_copt = { 
     103                'unix': ['-Wno-error=unused-command-line-argument-hard-error-in-future']} 
    96104    except: 
    97105        print("PROBLEM determining Darwin version") 
     106 
    98107 
    99108class DisableOpenMPCommand(Command): 
     
    114123        pass 
    115124 
    116 class build_ext_subclass( build_ext ): 
     125 
     126class build_ext_subclass(build_ext): 
    117127    def build_extensions(self): 
    118128        # Get 64-bitness 
     
    124134            if c in copt: 
    125135                for e in self.extensions: 
    126                     e.extra_compile_args = copt[ c ] 
     136                    e.extra_compile_args = copt[c] 
    127137            if c in lopt: 
    128138                for e in self.extensions: 
    129                     e.extra_link_args = lopt[ c ] 
     139                    e.extra_link_args = lopt[c] 
    130140 
    131141        # Platform-specific build options 
    132142        if c in platform_lopt: 
    133143            for e in self.extensions: 
    134                 e.extra_link_args = platform_lopt[ c ] 
     144                e.extra_link_args = platform_lopt[c] 
    135145 
    136146        if c in platform_copt: 
    137147            for e in self.extensions: 
    138                 e.extra_compile_args = platform_copt[ c ] 
    139  
     148                e.extra_compile_args = platform_copt[c] 
    140149 
    141150        build_ext.build_extensions(self) 
     151 
    142152 
    143153class BuildSphinxCommand(Command): 
     
    156166        build_sphinx.rebuild() 
    157167 
     168 
    158169# sas module 
    159170package_dir["sas"] = os.path.join("src", "sas") 
     
    169180 
    170181# sas.sascalc.invariant 
    171 package_dir["sas.sascalc.invariant"] = os.path.join("src", "sas", "sascalc", "invariant") 
     182package_dir["sas.sascalc.invariant"] = os.path.join( 
     183    "src", "sas", "sascalc", "invariant") 
    172184packages.extend(["sas.sascalc.invariant"]) 
    173185 
     
    175187guiframe_path = os.path.join("src", "sas", "sasgui", "guiframe") 
    176188package_dir["sas.sasgui.guiframe"] = guiframe_path 
    177 package_dir["sas.sasgui.guiframe.local_perspectives"] = os.path.join(os.path.join(guiframe_path, "local_perspectives")) 
     189package_dir["sas.sasgui.guiframe.local_perspectives"] = os.path.join( 
     190    os.path.join(guiframe_path, "local_perspectives")) 
    178191package_data["sas.sasgui.guiframe"] = ['images/*', 'media/*'] 
    179 packages.extend(["sas.sasgui.guiframe", "sas.sasgui.guiframe.local_perspectives"]) 
     192packages.extend( 
     193    ["sas.sasgui.guiframe", "sas.sasgui.guiframe.local_perspectives"]) 
    180194# build local plugin 
    181195for d in os.listdir(os.path.join(guiframe_path, "local_perspectives")): 
    182     if d not in ['.svn','__init__.py', '__init__.pyc']: 
     196    if d not in ['.svn', '__init__.py', '__init__.pyc']: 
    183197        package_name = "sas.sasgui.guiframe.local_perspectives." + d 
    184198        packages.append(package_name) 
    185         package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", d) 
     199        package_dir[package_name] = os.path.join( 
     200            guiframe_path, "local_perspectives", d) 
    186201 
    187202# sas.sascalc.dataloader 
    188 package_dir["sas.sascalc.dataloader"] = os.path.join("src", "sas", "sascalc", "dataloader") 
    189 package_data["sas.sascalc.dataloader.readers"] = ['defaults.json','schema/*.xsd'] 
    190 packages.extend(["sas.sascalc.dataloader","sas.sascalc.dataloader.readers","sas.sascalc.dataloader.readers.schema"]) 
     203package_dir["sas.sascalc.dataloader"] = os.path.join( 
     204    "src", "sas", "sascalc", "dataloader") 
     205package_data["sas.sascalc.dataloader.readers"] = [ 
     206    'defaults.json', 'schema/*.xsd'] 
     207packages.extend(["sas.sascalc.dataloader", "sas.sascalc.dataloader.readers", 
     208                 "sas.sascalc.dataloader.readers.schema"]) 
    191209 
    192210# sas.sascalc.calculator 
    193211gen_dir = os.path.join("src", "sas", "sascalc", "calculator", "c_extensions") 
    194212package_dir["sas.sascalc.calculator.core"] = gen_dir 
    195 package_dir["sas.sascalc.calculator"] = os.path.join("src", "sas", "sascalc", "calculator") 
    196 packages.extend(["sas.sascalc.calculator","sas.sascalc.calculator.core"]) 
    197 ext_modules.append( Extension("sas.sascalc.calculator.core.sld2i", 
    198         sources = [ 
    199             os.path.join(gen_dir, "sld2i_module.cpp"), 
    200             os.path.join(gen_dir, "sld2i.cpp"), 
    201             os.path.join(gen_dir, "libfunc.c"), 
    202             os.path.join(gen_dir, "librefl.c"), 
    203         ], 
    204         include_dirs=[gen_dir], 
    205     ) 
    206 ) 
     213package_dir["sas.sascalc.calculator"] = os.path.join( 
     214    "src", "sas", "sascalc", "calculator") 
     215packages.extend(["sas.sascalc.calculator", "sas.sascalc.calculator.core"]) 
     216ext_modules.append(Extension("sas.sascalc.calculator.core.sld2i", 
     217                             sources=[ 
     218                                 os.path.join(gen_dir, "sld2i_module.cpp"), 
     219                                 os.path.join(gen_dir, "sld2i.cpp"), 
     220                                 os.path.join(gen_dir, "libfunc.c"), 
     221                                 os.path.join(gen_dir, "librefl.c"), 
     222                             ], 
     223                             include_dirs=[gen_dir], 
     224                             ) 
     225                   ) 
    207226 
    208227# sas.sascalc.pr 
    209 srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
     228srcdir = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
    210229package_dir["sas.sascalc.pr.core"] = srcdir 
    211 package_dir["sas.sascalc.pr"] = os.path.join("src","sas", "sascalc", "pr") 
    212 packages.extend(["sas.sascalc.pr","sas.sascalc.pr.core"]) 
    213 ext_modules.append( Extension("sas.sascalc.pr.core.pr_inversion", 
    214                               sources = [os.path.join(srcdir, "Cinvertor.c"), 
    215                                          os.path.join(srcdir, "invertor.c"), 
    216                                          ], 
    217                               include_dirs=[], 
    218                               ) ) 
     230package_dir["sas.sascalc.pr"] = os.path.join("src", "sas", "sascalc", "pr") 
     231packages.extend(["sas.sascalc.pr", "sas.sascalc.pr.core"]) 
     232ext_modules.append(Extension("sas.sascalc.pr.core.pr_inversion", 
     233                             sources=[os.path.join(srcdir, "Cinvertor.c"), 
     234                                      os.path.join(srcdir, "invertor.c"), 
     235                                      ], 
     236                             include_dirs=[], 
     237                             )) 
    219238 
    220239# sas.sascalc.file_converter 
    221240mydir = os.path.join("src", "sas", "sascalc", "file_converter", "c_ext") 
    222241package_dir["sas.sascalc.file_converter.core"] = mydir 
    223 package_dir["sas.sascalc.file_converter"] = os.path.join("src","sas", "sascalc", "file_converter") 
    224 packages.extend(["sas.sascalc.file_converter","sas.sascalc.file_converter.core"]) 
    225 ext_modules.append( Extension("sas.sascalc.file_converter.core.bsl_loader", 
    226                               sources = [os.path.join(mydir, "bsl_loader.c")], 
    227                               include_dirs=[np.get_include()], 
    228                               ) ) 
    229  
    230 #sas.sascalc.corfunc 
    231 package_dir["sas.sascalc.corfunc"] = os.path.join("src", "sas", "sascalc", "corfunc") 
     242package_dir["sas.sascalc.file_converter"] = os.path.join( 
     243    "src", "sas", "sascalc", "file_converter") 
     244packages.extend(["sas.sascalc.file_converter", 
     245                 "sas.sascalc.file_converter.core"]) 
     246ext_modules.append(Extension("sas.sascalc.file_converter.core.bsl_loader", 
     247                             sources=[os.path.join(mydir, "bsl_loader.c")], 
     248                             include_dirs=[np.get_include()], 
     249                             )) 
     250 
     251# sas.sascalc.corfunc 
     252package_dir["sas.sascalc.corfunc"] = os.path.join( 
     253    "src", "sas", "sascalc", "corfunc") 
    232254packages.extend(["sas.sascalc.corfunc"]) 
    233255 
     
    237259 
    238260# Perspectives 
    239 package_dir["sas.sasgui.perspectives"] = os.path.join("src", "sas", "sasgui", "perspectives") 
    240 package_dir["sas.sasgui.perspectives.pr"] = os.path.join("src", "sas", "sasgui", "perspectives", "pr") 
    241 packages.extend(["sas.sasgui.perspectives","sas.sasgui.perspectives.pr"]) 
     261package_dir["sas.sasgui.perspectives"] = os.path.join( 
     262    "src", "sas", "sasgui", "perspectives") 
     263package_dir["sas.sasgui.perspectives.pr"] = os.path.join( 
     264    "src", "sas", "sasgui", "perspectives", "pr") 
     265packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.pr"]) 
    242266package_data["sas.sasgui.perspectives.pr"] = ['media/*'] 
    243267 
    244 package_dir["sas.sasgui.perspectives.invariant"] = os.path.join("src", "sas", "sasgui", "perspectives", "invariant") 
     268package_dir["sas.sasgui.perspectives.invariant"] = os.path.join( 
     269    "src", "sas", "sasgui", "perspectives", "invariant") 
    245270packages.extend(["sas.sasgui.perspectives.invariant"]) 
    246 package_data['sas.sasgui.perspectives.invariant'] = [os.path.join("media",'*')] 
    247  
    248 package_dir["sas.sasgui.perspectives.fitting"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting") 
    249 package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting", "plugin_models") 
    250 packages.extend(["sas.sasgui.perspectives.fitting", "sas.sasgui.perspectives.fitting.plugin_models"]) 
    251 package_data['sas.sasgui.perspectives.fitting'] = ['media/*', 'plugin_models/*'] 
    252  
    253 packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
     271package_data['sas.sasgui.perspectives.invariant'] = [ 
     272    os.path.join("media", '*')] 
     273 
     274package_dir["sas.sasgui.perspectives.fitting"] = os.path.join( 
     275    "src", "sas", "sasgui", "perspectives", "fitting") 
     276package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join( 
     277    "src", "sas", "sasgui", "perspectives", "fitting", "plugin_models") 
     278packages.extend(["sas.sasgui.perspectives.fitting", 
     279                 "sas.sasgui.perspectives.fitting.plugin_models"]) 
     280package_data['sas.sasgui.perspectives.fitting'] = [ 
     281    'media/*', 'plugin_models/*'] 
     282 
     283packages.extend(["sas.sasgui.perspectives", 
     284                 "sas.sasgui.perspectives.calculator"]) 
    254285package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 
    255286 
    256 package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join("src", "sas", "sasgui", "perspectives", "corfunc") 
     287package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join( 
     288    "src", "sas", "sasgui", "perspectives", "corfunc") 
    257289packages.extend(["sas.sasgui.perspectives.corfunc"]) 
    258290package_data['sas.sasgui.perspectives.corfunc'] = ['media/*'] 
    259291 
    260 package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join("src", "sas", "sasgui", "perspectives", "file_converter") 
     292package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join( 
     293    "src", "sas", "sasgui", "perspectives", "file_converter") 
    261294packages.extend(["sas.sasgui.perspectives.file_converter"]) 
    262295package_data['sas.sasgui.perspectives.file_converter'] = ['media/*'] 
    263296 
    264297# Data util 
    265 package_dir["sas.sascalc.data_util"] = os.path.join("src", "sas", "sascalc", "data_util") 
     298package_dir["sas.sascalc.data_util"] = os.path.join( 
     299    "src", "sas", "sascalc", "data_util") 
    266300packages.append("sas.sascalc.data_util") 
    267301 
    268302# Plottools 
    269 package_dir["sas.sasgui.plottools"] = os.path.join("src", "sas", "sasgui", "plottools") 
     303package_dir["sas.sasgui.plottools"] = os.path.join( 
     304    "src", "sas", "sasgui", "plottools") 
    270305packages.append("sas.sasgui.plottools") 
    271306 
     
    275310 
    276311EXTENSIONS = [".c", ".cpp"] 
     312 
    277313 
    278314def append_file(file_list, dir_path): 
     
    294330                        file_list.append(os.path.join(sub_dir, new_f)) 
    295331 
     332 
    296333# Comment out the following to avoid rebuilding all the models 
    297334file_sources = [] 
    298335append_file(file_sources, gen_dir) 
    299336 
    300 #Wojtek's hacky way to add doc files while bundling egg 
    301 #def add_doc_files(directory): 
     337# Wojtek's hacky way to add doc files while bundling egg 
     338# def add_doc_files(directory): 
    302339#    paths = [] 
    303340#    for (path, directories, filenames) in os.walk(directory): 
     
    332369    'lxml', 'h5py', 
    333370 
    334     ## The following dependecies won't install automatically, so assume them 
    335     ## The numbers should be bumped up for matplotlib and wxPython as well. 
     371    # The following dependecies won't install automatically, so assume them 
     372    # The numbers should be bumped up for matplotlib and wxPython as well. 
    336373    # 'numpy>=1.4.1', 'scipy>=0.7.2', 'matplotlib>=0.99.1.1', 
    337374    # 'wxPython>=2.8.11', 'pil', 
    338     ] 
    339  
    340 if os.name=='nt': 
     375] 
     376 
     377if os.name == 'nt': 
    341378    required.extend(['html5lib', 'reportlab']) 
    342379else: 
     
    347384setup( 
    348385    name="sasview", 
    349     version = VERSION, 
    350     description = "SasView application", 
    351     author = "SasView Team", 
    352     author_email = "developers@sasview.org", 
    353     url = "http://sasview.org", 
    354     license = "PSF", 
    355     keywords = "small-angle x-ray and neutron scattering analysis", 
    356     download_url = "https://github.com/SasView/sasview.git", 
    357     package_dir = package_dir, 
    358     packages = packages, 
    359     package_data = package_data, 
    360     ext_modules = ext_modules, 
    361     install_requires = required, 
    362     zip_safe = False, 
    363     entry_points = { 
    364                     'console_scripts':[ 
    365                                        "sasview = sas.sasview.sasview:run", 
    366                                        ] 
    367                     }, 
    368     cmdclass = {'build_ext': build_ext_subclass, 
    369                 'docs': BuildSphinxCommand, 
    370                 'disable_openmp': DisableOpenMPCommand} 
    371     ) 
     386    version=VERSION, 
     387    description="SasView application", 
     388    author="SasView Team", 
     389    author_email="developers@sasview.org", 
     390    url="http://sasview.org", 
     391    license="PSF", 
     392    keywords="small-angle x-ray and neutron scattering analysis", 
     393    download_url="https://github.com/SasView/sasview.git", 
     394    package_dir=package_dir, 
     395    packages=packages, 
     396    package_data=package_data, 
     397    ext_modules=ext_modules, 
     398    install_requires=required, 
     399    zip_safe=False, 
     400    entry_points={ 
     401        'console_scripts': [ 
     402            "sasview = sas.sasview.sasview:run", 
     403        ] 
     404    }, 
     405    cmdclass={'build_ext': build_ext_subclass, 
     406              'docs': BuildSphinxCommand, 
     407              'disable_openmp': DisableOpenMPCommand} 
     408) 
Note: See TracChangeset for help on using the changeset viewer.