Index: invariantview/src/sans/perspectives/invariant/invariant_panel.py
===================================================================
--- invariantview/src/sans/perspectives/invariant/invariant_panel.py	(revision a1fa589e7afd6babf54e808a62614d8c381bee4d)
+++ invariantview/src/sans/perspectives/invariant/invariant_panel.py	(revision 0d417ac880e8994e4d5f5e563bbda2b50a10cce6)
@@ -99,6 +99,6 @@
         if self.parent is not None:
             msg = ""
-            wx.PostEvent(self.parent,StatusEvent(status=msg, info="info"))
-            self._default_save_location =\
+            wx.PostEvent(self.parent, StatusEvent(status=msg, info="info"))
+            self._default_save_location = \
                         self.parent._default_save_location
         
@@ -199,5 +199,5 @@
         return doc   
 
-    def set_state(self,state=None,data=None):
+    def set_state(self, state=None, data=None):
         """
         set state when loading it from a .inv/.svs file
@@ -206,5 +206,6 @@
         if state == None and data == None:
             self.state = IState()
-        elif state == None or data == None: return
+        elif state == None or data == None: 
+            return
         else:
             new_state = copy.deepcopy(state)
@@ -226,14 +227,14 @@
             total_bookmark_num = self.bookmark_num + 1
 
-            for ind in range(1,total_bookmark_num):
+            for ind in range(1, total_bookmark_num):
                 #bookmark_num = ind
                 value = self.state.bookmark_list[ind]
-                name = "%d] bookmarked at %s on %s"% (ind,value[0], value[1])
+                name = "%d] bookmarked at %s on %s"% (ind, value[0], value[1])
                 # append it to menu
                 id = wx.NewId()
-                self.popUpMenu.Append(id,name,str(''))
+                self.popUpMenu.Append(id, name, str(''))
                 wx.EVT_MENU(self, id, self._back_to_bookmark) 
                 wx.PostEvent(self.parent, AppendBookmarkEvent(title=name, 
-                                          hint='',
+                                          hint='', 
                                           handler=self._back_to_bookmark))
 
@@ -315,4 +316,5 @@
     def get_extrapolation_type(self, low_q, high_q):
         """
+        get extrapolation type
         """
         extrapolation = None
@@ -337,4 +339,5 @@
     def get_volume(self, inv, contrast, extrapolation):
         """
+        get volume fraction
         """
         if contrast is not None:
@@ -355,4 +358,5 @@
     def get_surface(self, inv, contrast, porod_const, extrapolation):
         """
+        get surface value
         """
         if contrast is not None and porod_const is not None:
@@ -373,4 +377,5 @@
     def get_total_qstar(self, inv, extrapolation):
         """
+        get total qstar
         """
         try:
@@ -391,4 +396,5 @@
     def get_low_qstar(self, inv, npts_low, low_q=False):
         """
+        get low qstar
         """
         if low_q:
@@ -415,8 +421,10 @@
             try:
                 self._manager.plot_theory(name="Low-Q extrapolation")
-            except: pass
+            except: 
+                pass
             
     def get_high_qstar(self, inv, high_q=False):
         """
+        get high qstar
         """
         if high_q:
@@ -445,8 +453,10 @@
             try:
                 self._manager.plot_theory(name="High-Q extrapolation")
-            except: pass
+            except: 
+                pass
 
     def get_qstar(self, inv):
         """
+        get qstar
         """
         qstar, qstar_err = inv.get_qstar_with_error()
@@ -509,5 +519,5 @@
                 power_high = float(power_high)
             else:
-                if high_q :
+                if high_q:
                     #Raise error only when qstar at high q is requested
                     msg = "Expect float for power at high q,"
@@ -580,5 +590,5 @@
             msg = "Error occurred computing invariant: %s" % sys.exc_value
             wx.PostEvent(self.parent, StatusEvent(status=msg,
-                                                 info="warning",type="stop"))
+                                                 info="warning", type="stop"))
             return
         #check the type of extrapolation
@@ -657,5 +667,5 @@
         self.Refresh()
             
-    def on_undo(self,event=None):
+    def on_undo(self, event=None):
         """
         Go back to the previous state
