Index: src/sas/sasgui/guiframe/gui_manager.py
===================================================================
--- src/sas/sasgui/guiframe/gui_manager.py	(revision a4c24459af9d908f923d5abb9809c6744530b90c)
+++ src/sas/sasgui/guiframe/gui_manager.py	(revision c8e19964f2dda929ccae8237e7b140a906cdf134)
@@ -3,11 +3,11 @@
 """
 ################################################################################
-#This software was developed by the University of Tennessee as part of the
-#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
-#project funded by the US National Science Foundation.
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
 #
-#See the license text in license.txtz
+# See the license text in license.txtz
 #
-#copyright 2008, University of Tennessee
+# copyright 2008, University of Tennessee
 ################################################################################
 
@@ -21,5 +21,4 @@
 import warnings
 import re
-warnings.simplefilter("ignore")
 import logging
 import httplib
@@ -49,4 +48,6 @@
 from matplotlib import _pylab_helpers
 
+warnings.simplefilter("ignore")
+
 
 def get_app_dir():
@@ -82,4 +83,5 @@
     return app_path
 
+
 def get_user_directory():
     """
@@ -90,4 +92,5 @@
         os.makedirs(userdir)
     return userdir
+
 
 def _find_local_config(file, path):
@@ -113,5 +116,5 @@
 
 # GUI always starts from the App folder
-#os.chdir(PATH_APP)
+# os.chdir(PATH_APP)
 # Read in the local config, which can either be with the main
 # application or in the installation directory
@@ -128,5 +131,5 @@
     logging.info("found local_config in %s" % PATH_APP)
 
-from sas.sasgui.guiframe.customdir  import SetupCustom
+from sas.sasgui.guiframe.customdir import SetupCustom
 c_conf_dir = SetupCustom().setup_dir(PATH_APP)
 custom_config = _find_local_config('custom_config', c_conf_dir)
@@ -141,5 +144,5 @@
     logging.info("using custom_config from %s" % c_conf_dir)
 
-#read some constants from config
+# read some constants from config
 APPLICATION_STATE_EXTENSION = config.APPLICATION_STATE_EXTENSION
 APPLICATION_NAME = config.__appname__
@@ -169,5 +172,5 @@
     # custom open_path
     open_folder = custom_config.DEFAULT_OPEN_FOLDER
-    if open_folder != None and os.path.isdir(open_folder):
+    if open_folder is not None and os.path.isdir(open_folder):
         DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder)
     else:
@@ -222,4 +225,5 @@
         CHILD_FRAME = wx.Frame
 
+
 class ViewerFrame(PARENT_FRAME):
     """
@@ -235,5 +239,6 @@
         Initialize the Frame object
         """
-        PARENT_FRAME.__init__(self, parent=parent, title=title, pos=pos, size=size)
+        PARENT_FRAME.__init__(self, parent=parent, title=title,
+                              pos=pos, size=size)
         # title
         self.title = title
@@ -256,13 +261,13 @@
         self.path = PATH_APP
         self.application_name = APPLICATION_NAME
-        ## Application manager
+        # Application manager
         self._input_file = None
         self.app_manager = None
         self._mgr = None
-        #add current perpsective
+        # add current perpsective
         self._current_perspective = None
         self._plotting_plugin = None
         self._data_plugin = None
-        #Menu bar and item
+        # Menu bar and item
         self._menubar = None
         self._file_menu = None
@@ -278,5 +283,5 @@
         self._toolbar_menu = None
         self._save_appl_menu = None
-        #tool bar
+        # tool bar
         self._toolbar = None
         # Status bar
@@ -286,11 +291,11 @@
         # plot duck cleanup option
         self.cleanup_plots = CLEANUP_PLOT
-        ## Find plug-ins
+        # Find plug-ins
         # Modify this so that we can specify the directory to look into
         self.plugins = []
-        #add local plugin
+        # add local plugin
         self.plugins += self._get_local_plugins()
         self.plugins += self._find_plugins()
-        ## List of panels
+        # List of panels
         self.panels = {}
         # List of plot panels
@@ -304,20 +309,21 @@
         self.defaultPanel = None
         self.welcome_panel_class = None
-        #panel on focus
+        # panel on focus
         self.panel_on_focus = None
-        #control_panel on focus
+        # control_panel on focus
         self.cpanel_on_focus = None
 
         self.loader = Loader()
-        #data manager
+        # data manager
         self.batch_on = False
         from sas.sasgui.guiframe.data_manager import DataManager
         self._data_manager = DataManager()
-        self._data_panel = None#DataPanel(parent=self)
+        self._data_panel = None  # DataPanel(parent=self)
         if self.panel_on_focus is not None:
-            self._data_panel.set_panel_on_focus(self.panel_on_focus.window_caption)
+            self._data_panel.set_panel_on_focus(
+                self.panel_on_focus.window_caption)
         # list of plot panels in schedule to full redraw
         self.schedule = False
-        #self.callback = True
+        # self.callback = True
         self._idle_count = 0
         self.schedule_full_draw_list = []
@@ -333,5 +339,5 @@
         # Register to status events
         self.Bind(EVT_STATUS, self._on_status_event)
-        #Register add extra data on the same panel event on load
+        # Register add extra data on the same panel event on load
         self.Bind(EVT_PANEL_ON_FOCUS, self.set_panel_on_focus)
         self.Bind(EVT_APPEND_BOOKMARK, self.append_bookmark)
@@ -373,5 +379,5 @@
         # Adjust toolbar height
         toolbar = self.GetToolBar()
-        if toolbar != None:
+        if toolbar is not None:
             _, tb_h = toolbar.GetSizeTuple()
             height -= tb_h
