Index: sansguiframe/src/sans/guiframe/gui_manager.py
===================================================================
--- sansguiframe/src/sans/guiframe/gui_manager.py	(revision 036e9ba1da5ae922063a6ca0cf696d197d9f8e85)
+++ sansguiframe/src/sans/guiframe/gui_manager.py	(revision 7dfdd56f19e5782735ce1ea9c082933c6cda1a1d)
@@ -122,6 +122,6 @@
     custom_config = _find_local_config('custom_config', os.getcwd())
     if custom_config is None:
-        msg = "Custom_config file was not imported"
-        logging.info(msg)
+        msgConfig = "Custom_config file was not imported"
+        logging.info(msgConfig)
     else:
         logging.info("using custom_config in %s" % os.getcwd())
@@ -215,5 +215,5 @@
         """
         
-        wx.Frame.__init__(self, parent=parent, title=title, pos=pos,size=size)
+        wx.Frame.__init__(self, parent=parent, title=title, pos=pos, size=size)
         # title
         self.title = title
@@ -263,4 +263,6 @@
         #tool bar
         self._toolbar = None
+        # Status bar
+        self.sb = None
         # number of plugins
         self._num_perspectives = 0
@@ -293,9 +295,10 @@
         #data manager
         self.batch_on = False
-        from data_manager import DataManager
+        from sans.guiframe.data_manager import DataManager
         self._data_manager = DataManager()
         self._data_panel = 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
@@ -349,5 +352,4 @@
         t = time.localtime(time.time())
         time_str = time.strftime("%b %d %H;%M of %Y", t)
-        name = "Batch"  +  time_str
         details = "File Generated by %s : %s" % (APPLICATION_NAME,
                                                      str(plugin_name))
@@ -492,7 +494,7 @@
             excel_app.Visible = 1
         except:
-            msg = "Error occured when calling Excel\n"
-            msg += "Check that Excel in installed in this machine or \n"
-            msg += "Check that %s really exists.\n" % str(file_name)
+            msg = "Error occured when calling Excel\n" +
+                        "Check that Excel in installed in this machine or \n" +
+                        "Check that %s really exists.\n" % str(file_name)
             wx.PostEvent(self, StatusEvent(status=msg,
                                              info="error"))
@@ -577,4 +579,5 @@
     def get_data_manager(self):
         """
+        return the data manager.
         """
         return self._data_manager
@@ -582,4 +585,5 @@
     def get_toolbar(self):
         """
+        return the toolbar.
         """
         return self._toolbar
@@ -622,5 +626,5 @@
             self._data_panel.disable_app_combo(enable)
         if self._menubar is not None:
-            for menu,_ in self._menubar.GetMenus():
+            for menu, _ in self._menubar.GetMenus():
                 for items in menu.GetMenuItems():
                     items.Enable(enable)
@@ -677,4 +681,5 @@
     def build_gui(self):
         """
+        Build the GUI by setting up the toolbar, menu and layout.
         """
         # set tool bar
@@ -720,5 +725,5 @@
         """
         # Status bar
-        from gui_statusbar import StatusBar
+        from sans.guiframe.gui_statusbar import StatusBar
         self.sb = StatusBar(self, wx.ID_ANY)
         self.SetStatusBar(self.sb)
@@ -750,5 +755,5 @@
         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):
@@ -807,5 +812,4 @@
         
         """
-        import imp
         plugins = []
         # Go through files in panels directory
@@ -935,7 +939,7 @@
         data_pane = self._mgr.GetPane(self.panels["data_panel"].window_name)
         if style != GUIFRAME.MANAGER_ON:
-            self._mgr.GetPane(self.panels["data_panel"].window_name).Hide()
+            data_pane.Hide()
         else:
-            self._mgr.GetPane(self.panels["data_panel"].window_name).Show()
+            data_pane.Show()
             
         # Add the panels to the AUI manager
@@ -971,7 +975,8 @@
     def update_data(self, prev_data, new_data):
         """
-        """
-        prev_id, data_state = self._data_manager.update_data(prev_data=prev_data, 
-                                       new_data=new_data)
+        Update the data.
+        """
+        prev_id, data_state = self._data_manager.update_data(
+                              prev_data=prev_data, new_data=new_data)
         
         self._data_panel.remove_by_id(prev_id)