@@ -680,5 +690,5 @@
 
         
-    def on_redo(self,event=None):
+    def on_redo(self, event=None):
         """
         Go forward to the previous state
@@ -713,9 +723,9 @@
         report_text_str = self.state.__str__()
         report_img = self.state.image
-        report_list = [report_html_str,report_text_str,report_img]
+        report_list = [report_html_str, report_text_str, report_img]
         dialog = ReportDialog(report_list, None, -1, "")
         dialog.ShowModal()
         
-    def get_state_by_num(self,state_num=None):
+    def get_state_by_num(self, state_num=None):
         """
         Get the state given by number
@@ -784,5 +794,6 @@
         # get the previous state
         try:
-            time,date,current_state,comp_state = self.state.bookmark_list[int(num)] 
+            time,date,current_state,comp_state = \
+                self.state.bookmark_list[int(num)] 
         except :
             raise ValueError,  "No such bookmark exists"
@@ -859,7 +870,7 @@
         name = str(obj.GetName())
         value = str(obj.GetValue())
-        rb_list = [['power_law_low','guinier'],
-                   ['fit_enable_low','fix_enable_low'],
-                   ['fit_enable_high','fix_enable_high']]
+        rb_list = [['power_law_low', 'guinier'],
+                   ['fit_enable_low', 'fix_enable_low'],
+                   ['fit_enable_high', 'fix_enable_high']]
 
         try:
@@ -886,5 +897,6 @@
             self.state.saved_state['state_num'] += 1
             self.state.state_num = self.state.saved_state['state_num']
-            self.state.state_list[str(self.state.state_num)] = self.state.clone_state()#copy.deepcopy(self.state.saved_state)
+            self.state.state_list[str(self.state.state_num)] = \
+                    self.state.clone_state()
         except:           
             pass
@@ -894,5 +906,5 @@
         #event.Skip()
                    
-    def _set_compute_state(self,state=None):
+    def _set_compute_state(self, state=None):
         """
         Notify the compute_invariant state to self.state
@@ -909,5 +921,5 @@
             self.is_power_out = True
         # Instead of changing the future, create a new future.
-        max_state_num = len(self.state.state_list)-1   
+        max_state_num = len(self.state.state_list) - 1   
         self.state.saved_state['state_num'] = max_state_num        
         # A new computation is also A state
@@ -923,9 +935,10 @@
         self.state.saved_state= copy.deepcopy(temp_saved_states)
         #copy.deepcopy(self.state.saved_state)
-        self.state.state_list[str(self.state.state_num)] = self.state.clone_state()
+        self.state.state_list[str(self.state.state_num)] = \
+                                        self.state.clone_state()
         
         # A computation is a new state, so delete the states with any higher
         # state numbers
-        for i in range(self.state.state_num+1,len(self.state.state_list)):
+        for i in range(self.state.state_num+1, len(self.state.state_list)):
             try:
                 del (self.state.state_list[str(i)])
@@ -991,5 +1004,5 @@
         # text event is a new state, so delete the states with higher state_num
         # i.e., change the future
-        for i in range(int(state_num)+1,len(self.state.state_list)):
+        for i in range(int(state_num)+1, len(self.state.state_list)):
             try:
                 del (self.state.state_list[str(i)])
@@ -1012,5 +1025,6 @@
             self.state.state_num = self.state.saved_state['state_num']
             #copy.deepcopy(self.state.saved_state)
-            self.state.state_list[str(self.state.state_num)] = self.state.clone_state()
+            self.state.state_list[str(self.state.state_num)] = \
+                                        self.state.clone_state()
         except:
             pass
@@ -1035,5 +1049,6 @@
         try:
             exec "self.state.saved_state['%s'] = '%s'" %  (name, value)
-            self.state.state_list[str(self.state.state_num)] = self.state.clone_state()
+            self.state.state_list[str(self.state.state_num)] = \
+                                self.state.clone_state()
         except:
             pass
@@ -1068,5 +1083,5 @@
         self.Bind(wx.EVT_CONTEXT_MENU, self._on_context_menu)
         
-    def on_bookmark(self,event):
+    def on_bookmark(self, event):
         """
         Save the panel state in memory and add the list on
