Changeset 5e2f36c in sasview for src/sas/sasgui


Ignore:
Timestamp:
Apr 5, 2017 10:56:22 AM (7 years ago)
Author:
GitHub <noreply@…>
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:
9d93c37, 7b15990, 07b50df9, 63d773c
Parents:
98c44f3 (diff), 8f8100a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Andrew Jackson <andrew.jackson@…> (04/05/17 10:56:22)
git-committer:
GitHub <noreply@…> (04/05/17 10:56:22)
Message:

Merge pull request #61 from SasView?/logger

Logger fixes #916

Location:
src/sas/sasgui
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/CategoryInstaller.py

    rddbac66 r463e7ffc  
    1616 
    1717USER_FILE = 'categories.json' 
     18 
     19logger = logging.getLogger(__name__) 
    1820 
    1921class CategoryInstaller: 
     
    114116    @staticmethod 
    115117    def get_default_file(): 
    116         logging.warning("CategoryInstaller.get_default_file is deprecated.") 
     118        logger.warning("CategoryInstaller.get_default_file is deprecated.") 
    117119 
    118120    @staticmethod 
     
    153155                        model_enabled_dict.pop(model_name) 
    154156                    except: 
    155                         logging.error("CategoryInstaller: %s", sys.exc_value) 
     157                        logger.error("CategoryInstaller: %s", sys.exc_value) 
    156158                else: 
    157159                    add_list.remove(model_name) 
  • src/sas/sasgui/guiframe/CategoryManager.py

    r212bfc2 r463e7ffc  
    2020from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    2121IS_MAC = (sys.platform == 'darwin') 
     22 
     23logger = logging.getLogger(__name__) 
    2224 
    2325""" Notes 
     
    373375                    self.master_category_dict = json.load(f) 
    374376        except IOError: 
    375             logging.error('Problem reading in category file.') 
     377            logger.error('Problem reading in category file.') 
    376378 
    377379        self._regenerate_model_dict() 
  • src/sas/sasgui/guiframe/config.py

    r1779e72 r64ca561  
    77import sas.sasview 
    88import logging 
     9 
     10 
     11logger = logging.getLogger(__name__) 
    912 
    1013# Version of the application 
     
    5760 
    5861icon_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "images")) 
    59 logging.info("icon path: %s" % icon_path) 
     62logger.info("icon path: %s" % icon_path) 
    6063media_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "media")) 
    6164test_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "test")) 
  • src/sas/sasgui/guiframe/data_manager.py

    r2ffe241 r463e7ffc  
    2525from sas.sasgui.guiframe.dataFitting import Data2D 
    2626import time 
     27 
     28logger = logging.getLogger(__name__) 
    2729 
    2830class DataManager(object): 
     
    136138                msg = "Data manager already stores %s" % str(data.name) 
    137139                msg += "" 
    138                 logging.info(msg) 
     140                logger.info(msg) 
    139141                data_state = self.stored_data[id] 
    140142                data_state.data = data 
  • src/sas/sasgui/guiframe/documentation_window.py

    rd85c194 r463e7ffc  
    2020import urllib 
    2121import sys 
     22 
     23logger = logging.getLogger(__name__) 
    2224 
    2325SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
     
    7173 
    7274        if not os.path.exists(file_path): 
    73             logging.error("Could not find Sphinx documentation at %s \ 
     75            logger.error("Could not find Sphinx documentation at %s \ 
    7476            -- has it been built?", file_path) 
    7577        elif WX_SUPPORTS_HTML2: 
     
    7981            self.Show() 
    8082        else: 
    81             logging.error("No html2 support, popping up a web browser") 
     83            logger.error("No html2 support, popping up a web browser") 
    8284            #For cases that do not build against current version dependency 
    8385            # Wx 3.0 we provide a webbrowser call - this is particularly for 
  • src/sas/sasgui/guiframe/gui_manager.py

    r73cbeec r64ca561  
    4848from matplotlib import _pylab_helpers 
    4949 
     50logger = logging.getLogger(__name__) 
     51 
    5052warnings.simplefilter("ignore") 
    51  
    5253 
    5354def get_app_dir(): 
     
    6465    if os.path.isfile(os.path.join(app_path, "custom_config.py")): 
    6566        app_path = os.path.abspath(app_path) 
    66         logging.info("Using application path: %s", app_path) 
     67        logger.info("Using application path: %s", app_path) 
    6768        return app_path 
    6869 
    6970    # Next, try the current working directory 
    7071    if os.path.isfile(os.path.join(os.getcwd(), "custom_config.py")): 
    71         logging.info("Using application path: %s", os.getcwd()) 
     72        logger.info("Using application path: %s", os.getcwd()) 
    7273        return os.path.abspath(os.getcwd()) 
    7374 
     
    7677    # clean all these module variables and put them into a config class 
    7778    # that can be passed by sasview.py. 
    78     logging.info(sys.executable) 
    79     logging.info(str(sys.argv)) 
     79    logger.info(sys.executable) 
     80    logger.info(str(sys.argv)) 
    8081    from sas import sasview as sasview 
    8182    app_path = os.path.dirname(sasview.__file__) 
    82     logging.info("Using application path: %s", app_path) 
     83    logger.info("Using application path: %s", app_path) 
    8384    return app_path 
    8485 
     
    104105        config_module = imp.load_module(file, fObj, path_config, descr) 
    105106    except: 
    106         logging.error("Error loading %s/%s: %s" % (path, file, sys.exc_value)) 
     107        logger.error("Error loading %s/%s: %s" % (path, file, sys.exc_value)) 
    107108    finally: 
    108109        if fObj is not None: 
    109110            fObj.close() 
    110     logging.info("GuiManager loaded %s/%s" % (path, file)) 
     111    logger.info("GuiManager loaded %s/%s" % (path, file)) 
    111112    return config_module 
    112113 
     
    125126        # Didn't find local config, load the default 
    126127        import sas.sasgui.guiframe.config as config 
    127         logging.info("using default local_config") 
     128        logger.info("using default local_config") 
    128129    else: 
    129         logging.info("found local_config in %s" % os.getcwd()) 
     130        logger.info("found local_config in %s" % os.getcwd()) 
    130131else: 
    131     logging.info("found local_config in %s" % PATH_APP) 
     132    logger.info("found local_config in %s" % PATH_APP) 
    132133 
    133134from sas.sasgui.guiframe.customdir import SetupCustom 
     
    138139    if custom_config is None: 
    139140        msgConfig = "Custom_config file was not imported" 
    140         logging.info(msgConfig) 
     141        logger.info(msgConfig) 
    141142    else: 
    142         logging.info("using custom_config in %s" % os.getcwd()) 
     143        logger.info("using custom_config in %s" % os.getcwd()) 
    143144else: 
    144     logging.info("using custom_config from %s" % c_conf_dir) 
     145    logger.info("using custom_config from %s" % c_conf_dir) 
    145146 
    146147# read some constants from config 
     
    374375                    frame.SetIcon(icon) 
    375376                except: 
    376                     logging.error("ViewerFrame.put_icon: could not set icon") 
     377                    logger.error("ViewerFrame.put_icon: could not set icon") 
    377378 
    378379    def get_client_size(self): 
     
    803804                                                str(self._input_file)) 
    804805            msg += str(sys.exc_value) + '\n' 
    805             logging.error(msg) 
     806            logger.error(msg) 
    806807        if self._data_panel is not None and len(self.plugins) > 0: 
    807808            self._data_panel.fill_cbox_analysis(self.plugins) 
     
    869870            if plugin.__class__ == item.__class__: 
    870871                msg = "Plugin %s already loaded" % plugin.sub_menu 
    871                 logging.info(msg) 
     872                logger.info(msg) 
    872873                is_loaded = True 
    873874        if not is_loaded: 
    874875            self.plugins.append(plugin) 
    875876            msg = "Plugin %s appended" % plugin.sub_menu 
    876             logging.info(msg) 
     877            logger.info(msg) 
    877878 
    878879    def _get_local_plugins(self): 
     
    894895                msg = "ViewerFrame._get_local_plugins:" 
    895896                msg += "cannot import dataloader plugin.\n %s" % sys.exc_value 
    896                 logging.error(msg) 
     897                logger.error(msg) 
    897898        if style2 == GUIFRAME.PLOTTING_ON: 
    898899            try: 
     
    904905                msg = "ViewerFrame._get_local_plugins:" 
    905906                msg += "cannot import plotting plugin.\n %s" % sys.exc_value 
    906                 logging.error(msg) 
     907                logger.error(msg) 
    907908 
    908909        return plugins 
     
    949950                                plugins.append(module.Plugin()) 
    950951                                msg = "Found plug-in: %s" % module.PLUGIN_ID 
    951                                 logging.info(msg) 
     952                                logger.info(msg) 
    952953                            except: 
    953954                                msg = "Error accessing PluginPanel" 
     
    956957                    except: 
    957958                        msg = "ViewerFrame._find_plugins: %s" % sys.exc_value 
    958                         logging.error(msg) 
     959                        logger.error(msg) 
    959960                    finally: 
    960961                        if file is not None: 
     
    963964            # Should raise and catch at a higher level and 
    964965            # display error on status bar 
    965             logging.error(sys.exc_value) 
     966            logger.error(sys.exc_value) 
    966967 
    967968        return plugins 
     
    13851386 
    13861387        if config._do_aboutbox: 
    1387             logging.info("Doing help menu") 
     1388            logger.info("Doing help menu") 
    13881389            wx_id = wx.NewId() 
    13891390            self._help_menu.Append(wx_id, '&About', 'Software information') 
     
    17461747                del self.panels[ID] 
    17471748        else: 
    1748             logging.error("delete_panel: No such plot id as %s" % ID) 
     1749            logger.error("delete_panel: No such plot id as %s" % ID) 
    17491750 
    17501751    def create_gui_data(self, data, path=None): 
     
    17631764            log_msg += "load: %s\n" % str(basename) 
    17641765            log_msg += "Try Data opening...." 
    1765             logging.error(log_msg) 
     1766            logger.error(log_msg) 
    17661767            return 
    17671768 
     
    18431844            log_msg += "load: %s\n" % str(path) 
    18441845            log_msg += "Try File opening ...." 
    1845             logging.error(log_msg) 
     1846            logger.error(log_msg) 
    18461847            return 
    18471848        log_msg = '' 
     
    18491850        error_message = "" 
    18501851        try: 
    1851             logging.info("Loading Data...:\n" + str(path) + "\n") 
     1852            logger.info("Loading Data...:\n" + str(path) + "\n") 
    18521853            temp = self.loader.load(path) 
    18531854            if temp.__class__.__name__ == "list": 
     
    18641865            error_message += " Data from cmd:\n %s\n" % str(path) 
    18651866            error_message += str(sys.exc_value) + "\n" 
    1866             logging.error(error_message) 
     1867            logger.error(error_message) 
    18671868 
    18681869    def load_folder(self, path): 
     
    18851886            error_message += " Data folder from cmd:\n %s\n" % str(path) 
    18861887            error_message += str(sys.exc_value) + "\n" 
    1887             logging.error(error_message) 
     1888            logger.error(error_message) 
    18881889 
    18891890    def _on_open_state_application(self, event): 
     
    20442045                msg += "and model selected. " 
    20452046                msg += "No project was saved to %s" % (str(path)) 
    2046                 logging.warning(msg) 
     2047                logger.warning(msg) 
    20472048                wx.PostEvent(self, StatusEvent(status=msg, info="error")) 
    20482049        except Exception: 
     
    21112112        #IF SAS_OPENCL is set, settings are stored in the custom config file 
    21122113        self._write_opencl_config_file() 
    2113         logging.info(" --- SasView session was closed --- \n") 
     2114        logger.info(" --- SasView session was closed --- \n") 
    21142115        wx.Exit() 
    21152116        sys.exit() 
     
    21402141            new_config_file.close() 
    21412142        else: 
    2142             logging.info("Failed to save OPENCL settings in custom config file") 
     2143            logger.info("Failed to save OPENCL settings in custom config file") 
    21432144 
    21442145 
     
    21572158                #  
    21582159                content = response.read().strip() 
    2159                 logging.info("Connected to www.sasview.org. Latest version: %s" 
     2160                logger.info("Connected to www.sasview.org. Latest version: %s" 
    21602161                             % (content)) 
    21612162                version_info = json.loads(content) 
    21622163            except: 
    2163                 logging.info("Failed to connect to www.sasview.org") 
     2164                logger.info("Failed to connect to www.sasview.org") 
    21642165        self._process_version(version_info, standalone=event is None) 
    21652166 
     
    22012202            msg = "guiframe: could not get latest application" 
    22022203            msg += " version number\n  %s" % sys.exc_value 
    2203             logging.error(msg) 
     2204            logger.error(msg) 
    22042205            if not standalone: 
    22052206                msg = "Could not connect to the application server." 
     
    22482249                    dialog.Show(True) 
    22492250                except: 
    2250                     logging.error("Error in _onTutorial: %s" % sys.exc_value) 
     2251                    logger.error("Error in _onTutorial: %s" % sys.exc_value) 
    22512252                    try: 
    22522253                        # Try an alternate method 
    2253                         logging.error( 
     2254                        logger.error( 
    22542255                            "Could not open the tutorial pdf, trying xhtml2pdf") 
    22552256                        from xhtml2pdf import pisa 
    22562257                        pisa.startViewer(path) 
    22572258                    except: 
    2258                         logging.error( 
     2259                        logger.error( 
    22592260                            "Could not open the tutorial pdf with xhtml2pdf") 
    22602261                        msg = "This feature requires 'PDF Viewer'\n" 
     
    22672268                    try: 
    22682269                        # Try an alternate method 
    2269                         logging.error( 
     2270                        logger.error( 
    22702271                            "Could not open the tutorial pdf, trying xhtml2pdf") 
    22712272                        from xhtml2pdf import pisa 
    22722273                        pisa.startViewer(path) 
    22732274                    except: 
    2274                         logging.error( 
     2275                        logger.error( 
    22752276                            "Could not open the tutorial pdf with xhtml2pdf") 
    22762277                        msg = "This feature requires the Preview application\n" 
     
    24112412        else: 
    24122413            msg = "Guiframe does not have a current perspective" 
    2413             logging.info(msg) 
     2414            logger.info(msg) 
    24142415 
    24152416    def set_theory(self, state_id, theory_id=None): 
     
    24222423            except: 
    24232424                msg = "Guiframe set_theory: \n" + str(sys.exc_value) 
    2424                 logging.info(msg) 
     2425                logger.info(msg) 
    24252426                wx.PostEvent(self, StatusEvent(status=msg, info="error")) 
    24262427        else: 
    24272428            msg = "Guiframe does not have a current perspective" 
    2428             logging.info(msg) 
     2429            logger.info(msg) 
    24292430 
    24302431    def plot_data(self, state_id, data_id=None, 
     
    25082509                                            action='remove')) 
    25092510        except: 
    2510             logging.error(sys.exc_value) 
     2511            logger.error(sys.exc_value) 
    25112512 
    25122513    def save_data1d(self, data, fname): 
     
    33063307            msg = "%s Could not load " % str(APPLICATION_NAME) 
    33073308            msg += "input file from command line.\n" 
    3308             logging.error(msg) 
     3309            logger.error(msg) 
    33093310        # Display a splash screen on top of the frame. 
    33103311        try: 
     
    33203321            msg = "Cannot display splash screen\n" 
    33213322            msg += str(sys.exc_value) 
    3322             logging.error(msg) 
     3323            logger.error(msg) 
    33233324            self.frame.Show() 
    33243325 
     
    33753376                            os.remove(file_path) 
    33763377                except: 
    3377                     logging.error("gui_manager.clean_plugin_models:\n  %s" 
     3378                    logger.error("gui_manager.clean_plugin_models:\n  %s" 
    33783379                                  % sys.exc_value) 
    33793380 
  • src/sas/sasgui/guiframe/gui_statusbar.py

    r3a22ce7 r463e7ffc  
    1212from sas.sasgui.guiframe.gui_style import GUIFRAME_ICON 
    1313 
     14logger = logging.getLogger(__name__) 
     15 
    1416# Number of fields on the status bar 
    1517NB_FIELDS = 4 
     
    7173            icon_type = event.info.lower() 
    7274            if icon_type == "warning": 
    73                 logging.warning(status) 
     75                logger.warning(status) 
    7476                color = (0, 0, 255) # blue 
    7577                icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_WARNING, 
    7678                                                    wx.ART_TOOLBAR) 
    7779            if icon_type == "error": 
    78                 logging.error(status) 
     80                logger.error(status) 
    7981                color = (255, 0, 0) # red 
    8082                icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_ERROR, 
  • src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py

    ra674d0b r463e7ffc  
    77import wx 
    88import logging 
     9 
     10logger = logging.getLogger(__name__) 
    911 
    1012from sas.sascalc.dataloader.loader import Loader 
     
    160162                message += "\tError: {0}\n".format(error_data) 
    161163        else: 
    162             logging.error("Loader returned an invalid object:\n %s" % str(item)) 
     164            logger.error("Loader returned an invalid object:\n %s" % str(item)) 
    163165            data_error = True 
    164166 
     
    182184                log_msg += "Please try to open that file from \"open project\"" 
    183185                log_msg += "or \"open analysis\" menu." 
    184                 logging.info(log_msg) 
     186                logger.info(log_msg) 
    185187                file_errors[basename] = [log_msg] 
    186188                continue 
     
    212214 
    213215            except: 
    214                 logging.error(sys.exc_value) 
     216                logger.error(sys.exc_value) 
    215217 
    216218                error_message = "The Data file you selected could not be loaded.\n" 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    r9a5097c r9c0f3c17  
    2424from appearanceDialog import appearanceDialog 
    2525from graphAppearance import graphAppearance 
     26 
     27logger = logging.getLogger(__name__) 
    2628 
    2729DEFAULT_QMAX = 0.05 
     
    242244                    wx.PostEvent(self.parent, StatusEvent(status=position)) 
    243245            except: 
    244                 logging.error(sys.exc_value) 
     246                logger.error(sys.exc_value) 
    245247            if not event.leftdown: 
    246248                # text event 
     
    255257                        self.canvas.draw() 
    256258                except: 
    257                     logging.error(sys.exc_value) 
     259                    logger.error(sys.exc_value) 
    258260                event.Skip() 
    259261                return 
     
    409411            self.q_ctrl[vl_ind].SetValue(str(pos_x)) 
    410412        except: 
    411             logging.error(sys.exc_value) 
     413            logger.error(sys.exc_value) 
    412414 
    413415    def set_resizing(self, resizing=False): 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    r9a5097c r9c0f3c17  
    3030from graphAppearance import graphAppearance 
    3131(InternalEvent, EVT_INTERNAL) = wx.lib.newevent.NewEvent() 
     32 
     33logger = logging.getLogger(__name__) 
    3234 
    3335DEFAULT_QMAX = 0.05 
     
    432434            except: 
    433435                msg = "Add Text: Error. Check your property values..." 
    434                 logging.error(msg) 
     436                logger.error(msg) 
    435437                if self.parent != None: 
    436438                    wx.PostEvent(self.parent, StatusEvent(status=msg)) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/binder.py

    rd85c194 r463e7ffc  
    44import logging 
    55import sys 
     6 
     7logger = logging.getLogger(__name__) 
    68 
    79class Selection(object): 
     
    7072            canvas.mpl_disconnect(canvas.scroll_pick_id) 
    7173        except: 
    72             logging.error(sys.exc_value) 
     74            logger.error(sys.exc_value) 
    7375        self.canvas = canvas 
    7476        self.figure = figure 
  • src/sas/sasgui/guiframe/proxy.py

    rd85c194 r463e7ffc  
    66import logging 
    77import re 
     8 
     9 
     10logger = logging.getLogger(__name__) 
    811 
    912''' 
     
    7174        proxy_url_list = [] 
    7275        for this_pac_url in pac_urls_list: 
    73             logging.debug('Trying pac file (%s)...' % this_pac_url) 
     76            logger.debug('Trying pac file (%s)...' % this_pac_url) 
    7477            try: 
    7578                response = urllib2.urlopen( 
    7679                    this_pac_url, timeout=self.timeout) 
    77                 logging.debug('Succeeded (%s)...' % this_pac_url) 
     80                logger.debug('Succeeded (%s)...' % this_pac_url) 
    7881            except Exception: 
    79                 logging.debug('Failled (%s)...' % this_pac_url) 
     82                logger.debug('Failled (%s)...' % this_pac_url) 
    8083                continue 
    8184            pacStr = response.read() 
     
    120123        response = None 
    121124        try: 
    122             logging.debug("Trying Direct connection to %s..."%self.url) 
     125            logger.debug("Trying Direct connection to %s..."%self.url) 
    123126            response = urllib2.urlopen(req, timeout=self.timeout) 
    124127        except Exception, e: 
    125             logging.debug("Failed!") 
    126             logging.debug(e) 
     128            logger.debug("Failed!") 
     129            logger.debug(e) 
    127130            try: 
    128                 logging.debug("Trying to use system proxy if it exists...") 
     131                logger.debug("Trying to use system proxy if it exists...") 
    129132                self._set_proxy() 
    130133                response = urllib2.urlopen(req, timeout=self.timeout) 
    131134            except Exception, e: 
    132                 logging.debug("Failed!") 
    133                 logging.debug(e) 
     135                logger.debug("Failed!") 
     136                logger.debug(e) 
    134137                pac_urls = self._get_addresses_of_proxy_pac() 
    135138                proxy_urls = self._parse_proxy_pac(pac_urls) 
    136139                for proxy in proxy_urls: 
    137140                    try: 
    138                         logging.debug("Trying to use the proxy %s found in proxy.pac configuration"%proxy) 
     141                        logger.debug("Trying to use the proxy %s found in proxy.pac configuration"%proxy) 
    139142                        self._set_proxy(proxy) 
    140143                        response = urllib2.urlopen(req, timeout=self.timeout) 
    141144                    except Exception, e: 
    142                         logging.debug("Failed!") 
    143                         logging.debug(e) 
     145                        logger.debug("Failed!") 
     146                        logger.debug(e) 
    144147        if response is not None: 
    145             logging.debug("The connection to %s was successful."%self.url) 
     148            logger.debug("The connection to %s was successful."%self.url) 
    146149        else: 
    147             logging.warning("Connection to %s failed..."%self.url) 
     150            logger.warning("Connection to %s failed..."%self.url) 
    148151        return response 
    149152 
  • src/sas/sasgui/guiframe/report_dialog.py

    r6dd6e32 r463e7ffc  
    77import sys 
    88import wx.html as html 
     9 
     10logger = logging.getLogger(__name__) 
    911 
    1012ISPDF = False 
     
    135137            return pisaStatus.err 
    136138        except: 
    137             logging.error("Error creating pdf: %s" % sys.exc_value) 
     139            logger.error("Error creating pdf: %s" % sys.exc_value) 
    138140        return False 
    139141 
  • src/sas/sasgui/perspectives/calculator/calculator.py

    ra0c1e1d r463e7ffc  
    2828import logging 
    2929 
     30logger = logging.getLogger(__name__) 
     31 
    3032class Plugin(PluginBase): 
    3133    """ 
     
    3638        PluginBase.__init__(self, name="Calculator") 
    3739        # Log startup 
    38         logging.info("Calculator plug-in started") 
     40        logger.info("Calculator plug-in started") 
    3941        self.sub_menu = "Tool" 
    4042        self.data_edit_frame = None 
  • src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py

    r9a5097c r9c0f3c17  
    3838from sas.sasgui.guiframe.events import NewPlotEvent 
    3939from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     40 
     41logger = logging.getLogger(__name__) 
    4042 
    4143_BOX_WIDTH = 76 
     
    699701                ax = Axes3D(panel.figure) 
    700702            except: 
    701                 logging.error("PlotPanel could not import Axes3D") 
     703                logger.error("PlotPanel could not import Axes3D") 
    702704                raise 
    703705        panel.dimension = 3 
     
    13441346            msg = "OMF Panel: %s" % sys.exc_value 
    13451347            infor = 'Error' 
    1346             #logging.error(msg) 
     1348            #logger.error(msg) 
    13471349            if self.parent.parent != None: 
    13481350                # inform msg to wx 
     
    16961698                msg = "%s cannot write %s\n" % ('Generic Scattering', str(path)) 
    16971699                infor = 'Error' 
    1698                 #logging.error(msg) 
     1700                #logger.error(msg) 
    16991701                if self.parent.parent != None: 
    17001702                    # inform msg to wx 
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    rddbac66 r463e7ffc  
    3232from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
    3333from .pyconsole import show_model_output, check_model 
     34 
     35logger = logging.getLogger(__name__) 
    3436 
    3537 
     
    985987                exec "from %s import Model" % name 
    986988            except: 
    987                 logging.error(sys.exc_value) 
     989                logger.error(sys.exc_value) 
    988990 
    989991        # Prepare the messagebox 
  • src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py

    ra0c1e1d r463e7ffc  
    3434from sas.sasgui.perspectives.calculator import calculator_widgets as widget 
    3535from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     36 
     37logger = logging.getLogger(__name__) 
    3638 
    3739_BOX_WIDTH = 100 
     
    10981100                new_string.append(value) 
    10991101            except: 
    1100                 logging.error(sys.exc_value) 
     1102                logger.error(sys.exc_value) 
    11011103 
    11021104        return new_string 
     
    11401142                        return out 
    11411143                except: 
    1142                     logging.error(sys.exc_value) 
     1144                    logger.error(sys.exc_value) 
    11431145 
    11441146    def _on_xy_coordinate(self, event=None): 
     
    13181320                except: 
    13191321                    # Skip non-data lines 
    1320                     logging.error(sys.exc_value) 
     1322                    logger.error(sys.exc_value) 
    13211323 
    13221324            return [wavelength, intensity] 
  • src/sas/sasgui/perspectives/corfunc/corfunc.py

    r1dc8ec9 r463e7ffc  
    2020from plot_labels import * 
    2121 
     22logger = logging.getLogger(__name__) 
    2223 
    2324class Plugin(PluginBase): 
     
    2930    def __init__(self): 
    3031        PluginBase.__init__(self, name="Correlation Function") 
    31         logging.info("Correlation function plug-in started") 
     32        logger.info("Correlation function plug-in started") 
    3233        self._always_active = True 
    3334        self.state_reader = Reader(self.set_state) 
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    rae9b8bf r463e7ffc  
    1313from sas.sascalc.dataloader.loader import Loader 
    1414 
     15logger = logging.getLogger(__name__) 
     16 
    1517CORNODE_NAME = 'corfunc' 
    1618CANSAS_NS = 'cansas1d/1.0' 
     
    216218                    msg = ("CorfuncState.fromXML: Could not read timestamp", 
    217219                        "\n{}").format(sys.exc_value) 
    218                     logging.error(msg) 
     220                    logger.error(msg) 
    219221 
    220222            # Parse current state 
     
    360362            msg = "XML document does not contain CorfuncState information\n{}" 
    361363            msg.format(sys.exc_value) 
    362             logging.info(msg) 
     364            logger.info(msg) 
    363365        return state 
  • src/sas/sasgui/perspectives/file_converter/file_converter.py

    rba65aff r463e7ffc  
    66from sas.sasgui.guiframe.plugin_base import PluginBase 
    77from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow 
     8 
     9logger = logging.getLogger(__name__) 
    810 
    911class Plugin(PluginBase): 
     
    1517    def __init__(self): 
    1618        PluginBase.__init__(self, name="File Converter") 
    17         logging.info("File Converter plug-in started") 
     19        logger.info("File Converter plug-in started") 
    1820        self._sub_menu = "Tool" 
    1921        self.converter_frame = None 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    red2276f r9c0f3c17  
    3434from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
    3535 
     36logger = logging.getLogger(__name__) 
    3637 
    3738(PageInfoEvent, EVT_PAGE_INFO) = wx.lib.newevent.NewEvent() 
     
    782783                except Exception: 
    783784                    # Skip non-data lines 
    784                     logging.error(traceback.format_exc()) 
     785                    logger.error(traceback.format_exc()) 
    785786            return np.array(angles), np.array(weights) 
    786787        except: 
     
    13041305                    [state.values, state.weights] 
    13051306            except Exception: 
    1306                 logging.error(traceback.format_exc()) 
     1307                logger.error(traceback.format_exc()) 
    13071308            selection = self._find_polyfunc_selection(disp_model) 
    13081309            for list in self.fittable_param: 
     
    13211322                            list[6].Disable() 
    13221323                        except Exception: 
    1323                             logging.error(traceback.format_exc()) 
     1324                            logger.error(traceback.format_exc()) 
    13241325            # For array, disable all fixed params 
    13251326            if selection == 1: 
     
    13301331                            item[2].Disable() 
    13311332                        except Exception: 
    1332                             logging.error(traceback.format_exc()) 
     1333                            logger.error(traceback.format_exc()) 
    13331334 
    13341335    def _selectDlg(self): 
     
    14511452                self.Refresh() 
    14521453 
    1453         # logging.info("is_modified flag set to %g",is_modified) 
     1454        # logger.info("is_modified flag set to %g",is_modified) 
    14541455        return is_modified 
    14551456 
     
    15561557            self.save_current_state() 
    15571558        except Exception: 
    1558             logging.error(traceback.format_exc()) 
     1559            logger.error(traceback.format_exc()) 
    15591560 
    15601561        return flag, is_modified 
     
    23712372                    self.model.set_dispersion(p, disp_model) 
    23722373                except Exception: 
    2373                     logging.error(traceback.format_exc()) 
     2374                    logger.error(traceback.format_exc()) 
    23742375 
    23752376        # save state into 
     
    24862487            self.Refresh() 
    24872488        except Exception: 
    2488             logging.error(traceback.format_exc()) 
     2489            logger.error(traceback.format_exc()) 
    24892490            # Error msg 
    24902491            msg = "Error occurred:" 
     
    25872588                del self.state.model._persistency_dict[name.split('.')[0]] 
    25882589        except Exception: 
    2589             logging.error(traceback.format_exc()) 
     2590            logger.error(traceback.format_exc()) 
    25902591 
    25912592    def _lay_out(self): 
     
    27192720            except Exception: 
    27202721                # Not for control panels 
    2721                 logging.error(traceback.format_exc()) 
     2722                logger.error(traceback.format_exc()) 
    27222723        # Make sure the resduals plot goes to the last 
    27232724        if res_item is not None: 
     
    30523053                    disfunc = str(item[7].GetValue()) 
    30533054            except Exception: 
    3054                 logging.error(traceback.format_exc()) 
     3055                logger.error(traceback.format_exc()) 
    30553056 
    30563057            # 2D 
     
    30953096                        disfunc += ' ' + str(weight) 
    30963097            except Exception: 
    3097                 logging.error(traceback.format_exc()) 
     3098                logger.error(traceback.format_exc()) 
    30983099            content += name + ',' + str(check) + ',' + value + disfunc + ',' + \ 
    30993100                       bound_lo + ',' + bound_hi + ':' 
     
    33663367 
    33673368        except Exception: 
    3368             logging.error(traceback.format_exc()) 
     3369            logger.error(traceback.format_exc()) 
    33693370            print "Error in BasePage._paste_poly_help: %s" % \ 
    33703371                  sys.exc_info()[1] 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    red2276f r9c0f3c17  
    4848 
    4949from . import models 
     50 
     51logger = logging.getLogger(__name__) 
    5052 
    5153MAX_NBR_DATA = 4 
     
    119121        self.page_finder = {} 
    120122        # Log startup 
    121         logging.info("Fitting plug-in started") 
     123        logger.info("Fitting plug-in started") 
    122124        self.batch_capable = self.get_batch_capable() 
    123125 
     
    346348                                page.formfactorbox.SetLabel(current_val) 
    347349        except: 
    348             logging.error("update_custom_combo: %s", sys.exc_value) 
     350            logger.error("update_custom_combo: %s", sys.exc_value) 
    349351 
    350352    def set_edit_menu(self, owner): 
     
    586588                msg = "Fitting: cannot deal with the theory received" 
    587589                evt = StatusEvent(status=msg, info="error") 
    588                 logging.error("set_theory " + msg + "\n" + str(sys.exc_value)) 
     590                logger.error("set_theory " + msg + "\n" + str(sys.exc_value)) 
    589591                wx.PostEvent(self.parent, evt) 
    590592 
     
    17961798        Handle exception from calculator by posting it as an error. 
    17971799        """ 
    1798         logging.error("".join(traceback.format_exception(etype, value, tb))) 
     1800        logger.error("".join(traceback.format_exception(etype, value, tb))) 
    17991801        msg = traceback.format_exception(etype, value, tb, limit=1) 
    18001802        evt = StatusEvent(status="".join(msg), type="stop", info="error") 
  • src/sas/sasgui/perspectives/fitting/models.py

    r11b094f r463e7ffc  
    1818from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    1919from sasmodels.sasview_model import load_custom_model, load_standard_models 
     20 
     21logger = logging.getLogger(__name__) 
    2022 
    2123 
     
    168170    if not os.path.isdir(dir): 
    169171        msg = "SasView couldn't locate Model plugin folder %r." % dir 
    170         logging.warning(msg) 
     172        logger.warning(msg) 
    171173        return {} 
    172174 
    173175    plugin_log("looking for models in: %s" % str(dir)) 
    174176    #compile_file(dir)  #always recompile the folder plugin 
    175     logging.info("plugin model dir: %s" % str(dir)) 
     177    logger.info("plugin model dir: %s" % str(dir)) 
    176178 
    177179    plugins = {} 
     
    188190                msg += "\nwhile accessing model in %r" % path 
    189191                plugin_log(msg) 
    190                 logging.warning("Failed to load plugin %r. See %s for details" 
     192                logger.warning("Failed to load plugin %r. See %s for details" 
    191193                                % (path, PLUGIN_LOG)) 
    192194             
     
    261263        if self.is_changed(): 
    262264            return  _findModels(dir) 
    263         logging.info("plugin model : %s" % str(temp)) 
     265        logger.info("plugin model : %s" % str(temp)) 
    264266        return temp 
    265267 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    red2276f r9c0f3c17  
    3333from sas.sascalc.dataloader.data_info import Data2D, Collimation, Detector 
    3434from sas.sascalc.dataloader.data_info import Process, Aperture 
     35 
     36logger = logging.getLogger(__name__) 
    3537 
    3638# Information to read/write state as xml 
     
    395397                    msg = "Save state does not have enough information to load" 
    396398                    msg += " the all of the data." 
    397                     logging.warning(msg=msg) 
     399                    logger.warning(msg=msg) 
    398400            else: 
    399401                self.formfactorcombobox = FIRST_FORM[self.categorycombobox] 
     
    620622            except Exception: 
    621623                msg = "Report string expected 'name: value' but got %r" % line 
    622                 logging.error(msg) 
     624                logger.error(msg) 
    623625            if name.count("State created"): 
    624626                repo_time = "" + value 
     
    662664                except Exception: 
    663665                    msg = "While parsing 'data: ...'\n" 
    664                     logging.error(msg + traceback.format_exc()) 
     666                    logger.error(msg + traceback.format_exc()) 
    665667            if name == "model name ": 
    666668                try: 
     
    678680                except Exception: 
    679681                    msg = "While parsing 'Plotting Range: ...'\n" 
    680                     logging.error(msg + traceback.format_exc()) 
     682                    logger.error(msg + traceback.format_exc()) 
    681683        paramval = "" 
    682684        for lines in param_string.split(":"): 
     
    10371039                    msg = "PageState.fromXML: Could not" 
    10381040                    msg += " read timestamp\n %s" % sys.exc_value 
    1039                     logging.error(msg) 
     1041                    logger.error(msg) 
    10401042 
    10411043            if entry is not None: 
     
    10771079                            except Exception: 
    10781080                                base = "unable to load distribution %r for %s" 
    1079                                 logging.error(base % (value, parameter)) 
     1081                                logger.error(base % (value, parameter)) 
    10801082                                continue 
    10811083                        _disp_obj_dict = getattr(self, varname) 
     
    10991101                                msg = ("Error reading %r from %s %s\n" 
    11001102                                       % (line, tagname, name)) 
    1101                                 logging.error(msg + traceback.format_exc()) 
     1103                                logger.error(msg + traceback.format_exc()) 
    11021104                        dic[name] = np.array(value_list) 
    11031105                    setattr(self, varname, dic) 
     
    12071209 
    12081210        except: 
    1209             logging.info("XML document does not contain fitting information.\n" 
     1211            logger.info("XML document does not contain fitting information.\n" 
    12101212                         + traceback.format_exc()) 
    12111213 
  • src/sas/sasgui/perspectives/invariant/invariant.py

    rc10d9d6c r463e7ffc  
    2727from sas.sasgui.guiframe.plugin_base import PluginBase 
    2828 
     29logger = logging.getLogger(__name__) 
     30 
    2931class Plugin(PluginBase): 
    3032    """ 
     
    4648 
    4749        # Log startup 
    48         logging.info("Invariant plug-in started") 
     50        logger.info("Invariant plug-in started") 
    4951 
    5052    def get_data(self): 
     
    280282 
    281283        except: 
    282             logging.error("invariant.set_state: %s" % sys.exc_value) 
     284            logger.error("invariant.set_state: %s" % sys.exc_value) 
    283285 
    284286    def on_set_state_helper(self, event=None): 
  • src/sas/sasgui/perspectives/invariant/invariant_panel.py

    r18b7ecb9 r463e7ffc  
    2424from sas.sasgui.guiframe.panel_base import PanelBase 
    2525from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     26 
     27logger = logging.getLogger(__name__) 
    2628 
    2729# The minimum q-value to be used when extrapolating 
     
    460462                self._manager.plot_theory(name="Low-Q extrapolation") 
    461463            except: 
    462                 logging.error(sys.exc_value) 
     464                logger.error(sys.exc_value) 
    463465 
    464466    def get_high_qstar(self, inv, high_q=False): 
     
    494496                self._manager.plot_theory(name="High-Q extrapolation") 
    495497            except: 
    496                 logging.error(sys.exc_value) 
     498                logger.error(sys.exc_value) 
    497499 
    498500    def get_qstar(self, inv): 
     
    845847            attr.SetValue(value) 
    846848        except: 
    847             logging.error("Invariant state: %s", sys.exc_value) 
     849            logger.error("Invariant state: %s", sys.exc_value) 
    848850 
    849851    def get_bookmark_by_num(self, num=None): 
     
    862864            _, _, current_state, comp_state = self.state.bookmark_list[int(num)] 
    863865        except: 
    864             logging.error(sys.exc_value) 
     866            logger.error(sys.exc_value) 
    865867            raise ValueError, "No such bookmark exists" 
    866868 
     
    957959                    self.state.clone_state() 
    958960        except: 
    959             logging.error(sys.exc_value) 
     961            logger.error(sys.exc_value) 
    960962 
    961963        self._set_undo_flag(True) 
     
    10011003                del self.state.state_list[str(i)] 
    10021004            except: 
    1003                 logging.error(sys.exc_value) 
     1005                logger.error(sys.exc_value) 
    10041006        # Enable the undo button if it was not 
    10051007        self._set_undo_flag(True) 
     
    10661068                del self.state.state_list[str(i)] 
    10671069            except: 
    1068                 logging.error(sys.exc_value) 
     1070                logger.error(sys.exc_value) 
    10691071 
    10701072        # try to add new state of the text changes in the state_list 
     
    10811083            self.state.state_list[str(self.state.state_num)] = self.state.clone_state() 
    10821084        except: 
    1083             logging.error(sys.exc_value) 
     1085            logger.error(sys.exc_value) 
    10841086 
    10851087        self._set_undo_flag(True) 
     
    11031105            self.state.state_list[str(self.state.state_num)] = self.state.clone_state() 
    11041106        except: 
    1105             logging.error(sys.exc_value) 
     1107            logger.error(sys.exc_value) 
    11061108 
    11071109    def _get_input_list(self): 
  • src/sas/sasgui/perspectives/invariant/invariant_state.py

    rdb5294e r463e7ffc  
    1616from sas.sasgui.guiframe.gui_style import GUIFRAME_ID 
    1717from sas.sasgui.guiframe.dataFitting import Data1D 
     18 
     19logger = logging.getLogger(__name__) 
    1820 
    1921INVNODE_NAME = 'invariant' 
     
    381383                    msg = "InvariantSate.fromXML: Could not read" 
    382384                    msg += " timestamp\n %s" % sys.exc_value 
    383                     logging.error(msg) 
     385                    logger.error(msg) 
    384386 
    385387            # Parse bookmarks 
     
    694696            msg = "XML document does not contain invariant" 
    695697            msg += " information.\n %s" % sys.exc_value 
    696             logging.info(msg) 
     698            logger.info(msg) 
    697699        return state 
    698700 
  • src/sas/sasgui/perspectives/invariant/report_dialog.py

    rd85c194 r463e7ffc  
    2020 
    2121from sas.sasgui.guiframe.report_dialog import BaseReportDialog 
     22 
     23logger = logging.getLogger(__name__) 
    2224 
    2325class ReportDialog(BaseReportDialog): 
     
    9294                    except: 
    9395                        # DO not open 
    94                         logging.error("Could not open file: %s" % sys.exc_value) 
     96                        logger.error("Could not open file: %s" % sys.exc_value) 
    9597            # delete image file 
    9698            os.remove(pic_fname) 
  • src/sas/sasgui/perspectives/pr/explore_dialog.py

    r9a5097c r9c0f3c17  
    2222import logging 
    2323import sys 
     24 
     25logger = logging.getLogger(__name__) 
    2426 
    2527# Avoid Matplotlib complaining about the lack of legend on the plot 
     
    284286            msg += "a change in the " % str(output_type) 
    285287            msg += "ExploreDialog code." 
    286             logging.error(msg) 
     288            logger.error(msg) 
    287289 
    288290    def __do_layout(self): 
     
    418420                msg = "ExploreDialog: inversion failed " 
    419421                msg += "for D_max=%s\n%s" % (str(d), sys.exc_value) 
    420                 logging.error(msg) 
     422                logger.error(msg) 
    421423 
    422424        self.results = results 
  • src/sas/sasgui/perspectives/pr/inversion_panel.py

    r18b7ecb9 r463e7ffc  
    1717from pr_widgets import OutputTextCtrl 
    1818from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     19 
     20logger = logging.getLogger(__name__) 
    1921 
    2022if sys.platform.count("win32") > 0: 
     
    710712            self.alpha_ctl.SetValue(alpha) 
    711713        except ValueError: 
    712             logging.error("InversionControl._on_accept_alpha got a value that was not a number: %s" % alpha ) 
     714            logger.error("InversionControl._on_accept_alpha got a value that was not a number: %s" % alpha ) 
    713715        except: 
    714716            # No estimate or bad estimate, either do nothing 
    715             logging.error("InversionControl._on_accept_alpha: %s" % sys.exc_value) 
     717            logger.error("InversionControl._on_accept_alpha: %s" % sys.exc_value) 
    716718 
    717719    def _on_accept_nterms(self, evt): 
     
    726728            self.nfunc_ctl.SetValue(nterms) 
    727729        except ValueError: 
    728             logging.error("InversionControl._on_accept_nterms got a value that was not a number: %s" % nterms ) 
     730            logger.error("InversionControl._on_accept_nterms got a value that was not a number: %s" % nterms ) 
    729731        except: 
    730732            # No estimate or bad estimate, either do nothing 
    731             logging.error("InversionControl._on_accept_nterms: %s" % sys.exc_value) 
     733            logger.error("InversionControl._on_accept_nterms: %s" % sys.exc_value) 
    732734 
    733735    def clear_panel(self): 
     
    947949            except: 
    948950                msg = "InversionControl._change_file: %s" % sys.exc_value 
    949                 logging.error(msg) 
     951                logger.error(msg) 
    950952 
    951953    def on_help(self, event): 
  • src/sas/sasgui/perspectives/pr/inversion_state.py

    rd85c194 r463e7ffc  
    2222from sas.sascalc.dataloader.readers.cansas_reader import get_content 
    2323 
     24logger = logging.getLogger(__name__) 
     25 
    2426PRNODE_NAME = 'pr_inversion' 
    2527CANSAS_NS = "cansas1d/1.0" 
     
    250252                    msg = "InversionState.fromXML: Could not read " 
    251253                    msg += "timestamp\n %s" % sys.exc_value 
    252                     logging.error(msg) 
     254                    logger.error(msg) 
    253255 
    254256            # Parse inversion inputs 
     
    306308                        err_msg += "%d %d" % (len(self.coefficients), 
    307309                                              self.nfunc) 
    308                         logging.error(err_msg) 
     310                        logger.error(err_msg) 
    309311                        self.coefficients = None 
    310312 
     
    343345                        err_msg += " covariance matrix: " 
    344346                        err_msg += "%d %d" % (len(self.covariance), self.nfunc) 
    345                         logging.error(err_msg) 
     347                        logger.error(err_msg) 
    346348                        self.covariance = None 
    347349 
     
    430432            msg = "XML document does not contain P(r) " 
    431433            msg += "information.\n %s" % sys.exc_value 
    432             logging.info(msg) 
     434            logger.info(msg) 
    433435 
    434436        return state 
  • src/sas/sasgui/perspectives/pr/pr.py

    r9a5097c r9c0f3c17  
    3434from pr_widgets import load_error 
    3535from sas.sasgui.guiframe.plugin_base import PluginBase 
     36 
     37logger = logging.getLogger(__name__) 
    3638 
    3739 
     
    113115 
    114116        # Log startup 
    115         logging.info("Pr(r) plug-in started") 
     117        logger.info("Pr(r) plug-in started") 
    116118 
    117119    def delete_data(self, data_id): 
     
    181183            self.control_panel.set_state(state) 
    182184        except: 
    183             logging.error("prview.set_state: %s" % sys.exc_value) 
     185            logger.error("prview.set_state: %s" % sys.exc_value) 
    184186 
    185187 
     
    508510                    data_err = np.append(data_err, err) 
    509511                except: 
    510                     logging.error(sys.exc_value) 
     512                    logger.error(sys.exc_value) 
    511513 
    512514        if not scale == None: 
     
    559561                        data_err = np.append(data_err, err) 
    560562                    except: 
    561                         logging.error(sys.exc_value) 
     563                        logger.error(sys.exc_value) 
    562564                elif line.find("The 6 columns") >= 0: 
    563565                    data_started = True 
     
    12011203            dataset = panel.plots[panel.graph.selected_plottable].name 
    12021204        else: 
    1203             logging.info("Prview Error: No data is available") 
     1205            logger.info("Prview Error: No data is available") 
    12041206            return 
    12051207 
     
    12111213        except: 
    12121214            self.control_panel.alpha = self.alpha 
    1213             logging.info("Prview :Alpha Not estimate yet") 
     1215            logger.info("Prview :Alpha Not estimate yet") 
    12141216        try: 
    12151217            estimate = int(self.control_panel.nterms_estimate) 
     
    12171219        except: 
    12181220            self.control_panel.nfunc = self.nfunc 
    1219             logging.info("Prview : ntemrs Not estimate yet") 
     1221            logger.info("Prview : ntemrs Not estimate yet") 
    12201222 
    12211223        self.current_plottable = panel.plots[panel.graph.selected_plottable] 
  • src/sas/sasgui/perspectives/simulation/simulation.py

    r9a5097c r9c0f3c17  
    2424from sas.sascalc.data_util.calcthread import CalcThread 
    2525from sas.guicomm.events import NewPlotEvent, StatusEvent     
     26 
     27logger = logging.getLogger(__name__) 
    2628 
    2729class Calc1D(CalcThread): 
     
    9395        self._default_save_location = os.getcwd() 
    9496        # Log startup 
    95         logging.info("Simulation plug-in started") 
     97        logger.info("Simulation plug-in started") 
    9698         
    9799    def get_panels(self, parent): 
  • src/sas/sasgui/plottools/PlotPanel.py

    r9a5097c r9c0f3c17  
    3333from sas.sasgui.guiframe.events import StatusEvent 
    3434from .toolbar import NavigationToolBar, PlotPrintout, bind 
     35 
     36logger = logging.getLogger(__name__) 
    3537 
    3638def show_tree(obj, d=0): 
     
    15061508                    from mpl_toolkits.mplot3d import Axes3D 
    15071509                except: 
    1508                     logging.error("PlotPanel could not import Axes3D") 
     1510                    logger.error("PlotPanel could not import Axes3D") 
    15091511                self.subplot.figure.clear() 
    15101512                ax = Axes3D(self.subplot.figure) 
  • src/sas/sasgui/plottools/binder.py

    rd7bb526 r463e7ffc  
    44import sys 
    55import logging 
     6 
     7logger = logging.getLogger(__name__) 
    68 
    79class Selection(object): 
     
    121123            for cid in self._connections: self.canvas.mpl_disconnect(cid) 
    122124        except: 
    123             logging.error("Error disconnection canvas: %s" % sys.exc_value) 
     125            logger.error("Error disconnection canvas: %s" % sys.exc_value) 
    124126        self._connections = [] 
    125127 
  • src/sas/sasgui/plottools/canvas.py

    rd7bb526 r463e7ffc  
    1111from matplotlib.backends.backend_wx import RendererWx 
    1212 
     13logger = logging.getLogger(__name__) 
     14 
    1315 
    1416def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): 
     
    9698            dc.DrawBitmap(self.canvas.bitmap, (0, 0)) 
    9799        except: 
    98             logging.error(sys.exc_value) 
     100            logger.error(sys.exc_value) 
    99101 
    100102    # restore original figure  resolution 
     
    207209                fig.draw(self) 
    208210            except ValueError: 
    209                 logging.error(sys.exc_value) 
     211                logger.error(sys.exc_value) 
    210212        else: 
    211213            self._isRendered = False 
  • src/sas/sasgui/plottools/plottables.py

    r9a5097c r9c0f3c17  
    4646import sys 
    4747import logging 
     48 
     49logger = logging.getLogger(__name__) 
    4850 
    4951if 'any' not in dir(__builtins__): 
     
    808810                        tempdy.append(self.dy[i]) 
    809811                except: 
    810                     logging.error("check_data_logX: skipping point x %g", self.x[i]) 
    811                     logging.error(sys.exc_value) 
     812                    logger.error("check_data_logX: skipping point x %g", self.x[i]) 
     813                    logger.error(sys.exc_value) 
    812814            self.x = tempx 
    813815            self.y = tempy 
     
    838840                        tempdy.append(self.dy[i]) 
    839841                except: 
    840                     logging.error("check_data_logY: skipping point %g", self.y[i]) 
    841                     logging.error(sys.exc_value) 
     842                    logger.error("check_data_logY: skipping point %g", self.y[i]) 
     843                    logger.error(sys.exc_value) 
    842844 
    843845            self.x = tempx 
  • src/sas/sasgui/plottools/toolbar.py

    rd7bb526 r463e7ffc  
    66from matplotlib.backends.backend_wx import _load_bitmap 
    77import logging 
     8 
     9logger = logging.getLogger(__name__) 
    810 
    911# Event binding code changed after version 2.5 
     
    9496            self._parent.onToolContextMenu(event=event) 
    9597        except: 
    96             logging.error("Plot toolbar could not show menu") 
     98            logger.error("Plot toolbar could not show menu") 
    9799 
    98100    def context_menu(self, event): 
     
    122124        except: 
    123125            import traceback 
    124             logging.error(traceback.format_exc()) 
     126            logger.error(traceback.format_exc()) 
    125127 
    126128    def copy_figure(self, event): 
  • src/sas/sasgui/guiframe/media/data_formats_help.rst

    r48b8f6d r98c44f3  
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    55.. WG Bouwman, DUT, added during CodeCamp-V in Oct 2016 the SESANS data format 
     6.. WG Bouwman, DUT, updated during CodeCamp-VI in Apr 2017 the SESANS data format 
    67 
    78.. _Formats: 
     
    8283The file format has a list of name-value pairs at the top of the file which detail the general experimental parameters necessary for fitting and analyzing data. This list should contain all the information necessary for the file to be 'portable' between users. 
    8384 
    84 Following the header is a 6 column list of instrument experimental variables: 
     85Following the header is a 8 (only the first 4 are really needed) column list of instrument experimental variables: 
    8586 
    8687- Spin echo length (z, in Angstroms) 
     88- depolarization (:math:`log(P/P_0)/(lambda^2 * thickness)`, in Angstrom^-1 cm^-1) 
     89- depolarization error in the same unit) (measurement error) 
    8790- Spin echo length error (:math:`\Delta`\ z, in Angstroms) (experimental resolution) 
    88 - Neutron wavelength (:math:`\lambda`, in Angstroms) (essential for ToF instruments) 
     91- Neutron wavelength (:math:`\lambda`, in Angstroms) 
    8992- Neutron wavelength error (:math:`\Delta \lambda`, in Angstroms) 
    9093- Normalized polarization (:math:`P/P_0`, unitless) 
     
    9396.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    9497 
    95 .. note::  This help document was last changed by Steve King, 07Oct2016 
     98.. note::  This help document was last changed by Wim Bouwman, 05Apr2017 
Note: See TracChangeset for help on using the changeset viewer.