@@ -386,5 +392,5 @@
                     fitpanel = item.fit_panel
 
-        if fitpanel != None:
+        if fitpanel is not None:
             for i in range(0, fitpanel.GetPageCount()):
                 fitpanel.GetPage(i)._populate_listbox()
@@ -413,5 +419,8 @@
         """
         Display value of data into the application grid
-        :param data: dictionary of string and list of items
+        :param data_inputs: dictionary of string and list of items
+        :param details: descriptive string
+        :param file_name: file name
+        :param data_outputs: Data outputs
         """
         self.batch_frame.set_data(data_inputs=data_inputs,
@@ -427,5 +436,5 @@
         """
         path = None
-        if self._default_save_location == None:
+        if self._default_save_location is None:
             self._default_save_location = os.getcwd()
         wildcard = "(*.csv; *.txt)|*.csv; *.txt"
@@ -469,7 +478,7 @@
             line.strip()
             count = 0
-            if separator == None:
+            if separator is None:
                 line.replace('\t', ' ')
-                #found the first line containing the label
+                # found the first line containing the label
                 col_name_toks = line.split()
                 for item in col_name_toks:
@@ -480,5 +489,5 @@
             elif line.find(separator) != -1:
                 if line.count(separator) >= 2:
-                    #found the first line containing the label
+                    # found the first line containing the label
                     col_name_toks = line.split(separator)
                     for item in col_name_toks:
@@ -534,5 +543,5 @@
             separator = ","
         fd.write(str(details))
-        for col_name  in data.keys():
+        for col_name in data.keys():
             fd.write(str(col_name))
             fd.write(separator)
@@ -597,5 +606,5 @@
         Set up custom configuration if exists
         """
-        if custom_config == None:
+        if custom_config is None:
             return
 
@@ -617,5 +626,5 @@
         Set default starting perspective
         """
-        if custom_config == None:
+        if custom_config is None:
             return
         for plugin in self.plugins:
@@ -626,5 +635,5 @@
                     frame = plugin.get_frame()
                     frame.Show(True)
-                    #break
+                    # break
                 else:
                     frame = plugin.get_frame()
@@ -683,5 +692,5 @@
             try:
                 flag = self.panel_on_focus.get_save_flag()
-                if self._save_appl_menu != None:
+                if self._save_appl_menu is not None:
                     self._save_appl_menu.Enable(flag)
 
@@ -694,7 +703,7 @@
                                 self.panel_on_focus is not None:
                     self.set_panel_on_focus_helper()
-                    #update toolbar
+                    # update toolbar
                     self._update_toolbar_helper()
-                    #update edit menu
+                    # update edit menu
                     self.enable_edit_menu()
             except wx._core.PyDeadObjectError:
@@ -711,5 +720,5 @@
         Send focusing on ID to data explorer
         """
-        if self._data_panel != None:
+        if self._data_panel is not None:
             self._data_panel.set_panel_on_focus(name)
 
@@ -720,5 +729,5 @@
         caption = self.panel_on_focus.window_caption
         self.send_focus_to_datapanel(caption)
-        #update combo
+        # update combo
         if self.panel_on_focus in self.plot_panels.values():
             combo = self._data_panel.cb_plotpanel
@@ -739,6 +748,6 @@
         """
         cpanel = panel
-        if self._toolbar != None and cpanel._bookmark_flag:
-            for item in  self._toolbar.get_bookmark_items():
+        if self._toolbar is not None and cpanel._bookmark_flag:
+            for item in self._toolbar.get_bookmark_items():
                 self._toolbar.remove_bookmark_item(item)
             self._toolbar.add_bookmark_default()
@@ -841,5 +850,6 @@
         field = self.sb.get_msg_position()
         wx.Frame.PushStatusText(self, field=field,
-                                string="FIXME - PushStatusText called without text")
+                                string=
+                                "FIXME - PushStatusText called without text")
 
     def add_perspective(self, plugin):
@@ -866,11 +876,12 @@
         """
         plugins = []
-        #import guiframe local plugins
-        #check if the style contain guiframe.dataloader
+        # import guiframe local plugins
+        # check if the style contain guiframe.dataloader
         style1 = self.__gui_style & GUIFRAME.DATALOADER_ON
         style2 = self.__gui_style & GUIFRAME.PLOTTING_ON
         if style1 == GUIFRAME.DATALOADER_ON:
             try:
-                from sas.sasgui.guiframe.local_perspectives.data_loader import data_loader
+                from sas.sasgui.guiframe.local_perspectives.data_loader \
+                    import data_loader
                 self._data_plugin = data_loader.Plugin()
                 plugins.append(self._data_plugin)
@@ -881,5 +892,6 @@
         if style2 == GUIFRAME.PLOTTING_ON:
             try:
-                from sas.sasgui.guiframe.local_perspectives.plotting import plotting
+                from sas.sasgui.guiframe.local_perspectives.plotting \
+                    import plotting
                 self._plotting_plugin = plotting.Plugin()
                 plugins.append(self._plotting_plugin)
@@ -907,5 +919,5 @@
             else:
                 file_list = []
-            ## the default panel is the panel is the last plugin added
+            # the default panel is the panel is the last plugin added
             for item in file_list:
                 toks = os.path.splitext(os.path.basename(item))
@@ -914,6 +926,6 @@
                     if toks[1] == '.py' or toks[1] == '':
                         name = toks[0]
-                    #check the validity of the module name parsed
-                    #before trying to import it
+                    # check the validity of the module name parsed
+                    # before trying to import it
                     if name is None or name.strip() == '':
                         continue
@@ -941,5 +953,5 @@
                         logging.error(msg)
                     finally:
-                        if not file == None:
+                        if file is not None:
                             file.close()
         except:
@@ -956,5 +968,5 @@
         """
         self._window_width, self._window_height = self.get_client_size()
-        ## Default size
+        # Default size
         if DATAPANEL_WIDTH < 0:
             panel_width = int(self._window_width * 0.25)
@@ -962,5 +974,5 @@
             panel_width = DATAPANEL_WIDTH
         panel_height = int(self._window_height)
-        if self._data_panel is not None  and (p == self._data_panel):
+        if self._data_panel is not None and (p == self._data_panel):
             return panel_width, panel_height
         if hasattr(p, "CENTER_PANE") and p.CENTER_PANE:
@@ -994,5 +1006,6 @@
         if self.welcome_panel_class is not None:
             welcome_panel = MDIFrame(self, None, 'None', (100, 200))
-            self.defaultPanel = self.welcome_panel_class(welcome_panel, -1, style=wx.RAISED_BORDER)
+            self.defaultPanel = self.welcome_panel_class(welcome_panel, -1,
+                                                         style=wx.RAISED_BORDER)
             welcome_panel.set_panel(self.defaultPanel)
             self.defaultPanel.set_frame(welcome_panel)
@@ -1010,5 +1023,5 @@
                 frame.SetPosition((0, mac_pos_y + size_t_bar))
             frame.Show(True)
-        #add data panel
+        # add data panel
         win = MDIFrame(self, None, 'None', (100, 200))
         data_panel = DataPanel(parent=win, id=-1)
@@ -1018,5 +1031,6 @@
         d_panel_width, h = self._get_panels_size(self._data_panel)
         win.SetSize((d_panel_width, h))
-        is_visible = self.__gui_style & GUIFRAME.MANAGER_ON == GUIFRAME.MANAGER_ON
+        is_visible = self.__gui_style & \
+                     GUIFRAME.MANAGER_ON == GUIFRAME.MANAGER_ON
         if IS_WIN:
             win.SetPosition((0, 0))
@@ -1064,5 +1078,5 @@
         Update the data.
         """
-        prev_id, data_state = self._data_manager.update_data( \
+        prev_id, data_state = self._data_manager.update_data(
                               prev_data=prev_data, new_data=new_data)
 
@@ -1115,5 +1129,4 @@
         self._current_perspective.delete_data(data)
 
-
     def get_context_menu(self, plotpanel=None):
         """
@@ -1139,5 +1152,5 @@
         menu_list = []
         item = self._current_perspective
-        if item != None:
+        if item is not None:
             menu_list.extend(item.get_context_menu(plotpanel=plotpanel))
         return menu_list
@@ -1158,5 +1171,4 @@
             self.cpanel_on_focus.SetFocus()
 
-
     def popup_panel(self, p):
         """
@@ -1170,5 +1182,5 @@
         ID = wx.NewId()
         self.panels[str(ID)] = p
-        ## Check and set the size
+        # Check and set the size
         if PLOPANEL_WIDTH < 0:
             p_panel_width = int(self._window_width * 0.45)
@@ -1209,5 +1221,5 @@
         # Register for showing/hiding the panel
         wx.EVT_MENU(self, ID, self.on_view)
-        if p not in self.plot_panels.values() and p.group_id != None:
+        if p not in self.plot_panels.values() and p.group_id is not None:
             self.plot_panels[ID] = p
             if len(self.plot_panels) == 1:
@@ -1215,5 +1227,5 @@
                 self.set_panel_on_focus(None)
             if self._data_panel is not None and \
-                self._plotting_plugin is not None:
+                            self._plotting_plugin is not None:
                 ind = self._data_panel.cb_plotpanel.FindString('None')
                 if ind != wx.NOT_FOUND:
@@ -1258,5 +1270,5 @@
         panel_name = 'No Panel on Focus'
         c_panel = self.cpanel_on_focus
-        if self._toolbar is  None:
+        if self._toolbar is None:
             return
         if c_panel is not None:
@@ -1303,7 +1315,7 @@
         """
         if self._menubar is None or self._current_perspective is None \
-            or self._menubar.GetMenuCount() == 0:
+                or self._menubar.GetMenuCount() == 0:
             return
-        #replace or add a new menu for the current plugin
+        # replace or add a new menu for the current plugin
         pos = self._menubar.FindMenu(str(self._applications_menu_name))
         if pos == -1 and self._applications_menu_pos > 0:
@@ -1325,5 +1337,5 @@
                 for (menu, name) in menu_list:
                     if self._applications_menu_pos == -1:
-                        # Find the Analysis position and insert just after it if possible
+                        # Find the Analysis position and insert just after it
                         analysis_pos = self._menubar.FindMenu("Analysis")
                         if analysis_pos == -1:
@@ -1334,5 +1346,6 @@
                             self._applications_menu_pos = analysis_pos + 1
                     else:
-                        self._menubar.Insert(self._applications_menu_pos, menu, name)
+                        self._menubar.Insert(self._applications_menu_pos,
+                                             menu, name)
                     self._applications_menu_name = name
 
@@ -1362,5 +1375,6 @@
         if config._do_acknowledge:
             wx_id = wx.NewId()
-            self._help_menu.Append(wx_id, '&Acknowledge', 'Acknowledging SasView')
+            self._help_menu.Append(wx_id, '&Acknowledge',
+                                   'Acknowledging SasView')
             wx.EVT_MENU(self, wx_id, self._onAcknowledge)
 
@@ -1379,5 +1393,6 @@
         wx_id = wx.NewId()
         self._help_menu.Append(wx_id, '&Check for update',
-                               'Check for the latest version of %s' % config.__appname__)
+                               'Check for the latest version of %s' %
+                               config.__appname__)
         wx.EVT_MENU(self, wx_id, self._check_update)
         self._menubar.Append(self._help_menu, '&Help')
@@ -1400,5 +1415,6 @@
         wx_id = wx.NewId()
         self._data_panel_menu = self._view_menu.Append(wx_id,
-                                                       '&Show Data Explorer', '')
+                                                       '&Show Data Explorer',
+                                                       '')
         wx.EVT_MENU(self, wx_id, self.show_data_panel)
         if style == GUIFRAME.MANAGER_ON:
@@ -1411,10 +1427,12 @@
         style1 = self.__gui_style & GUIFRAME.TOOLBAR_ON
         if style1 == GUIFRAME.TOOLBAR_ON:
-            self._toolbar_menu = self._view_menu.Append(wx_id, '&Hide Toolbar', '')
+            self._toolbar_menu = self._view_menu.Append(wx_id, '&Hide Toolbar',
+                                                        '')
         else:
-            self._toolbar_menu = self._view_menu.Append(wx_id, '&Show Toolbar', '')
+            self._toolbar_menu = self._view_menu.Append(wx_id, '&Show Toolbar',
+                                                        '')
         wx.EVT_MENU(self, wx_id, self._on_toggle_toolbar)
 
-        if custom_config != None:
+        if custom_config is not None:
             self._view_menu.AppendSeparator()
             wx_id = wx.NewId()
@@ -1427,5 +1445,6 @@
         wx_id = wx.NewId()
         self._view_menu.AppendSeparator()
-        self._view_menu.Append(wx_id, 'Category Manager', 'Edit model categories')
+        self._view_menu.Append(wx_id, 'Category Manager',
+                               'Edit model categories')
         wx.EVT_MENU(self, wx_id, self._on_category_manager)
 
@@ -1440,5 +1459,5 @@
         self.batch_frame.Show(True)
 
-    def  on_category_panel(self, event):
+    def on_category_panel(self, event):
         """
         On cat panel
@@ -1459,5 +1478,5 @@
         """
         from sas.sasgui.guiframe.startup_configuration \
-        import StartupConfiguration as ConfDialog
+            import StartupConfiguration as ConfDialog
 
         dialog = ConfDialog(parent=self, gui=self.__gui_style)
@@ -1466,5 +1485,6 @@
             dialog.write_custom_config()
             # post event for info
-            wx.PostEvent(self, StatusEvent(status="Wrote custom configuration", info='info'))
+            wx.PostEvent(self, StatusEvent(status="Wrote custom configuration",
+                                           info='info'))
         dialog.Destroy()
 
@@ -1485,11 +1505,13 @@
                     id = wx.NewId()
                     if plug.use_data():
-                        self._applications_menu.InsertCheckItem(pos, id, plug.sub_menu, \
-                            "Switch to analysis: %s" % plug.sub_menu)
+                        self._applications_menu.InsertCheckItem(pos, id,
+                                                                plug.sub_menu,
+                                    "Switch to analysis: %s" % plug.sub_menu)
                         plug_data_count = True
                         pos += 1
                     else:
                         plug_no_data_count = True
-                        self._applications_menu.AppendCheckItem(id, plug.sub_menu, \
+                        self._applications_menu.AppendCheckItem(id,
+                                                                plug.sub_menu,
                             "Switch to analysis: %s" % plug.sub_menu)
                     wx.EVT_MENU(self, id, plug.on_perspective)
@@ -1497,14 +1519,14 @@
             if not plug_data_count or not plug_no_data_count:
                 self._applications_menu.RemoveItem(separator)
-            #Windows introduces a "Window" menu item during the layout process
-            #somehow.  We want it to be next to the last item with Help as
-            #last. However Analysis gets stuck after Window in normal ordering
-            #so force it to be next after the Tools menu item.  Should we add
-            #another menu item will need to check if this is still where we 
-            #want Analysis.  This is NOT an issue on the Mac which does not
-            #have the extra Window menu item.
+            # Windows introduces a "Window" menu item during the layout process
+            # somehow.  We want it to be next to the last item with Help as
+            # last. However Analysis gets stuck after Window in normal ordering
+            # so force it to be next after the Tools menu item.  Should we add
+            # another menu item will need to check if this is still where we
+            # want Analysis.  This is NOT an issue on the Mac which does not
+            # have the extra Window menu item.
             #      March 2016 Code Camp  -- PDB 
             Tools_pos = self._menubar.FindMenu("Tools")
-            self._menubar.Insert(Tools_pos+1,self._applications_menu,
+            self._menubar.Insert(Tools_pos+1, self._applications_menu,
                                  '&Analysis')
             self._check_applications_menu()
@@ -1527,5 +1549,7 @@
             wx_id = wx.NewId()
             hint_load_file = "read all analysis states saved previously"
-            self._save_appl_menu = self._file_menu.Append(wx_id, '&Open Project', hint_load_file)
+            self._save_appl_menu = self._file_menu.Append(wx_id,
+                                                          '&Open Project',
+                                                          hint_load_file)
             wx.EVT_MENU(self, wx_id, self._on_open_state_project)
 
@@ -1536,5 +1560,6 @@
             wx_id = wx.NewId()
             self._save_appl_menu = self._file_menu.Append(wx_id,
-                                                          '&Open Analysis', hint_load_file)
+                                                          '&Open Analysis',
+                                                          hint_load_file)
             wx.EVT_MENU(self, wx_id, self._on_open_state_application)
         if OPEN_SAVE_MENU:
@@ -1546,6 +1571,7 @@
         if style1 == GUIFRAME.MULTIPLE_APPLICATIONS:
             wx_id = wx.NewId()
-            self._save_appl_menu = self._file_menu.Append(wx_id, \
-                '&Save Analysis', 'Save state of the current active analysis panel')
+            txt = '&Save Analysis'
+            txt2 = 'Save state of the current active analysis panel'
+            self._save_appl_menu = self._file_menu.Append(wx_id, txt, txt2)
             wx.EVT_MENU(self, wx_id, self._on_save_application)
         if not sys.platform == 'darwin':
@@ -1589,13 +1615,14 @@
 
         self._edit_menu_copyas = wx.Menu()
-        #Sub menu for Copy As...
-        self._edit_menu_copyas.Append(GUIFRAME_ID.COPYEX_ID, 'Copy current tab to Excel',
+        # Sub menu for Copy As...
+        self._edit_menu_copyas.Append(GUIFRAME_ID.COPYEX_ID,
+                                      'Copy current tab to Excel',
                                       'Copy parameter values in tabular format')
         wx.EVT_MENU(self, GUIFRAME_ID.COPYEX_ID, self.on_copy_panel)
 
-        self._edit_menu_copyas.Append(GUIFRAME_ID.COPYLAT_ID, 'Copy current tab to LaTeX',
+        self._edit_menu_copyas.Append(GUIFRAME_ID.COPYLAT_ID,
+                                      'Copy current tab to LaTeX',
                                       'Copy parameter values in tabular format')
         wx.EVT_MENU(self, GUIFRAME_ID.COPYLAT_ID, self.on_copy_panel)
-
 
         self._edit_menu.AppendMenu(GUIFRAME_ID.COPYAS_ID, 'Copy Params as...',
@@ -1620,5 +1647,5 @@
         Return the gui style
         """
-        return  self.__gui_style
+        return self.__gui_style
 
     def _add_menu_data(self):
@@ -1675,5 +1702,5 @@
             return
         frame = self.panels['default'].get_frame()
-        if frame == None:
+        if frame is None:
             return
         # Show default panel
@@ -1708,5 +1735,5 @@
                 self.schedule_full_draw_list.remove(panel)
 
-            #delete uid number not str(uid)
+            # delete uid number not str(uid)
             if ID in self.plot_panels.keys():
                 del self.plot_panels[ID]
@@ -1734,9 +1761,9 @@
             return
 
-        #reading a state file
+        # reading a state file
         for plug in self.plugins:
             reader, ext = plug.get_extensions()
             if reader is not None:
-                #read the state of the single plugin
+                # read the state of the single plugin
                 if extension == ext:
                     reader.read(path)
@@ -1749,5 +1776,6 @@
                         msg += "\n(%s)" % sys.exc_value
                         wx.PostEvent(self, StatusEvent(status=msg,
-                                                       info="error", type="stop"))
+                                                       info="error",
+                                                       type="stop"))
                         return
 