@@ -980,4 +985,5 @@
     def update_theory(self, data_id, theory, state=None):
         """
+        Update the theory
         """ 
         data_state = self._data_manager.update_theory(data_id=data_id, 
@@ -1010,4 +1016,5 @@
     def delete_data(self, data):
         """
+        Delete the data.
         """
         self._current_perspective.delete_data(data)
@@ -1233,9 +1240,10 @@
             menu_list = self._current_perspective.populate_menu(self)
             if menu_list:
-                for (menu,name) in menu_list:
+                for (menu, name) in menu_list:
                     if self._applications_menu_pos == -1:
                         self._menubar.Append(menu, name)
                     else:
-                        self._menubar.Insert(self._applications_menu_pos, menu, name)
+                        self._menubar.Insert(self._applications_menu_pos, 
+                                             menu, name)
                     self._applications_menu_name = name
                   
@@ -1263,5 +1271,5 @@
             self._help_menu.AppendSeparator()
             id = wx.NewId()
-            self._help_menu.Append(id,'&Tutorial', 'Software tutorial')
+            self._help_menu.Append(id, '&Tutorial', 'Software tutorial')
             wx.EVT_MENU(self, id, self._onTutorial)
             
@@ -1269,5 +1277,5 @@
             self._help_menu.AppendSeparator()
             id = wx.NewId()
-            self._help_menu.Append(id,'&About', 'Software information')
+            self._help_menu.Append(id, '&About', 'Software information')
             wx.EVT_MENU(self, id, self._onAbout)
         
@@ -1300,7 +1308,7 @@
         style1 = self.__gui_style & GUIFRAME.TOOLBAR_ON
         if style1 == GUIFRAME.TOOLBAR_ON:
-            self._toolbar_menu = self._view_menu.Append(id,'&Hide Toolbar', '')
+            self._toolbar_menu = self._view_menu.Append(id, '&Hide Toolbar', '')
         else:
-            self._toolbar_menu = self._view_menu.Append(id,'&Show Toolbar', '')
+            self._toolbar_menu = self._view_menu.Append(id, '&Show Toolbar', '')
         wx.EVT_MENU(self, id, self._on_toggle_toolbar)
                     
@@ -1314,5 +1322,5 @@
             self._view_menu.AppendSeparator()
             id = wx.NewId()
-            preference_menu = self._view_menu.Append(id,'Startup Setting', '')
+            preference_menu = self._view_menu.Append(id, 'Startup Setting', '')
             wx.EVT_MENU(self, id, self._on_preference_menu)
             
@@ -1396,5 +1404,6 @@
             id = wx.NewId()
             hint = "Clean up the dock area for plots on new-plot"
-            preferences_menu.AppendCheckItem(id, '&CleanUp Dock on NewPlot', hint)
+            preferences_menu.AppendCheckItem(id, '&CleanUp Dock on NewPlot', 
+                                             hint)
             wx.EVT_MENU(self, id, self.on_cleanup_dock)
             flag = self.cleanup_plots
@@ -1407,27 +1416,24 @@
             self._menubar.Remove(pos)
         #wx.EVT_MENU(self, id, self.show_preferences_panel)   
-        """
-        if len(self.plugins) == 2:
-            plug = self.plugins[1]
-            pers = plug.get_perspective()
-       
-            if len(pers) > 1:
-                self._window_menu = wx.Menu()
-                for item in self.panels:
-                    if item == 'default':
-                        continue
-                    panel = self.panels[item]
-                    if panel.window_name in pers:
-                        self._window_menu.Append(int(item),
-                                                  panel.window_caption,
-                                        "Show %s window" % panel.window_caption)
-                        wx.EVT_MENU(self, int(item), self.on_view)
-                self._menubar.Append(self._window_menu, '&Window')
-                """
+        #if len(self.plugins) == 2:
+        #    plug = self.plugins[1]
+        #    pers = plug.get_perspective()
+        #
+        #    if len(pers) > 1:
+        #        self._window_menu = wx.Menu()
+        #        for item in self.panels:
+        #            if item == 'default':
+        #                continue
+        #            panel = self.panels[item]
+        #            if panel.window_name in pers:
+        #                self._window_menu.Append(int(item),
+        #                                          panel.window_caption,
+        #                                "Show %s window" % panel.window_caption)
+        #                wx.EVT_MENU(self, int(item), self.on_view)
+        #        self._menubar.Append(self._window_menu, '&Window')
 
                 
     def _add_menu_application(self):
         """
-        
         # Attach a menu item for each defined perspective or application.
         # Only add the perspective menu if there are more than one perspectives
@@ -1484,5 +1490,4 @@
         #append item from plugin under menu file if necessary
         self._populate_file_menu()
-        style = self.__gui_style & GUIFRAME.DATALOADER_ON
         style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS
         if OPEN_SAVE_MENU:
@@ -1560,4 +1565,5 @@
     def get_style(self):
         """
+        Return the gui style
         """
         return  self.__gui_style
@@ -1789,4 +1795,5 @@
     def clear_panel(self):
         """
+        Clear the panel
         """
         for item in self.panels:
@@ -1893,5 +1900,4 @@
             print log_msg
             return
-        message = ""
         log_msg = ''
         output = {}
@@ -1964,5 +1970,6 @@
             return PLUGINS_WLIST 
         try:
-            # Find the extension of the perspective and get that as 1st item in list
+            # Find the extension of the perspective 
+            # and get that as 1st item in list
             ind = None
             app_ext = self._current_perspective._extensions
@@ -1977,5 +1984,5 @@
                 plug_wlist.insert(0, ind)
                 try:
-                    plug_wlist ='|'.join(plug_wlist)
+                    plug_wlist = '|'.join(plug_wlist)
                 except:
                     plug_wlist = ''
@@ -2139,5 +2146,5 @@
             f=urllib2.urlopen(config.__update_URL__, 
                               timeout=1.0)
-            content=f.read()
+            content = f.read()
         except:
             content = "0.0.0"
@@ -2195,5 +2202,5 @@
         """
         if config._do_aboutbox:
-            import aboutbox 
+            import sans.guiframe.aboutbox 
             dialog = aboutbox.DialogAbout(None, -1, "")
             dialog.ShowModal()   
@@ -2616,8 +2623,10 @@
                 dx_val = 0.0
             if data.dxl != None:
-                if index == 0: x_st = "Xl"
+                if index == 0: 
+                    x_st = "Xl"
                 dx_val = data.dxl[index]
             elif data.dxw != None:
-                if index == 0: x_st = "Xw"
+                if index == 0: 
+                    x_st = "Xw"
                 dx_val = data.dxw[index]
             