@@ -1092,5 +1107,5 @@
         # append it to menu
         id = wx.NewId()
-        self.popUpMenu.Append(id,name,str(msg))
+        self.popUpMenu.Append(id, name, str(msg))
         wx.EVT_MENU(self, id, self._back_to_bookmark)
         state = self.state.clone_state()
@@ -1100,5 +1115,5 @@
         self.state.toXML(self, doc=None, entry_node=None)
         
-        wx.PostEvent(self.parent,StatusEvent(status=msg,info="info"))
+        wx.PostEvent(self.parent, StatusEvent(status=msg, info="info"))
         wx.PostEvent(self.parent, 
                      AppendBookmarkEvent(title=name, 
@@ -1106,5 +1121,5 @@
                                           handler=self._back_to_bookmark))
 
-    def _back_to_bookmark(self,event):
+    def _back_to_bookmark(self, event):
         """
         Bring the panel back to the state of bookmarked requested by
@@ -1124,5 +1139,5 @@
         current_state_num = self.state.state_num  
         self.get_bookmark_by_num(num)
-        state_num = int(current_state_num)+1
+        state_num = int(current_state_num) + 1
         
         self.state.saved_state['state_num'] = state_num
@@ -1134,5 +1149,5 @@
         self._info_bookmark_num(event)
         
-    def _info_bookmark_num(self,event=None):
+    def _info_bookmark_num(self, event=None):
         """
         print the bookmark number in info
@@ -1164,7 +1179,8 @@
         """
         # date and time 
-        year, month, day,hour,minute,second,tda,ty,tm_isdst= time.localtime()
-        my_time= str(hour)+":"+str(minute)+":"+str(second)
-        date= str( month)+"/"+str(day)+"/"+str(year)
+        year, month, day, hour, minute, second, tda, ty, tm_isdst = \
+                                    time.localtime()
+        my_time = str(hour) + ":" + str(minute) + ":" + str(second)
+        date = str( month) + "/" + str(day) + "/" + str(year)
         return my_time, date
    
@@ -1177,5 +1193,5 @@
         path = None
         if self.parent != None:
-            self._default_save_location =\
+            self._default_save_location = \
              self.parent._default_save_location
         if self._default_save_location == None:
@@ -1188,5 +1204,5 @@
             self._default_save_location = os.path.dirname(path)
             if self.parent != None:
-                self.parent._default_save_location =\
+                self.parent._default_save_location = \
                     self._default_save_location
         else:
@@ -1200,5 +1216,5 @@
         self._manager.save_file(filepath=fName, state=self.state)
         
-    def _show_message(self, mssg='',msg='Warning'):
+    def _show_message(self, mssg='', msg='Warning'):
         """
         Show warning message when resetting data
@@ -1221,5 +1237,5 @@
 
     
-    def _on_context_menu(self,event):
+    def _on_context_menu(self, event):
         
         pos = event.GetPosition()
@@ -1269,12 +1285,12 @@
         self.high_extrapolation_sizer = wx.StaticBoxSizer(high_q_box,
                                                           wx.VERTICAL)
-        self.high_q_sizer = wx.GridBagSizer(5,5)
+        self.high_q_sizer = wx.GridBagSizer(5, 5)
         #sizer to define outputs
-        self.volume_surface_sizer = wx.GridBagSizer(5,5)
+        self.volume_surface_sizer = wx.GridBagSizer(5, 5)
         #Sizer related to invariant output
         self.invariant_sizer = wx.GridBagSizer(5, 5)
         #Sizer related to button
         self.button_sizer = wx.BoxSizer(wx.HORIZONTAL)