@@ -1788,5 +1816,5 @@
             basename = os.path.basename(path)
             if APPLICATION_STATE_EXTENSION is not None \
-                and basename.endswith(APPLICATION_STATE_EXTENSION):
+                    and basename.endswith(APPLICATION_STATE_EXTENSION):
                 if is_project:
                     for ID in self.plot_panels.keys():
@@ -1858,5 +1886,5 @@
         """
         path = None
-        if self._default_save_location == None:
+        if self._default_save_location is None:
             self._default_save_location = os.getcwd()
         wx.PostEvent(self, StatusEvent(status="Loading Analysis file..."))
@@ -1892,5 +1920,5 @@
                     break
             # Found the extension
-            if ind != None:
+            if ind is not None:
                 plug_wlist.remove(ind)
                 plug_wlist.insert(0, ind)
@@ -1910,20 +1938,22 @@
         """
         path = None
-        if self._default_save_location == None:
+        if self._default_save_location is None:
             self._default_save_location = os.getcwd()
         msg = "This operation will set remove all data, plots and analyses from"
         msg += " SasView before loading the project. Do you wish to continue?"
-        self._data_panel.selection_cbox.SetValue('Select all Data')
-        self._data_panel._on_selection_type(None)
-        for _, theory_dict in self._data_panel.list_cb_theory.iteritems():
-            for  key, value in theory_dict.iteritems():
-                item, _, _ = value
-                item.Check(True)
-        if not self._data_panel.on_remove(None, msg):
+        msg_box = wx.MessageDialog(None, msg, 'Warning', wx.OK | wx.CANCEL)
+        if msg_box.ShowModal() == wx.ID_OK:
+            self._data_panel.selection_cbox.SetValue('Select all Data')
+            self._data_panel._on_selection_type(None)
+            for _, theory_dict in self._data_panel.list_cb_theory.iteritems():
+                for key, value in theory_dict.iteritems():
+                    item, _, _ = value
+                    item.Check(True)
+            self._data_panel.on_remove(None, False)
+
             wx.PostEvent(self, StatusEvent(status="Loading Project file..."))
-            dlg = wx.FileDialog(self,
-                            "Choose a file",
-                            self._default_save_location, "",
-                            APPLICATION_WLIST)
+            dlg = wx.FileDialog(self, "Choose a file",
+                                self._default_save_location, "",
+                                APPLICATION_WLIST)
             if dlg.ShowModal() == wx.ID_OK:
                 path = dlg.GetPath()
@@ -1969,5 +1999,5 @@
         save the state of the SasView as *.svs
         """
-        if self._current_perspective is  None:
+        if self._current_perspective is None:
             return
         wx.PostEvent(self, StatusEvent(status="Saving Project file..."))
@@ -1997,5 +2027,5 @@
             extens = APPLICATION_STATE_EXTENSION
             fName = os.path.splitext(path)[0] + extens
-            if doc != None:
+            if doc is not None:
                 fd = open(fName, 'w')
                 fd.write(doc.toprettyxml())
@@ -2029,5 +2059,5 @@
                     if data is not None:
                         new_doc = reader.write_toXML(data, state)
-                        if doc != None and hasattr(doc, "firstChild"):
+                        if doc is not None and hasattr(doc, "firstChild"):
                             child = new_doc.firstChild.firstChild
                             doc.firstChild.appendChild(child)
@@ -2040,5 +2070,5 @@
                 if data is not None:
                     new_doc = reader.write_toXML(data, state)
-                    if doc != None and hasattr(doc, "firstChild"):
+                    if doc is not None and hasattr(doc, "firstChild"):
                         child = new_doc.firstChild.firstChild
                         doc.firstChild.appendChild(child)
@@ -2095,5 +2125,5 @@
             except:
                 logging.info("Failed to connect to www.sasview.org")
-        self._process_version(version_info, standalone=event == None)
+        self._process_version(version_info, standalone=event is None)
 
     def _process_version(self, version_info, standalone=True):
@@ -2184,9 +2214,11 @@
                     try:
                         # Try an alternate method
-                        logging.error("Could not open the tutorial pdf, trying xhtml2pdf")
+                        logging.error(
+                            "Could not open the tutorial pdf, trying xhtml2pdf")
                         from xhtml2pdf import pisa
                         pisa.startViewer(path)
                     except:
-                        logging.error("Could not open the tutorial pdf with xhtml2pdf")
+                        logging.error(
+                            "Could not open the tutorial pdf with xhtml2pdf")
                         msg = "This feature requires 'PDF Viewer'\n"
                         wx.MessageBox(msg, 'Error')
@@ -2198,10 +2230,12 @@
                     try:
                         # Try an alternate method
-                        logging.error("Could not open the tutorial pdf, trying xhtml2pdf")
+                        logging.error(
+                            "Could not open the tutorial pdf, trying xhtml2pdf")
                         from xhtml2pdf import pisa
                         pisa.startViewer(path)
                     except:
-                        logging.error("Could not open the tutorial pdf with xhtml2pdf")
-                        msg = "This feature requires the 'Preview' application\n"
+                        logging.error(
+                            "Could not open the tutorial pdf with xhtml2pdf")
+                        msg = "This feature requires the Preview application\n"
                         wx.MessageBox(msg, 'Error')
 
@@ -2218,5 +2252,6 @@
         from documentation_window import DocumentationWindow
         _TreeLocation = "user/user.html"
-        DocumentationWindow(self, -1, _TreeLocation, "", "SasView Documentation")
+        DocumentationWindow(self, -1, _TreeLocation, "",
+                            "SasView Documentation")
 
     def set_manager(self, manager):
@@ -2252,5 +2287,5 @@
                 if self.panels[item].ALWAYS_ON:
                     continue
-            if self.panels[item] == None:
+            if self.panels[item] is None:
                 continue
             if self.panels[item].window_name in panels:
@@ -2261,8 +2296,9 @@
                 # always show the data panel if enable
                 style = self.__gui_style & GUIFRAME.MANAGER_ON
-                if (style == GUIFRAME.MANAGER_ON) and self.panels[item] == self._data_panel:
+                if (style == GUIFRAME.MANAGER_ON) \
+                        and self.panels[item] == self._data_panel:
                     if 'data_panel' in self.panels.keys():
                         frame = self.panels['data_panel'].get_frame()
-                        if frame == None:
+                        if frame is None:
                             continue
                         flag = frame.IsShown()
@@ -2270,5 +2306,5 @@
                 else:
                     frame = self.panels[item].get_frame()
-                    if frame == None:
+                    if frame is None:
                         continue
 
@@ -2280,5 +2316,5 @@
         show the data panel
         """