-        self.button_sizer.SetMinSize((_STATICBOX_WIDTH,-1))
+        self.button_sizer.SetMinSize((_STATICBOX_WIDTH, -1))
         #Sizer related to save button
         self.save_button_sizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -1688,10 +1704,10 @@
         invariant_total_txt = wx.StaticText(self, -1, 'Invariant Total [Q*]')
         self.invariant_total_tcl = OutputTextCtrl(self, -1,
-                                                  size=(_BOX_WIDTH,-1),
+                                                  size=(_BOX_WIDTH, -1),
                                                   name='invariant_total_tcl')
         msg_hint = "Total invariant [Q*], including extrapolated regions."
         self.invariant_total_tcl.SetToolTipString(msg_hint)
         self.invariant_total_err_tcl = OutputTextCtrl(self, -1,
-                                                      size=(_BOX_WIDTH,-1),
+                                                      size=(_BOX_WIDTH, -1),
                                                 name='invariant_total_err_tcl')
         hint_msg = "Uncertainty on invariant."
@@ -1723,5 +1739,5 @@
         contrast_txt = wx.StaticText(self, -1, 'Contrast :')  
         self.contrast_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20),
-                                        style=0,name='contrast_tcl')
+                                        style=0, name='contrast_tcl')
         wx.EVT_TEXT(self, self.contrast_tcl.GetId(), self._on_text)
         contrast_hint_txt = "Contrast"
@@ -1750,13 +1766,13 @@
         self.scale_tcl.SetToolTipString(scale_hint_txt)
         self.sizer_input.AddMany([(background_txt, 0, wx.LEFT|wx.BOTTOM, 5),
-                                  (self.background_tcl, 0, wx.LEFT|wx.BOTTOM, 5),
-                                (background_unit_txt, 0, wx.LEFT|wx.BOTTOM, 5),
-                                (scale_txt, 0, wx.LEFT|wx.BOTTOM, 20),
-                                (self.scale_tcl, 0, wx.LEFT|wx.BOTTOM|wx.RIGHT, 5),
-                                (contrast_txt, 0, wx.LEFT|wx.BOTTOM, 5),
-                                (self.contrast_tcl, 0, wx.LEFT|wx.BOTTOM, 5),
-                                (contrast_unit_txt, 0, wx.LEFT|wx.BOTTOM, 5),
-                                (porod_const_txt, 0, wx.LEFT, 20),
-                        (self.porod_constant_tcl, 0, wx.LEFT|wx.BOTTOM|wx.RIGHT, 5)])
+                            (self.background_tcl, 0, wx.LEFT|wx.BOTTOM, 5),
+                            (background_unit_txt, 0, wx.LEFT|wx.BOTTOM, 5),
+                            (scale_txt, 0, wx.LEFT|wx.BOTTOM, 20),
+                            (self.scale_tcl, 0, wx.LEFT|wx.BOTTOM|wx.RIGHT, 5),
+                            (contrast_txt, 0, wx.LEFT|wx.BOTTOM, 5),
+                            (self.contrast_tcl, 0, wx.LEFT|wx.BOTTOM, 5),
+                            (contrast_unit_txt, 0, wx.LEFT|wx.BOTTOM, 5),
+                            (porod_const_txt, 0, wx.LEFT, 20),
+                (self.porod_constant_tcl, 0, wx.LEFT|wx.BOTTOM|wx.RIGHT, 5)])
         self.inputs_sizer.Add(self.sizer_input)
        
@@ -1820,6 +1836,6 @@
     """
     """
-    def __init__(self, parent=None, id=1,graph=None,
-                 data=None, title="Invariant",base=None):
+    def __init__(self, parent=None, id=1, graph=None,
+                 data=None, title="Invariant", base=None):
         wx.Dialog.__init__(self, parent, id, title, size=(PANEL_WIDTH,
                                                              PANEL_HEIGHT))