-        if self._data_panel_menu == None:
+        if self._data_panel_menu is None:
             return
         label = self._data_panel_menu.GetText()
@@ -2310,5 +2346,5 @@
         :param data_list: dictionary of data's ID and value Data
         """
-        #Store data into manager
+        # Store data into manager
         self.add_data_helper(data_list)
         # set data in the data panel
@@ -2316,14 +2352,14 @@
             data_state = self._data_manager.get_data_state(data_list.keys())
             self._data_panel.load_data_list(data_state)
-        #if the data panel is shown wait for the user to press a button
-        #to send data to the current perspective. if the panel is not
-        #show  automatically send the data to the current perspective
+        # if the data panel is shown wait for the user to press a button
+        # to send data to the current perspective. if the panel is not
+        # show  automatically send the data to the current perspective
         style = self.__gui_style & GUIFRAME.MANAGER_ON
         if style == GUIFRAME.MANAGER_ON:
-            #wait for button press from the data panel to set_data
+            # wait for button press from the data panel to set_data
             if self._data_panel is not None:
                 self._data_panel.frame.Show(True)
         else:
-            #automatically send that to the current perspective
+            # automatically send that to the current perspective
             self.set_data(data_id=data_list.keys())
 
@@ -2386,8 +2422,8 @@
                                                        info='warning'))
             else:
-                #if not append then new plot
+                # if not append then new plot
                 from sas.sasgui.guiframe.dataFitting import Data2D
                 if issubclass(Data2D, new_plot.__class__):
-                    #for 2 D always plot in a separated new plot
+                    # for 2 D always plot in a separated new plot
                     new_plot.group_id = wx.NewId()
                 else:
@@ -2420,5 +2456,5 @@
                                                 group_id=group_id,
                                                 action='remove'))
-                #remove res plot: Todo: improve
+                # remove res plot: Todo: improve
                 wx.CallAfter(self._remove_res_plot, new_plot.id)
         self._data_manager.delete_data(data_id=data_id,
@@ -2462,5 +2498,5 @@
             mypath = os.path.basename(path)
 
-            #Instantiate a loader
+            # Instantiate a loader
             loader = Loader()
             ext_format = ".txt"
@@ -2482,5 +2518,4 @@
         dlg.Destroy()
 
-
     def _onsaveTXT(self, data, path):
         """
@@ -2489,8 +2524,8 @@
         .. todo:: Refactor and remove this method. See 'TODO' in _onSave.
         """
-        if not path == None:
+        if path is not None:
             out = open(path, 'w')
             has_errors = True
-            if data.dy == None or data.dy == []:
+            if data.dy is None or data.dy == []:
                 has_errors = False
             # Sanity check
@@ -2502,5 +2537,5 @@
                     has_errors = False
             if has_errors:
-                if data.dx != None and data.dx != []:
+                if data.dx is not None and data.dx != []:
                     out.write("<X>   <Y>   <dY>   <dX>\n")
                 else:
@@ -2511,6 +2546,6 @@
             for i in range(len(data.x)):
                 if has_errors:
-                    if data.dx != None and data.dx != []:
-                        if  data.dx[i] != None:
+                    if data.dx is not None and data.dx != []:
+                        if data.dx[i] is not None:
                             out.write("%g  %g  %g  %g\n" % (data.x[i],
                                                             data.y[i],
@@ -2543,27 +2578,27 @@
                                            info="error"))
             raise ValueError, msg
-        ## text = str(data)
+        # text = str(data)
         text = data.__str__()
         text += 'Data Min Max:\n'
         text += 'X_min = %s:  X_max = %s\n' % (xmin, max(data.x))
         text += 'Y_min = %s:  Y_max = %s\n' % (ymin, max(data.y))
-        if data.dy != None:
+        if data.dy is not None:
             text += 'dY_min = %s:  dY_max = %s\n' % (min(data.dy), max(data.dy))
         text += '\nData Points:\n'
         x_st = "X"
         for index in range(len(data.x)):
-            if data.dy != None and len(data.dy) > index:
+            if data.dy is not None and len(data.dy) > index:
                 dy_val = data.dy[index]
             else:
                 dy_val = 0.0
-            if data.dx != None and len(data.dx) > index:
+            if data.dx is not None and len(data.dx) > index:
                 dx_val = data.dx[index]
             else:
                 dx_val = 0.0
-            if data.dxl != None and len(data.dxl) > index:
+            if data.dxl is not None and len(data.dxl) > index:
                 if index == 0:
                     x_st = "Xl"
                 dx_val = data.dxl[index]
-            elif data.dxw != None and len(data.dxw) > index:
+            elif data.dxw is not None and len(data.dxw) > index:
                 if index == 0:
                     x_st = "Xw"
@@ -2605,5 +2640,5 @@
             mypath = os.path.basename(path)
 
-            #Instantiate a loader
+            # Instantiate a loader
             loader = Loader()
 
@@ -2642,9 +2677,9 @@
             y_val = data.qy_data[index]
             i_val = data.data[index]
-            if data.err_data != None:
+            if data.err_data is not None:
                 di_val = data.err_data[index]
-            if data.dqx_data != None:
+            if data.dqx_data is not None:
                 dx_val = data.dqx_data[index]
-            if data.dqy_data != None:
+            if data.dqy_data is not None:
                 dy_val = data.dqy_data[index]
 
@@ -2681,5 +2716,5 @@
                     for name in self._current_perspective.get_perspective():
                         frame = panel.get_frame()
-                        if frame != None:
+                        if frame is not None:
                             if name == panel.window_name:
                                 panel.on_set_focus(event=None)
@@ -2691,5 +2726,5 @@
                 self._data_panel.set_active_perspective(name)
                 self._check_applications_menu()
-            #Set the SasView title
+            # Set the SasView title
             self._set_title_name(name)
 
@@ -2723,8 +2758,10 @@
         """
 
-        if self.panel_on_focus not in self._plotting_plugin.plot_panels.values():
+        if self.panel_on_focus \
+                not in self._plotting_plugin.plot_panels.values():
             return
+        check = "Theory1D"
         is_theory = len(self.panel_on_focus.plots) <= 1 and \
-            self.panel_on_focus.plots.values()[0].__class__.__name__ == "Theory1D"
+            self.panel_on_focus.plots.values()[0].__class__.__name__ == check
 
         is_data2d = hasattr(new_plot, 'data')
@@ -2734,15 +2771,16 @@
         has_meta_data = hasattr(new_plot, 'meta_data')
 
-        #disable_add_data if the data is being recovered from  a saved state file.
+        # disable_add_data if the data is being recovered from  a saved state
         is_state_data = False
         if has_meta_data:
             if 'invstate' in new_plot.meta_data:
                 is_state_data = True
-            if  'prstate' in new_plot.meta_data:
+            if 'prstate' in new_plot.meta_data:
                 is_state_data = True
-            if  'fitstate' in new_plot.meta_data:
+            if 'fitstate' in new_plot.meta_data:
                 is_state_data = True
 
-        return is_data1d and not is_data2d and not is_theory and not is_state_data
+        return is_data1d and not is_data2d and not is_theory \
+               and not is_state_data
 
     def check_multimode(self, perspective=None):
@@ -2750,5 +2788,5 @@
         Check the perspective have batch mode capablitity
         """
-        if perspective == None or self._data_panel == None:
+        if perspective is None or self._data_panel is None:
             return
         flag = perspective.get_batch_capable()
@@ -2777,5 +2815,5 @@
             self._edit_menu.Enable(GUIFRAME_ID.PASTE_ID, flag)
 
-            #Copy menu
+            # Copy menu
             flag = self.cpanel_on_focus.get_copy_flag()
             self._edit_menu_copyas.Enable(GUIFRAME_ID.COPYEX_ID, flag)
@@ -2908,6 +2946,6 @@
             if data_panel.cb_plotpanel is not None:
                 # Check if any panel has the same caption
-                has_newstring = data_panel.cb_plotpanel.FindString\
-                                                            (str(new_caption))
+                has_newstring = data_panel.cb_plotpanel.FindString(
+                    str(new_caption))
                 caption = new_caption
                 if has_newstring != wx.NOT_FOUND:
@@ -3026,5 +3064,5 @@
         drag
         """
-        #Not implemeted
+        # Not implemeted
 
     def enable_reset(self):
@@ -3039,5 +3077,5 @@
         """
         size_y = 0
-        if self.GetToolBar() != None and self.GetToolBar().IsShown():
+        if self.GetToolBar() is not None and self.GetToolBar().IsShown():
             if not IS_LINUX:
                 _, size_y = self.GetToolBar().GetSizeTuple()
@@ -3054,5 +3092,5 @@
         # append this panel in the schedule list if not in yet
         if func == 'append':
-            if not panel in self.schedule_full_draw_list:
+            if panel not in self.schedule_full_draw_list:
                 self.schedule_full_draw_list.append(panel)
         # remove this panel from schedule list
@@ -3074,5 +3112,5 @@
 
         count = len(self.schedule_full_draw_list)
-        #if not self.schedule:
+        # if not self.schedule:
         if count < 1:
             self.set_schedule(False)
@@ -3089,5 +3127,6 @@
                 if ind == count:
                     return
-        #Simple redraw only for a panel shown
+        # Simple redraw only for a panel shown
+
         def f_draw(panel):
             """
@@ -3102,5 +3141,5 @@
                     # draw if possible
                     panel.set_resizing(False)
-                    #panel.Show(True)
+                    # panel.Show(True)
                     panel.draw_plot()
                 # Check if the panel is not shown
@@ -3137,7 +3176,7 @@
         Set focus on a plot panel
         """
-        if panel == None:
+        if panel is None:
             return
-        #self.set_plot_unfocus()
+        # self.set_plot_unfocus()
         panel.on_set_focus(None)
         # set focusing panel
@@ -3172,5 +3211,5 @@
         try:
             # check if it is time to redraw
-            if self.GetCapture() == None:
+            if self.GetCapture() is None:
                 # Draw plot, changes resizing too
                 self.full_draw()
@@ -3180,5 +3219,4 @@
         # restart idle
         self._redraw_idle(*args, **kwargs)
-
 
     def _redraw_idle(self, *args, **kwargs):
@@ -3195,14 +3233,14 @@
     the GUI manager
     """
-    ## Internal nickname for the window, used by the AUI manager
+    # Internal nickname for the window, used by the AUI manager
     window_name = "default"
-    ## Name to appear on the window title bar
+    # Name to appear on the window title bar
     window_caption = "Welcome panel"
-    ## Flag to tell the AUI manager to put this panel in the center pane
+    # Flag to tell the AUI manager to put this panel in the center pane
     CENTER_PANE = True
+
     def __init__(self, parent, *args, **kwds):
         wx.Panel.__init__(self, parent, *args, **kwds)
         PanelBase.__init__(self, parent)
-
 
 
@@ -3236,6 +3274,7 @@
         try:
             if os.path.isfile(SPLASH_SCREEN_PATH):
-                self.s_screen = self.display_splash_screen(parent=self.frame,
-                                                           path=SPLASH_SCREEN_PATH)
+                self.s_screen = \
+                    self.display_splash_screen(parent=self.frame,
+                                               path=SPLASH_SCREEN_PATH)
             else:
                 self.frame.Show()
@@ -3300,5 +3339,5 @@
                             os.remove(file_path)
                 except:
-                    logging.error("gui_manager.clean_plugin_models:\n  %s" \
+                    logging.error("gui_manager.clean_plugin_models:\n  %s"
                                   % sys.exc_value)
 
@@ -3314,5 +3353,5 @@
         Build the GUI
         """
-        #try to load file at the start
+        # try to load file at the start
         self.open_file()
         self.frame.build_gui()
@@ -3390,5 +3429,4 @@
         # Return the suggested position and size for the application frame.
         return (posX, posY), (customWidth, customHeight), is_maximized
-
 
     def display_splash_screen(self, parent,
@@ -3427,5 +3465,4 @@
         return s_screen
 
-
     def on_close_splash_screen(self, event):
         """
@@ -3447,10 +3484,11 @@
         """
         # Initialize the Frame object
-        CHILD_FRAME.__init__(self, parent=parent, id=wx.ID_ANY, title=title, size=size)
+        CHILD_FRAME.__init__(self, parent=parent, id=wx.ID_ANY,
+                             title=title, size=size)
         self.parent = parent
         self.name = "Untitled"
         self.batch_on = self.parent.batch_on
         self.panel = panel
-        if panel != None:
+        if panel is not None:
             self.set_panel(panel)
         self.Show(False)
