Changeset 5ce7f17 in sasview


Ignore:
Timestamp:
Mar 27, 2015 9:05:11 AM (9 years ago)
Author:
krzywon
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
cce0ad3
Parents:
a862cea0
Message:

Fix for ticket #395 - Saving a project now saves all fits and loading a
project no longer throws an error by trying to find deprecated fitting
engines.

Location:
src/sas
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/dataloader/readers/cansas_reader.py

    r682c432 r5ce7f17  
    322322                value_unit = local_unit 
    323323            except: 
    324                 print sys.exc_info() 
    325324                err_msg = "CanSAS reader: unknown error converting " 
    326325                err_msg += "\"{0}\" unit [{1}]" 
     
    990989                self.append(node, entry_node) 
    991990 
    992     def _check_origin(self, entry_node, doc): 
     991    def _check_origin(self, entry_node, doc, frm): 
    993992        """ 
    994993        Return the document, and the SASentry node associated with 
     
    1000999        :param doc: entire xml tree 
    10011000        """ 
    1002         frm = inspect.stack()[1] 
     1001        if not frm: 
     1002            frm = inspect.stack()[1] 
    10031003        mod_name = frm[1].replace("\\", "/").replace(".pyc", "") 
    10041004        mod_name = mod_name.replace(".py", "") 
     
    10111011            node_list = doc.getElementsByTagName(node_name) 
    10121012            entry_node = node_list.item(0) 
    1013         return entry_node 
     1013        return doc, entry_node 
    10141014 
    10151015    def _to_xml_doc(self, datainfo): 
     
    10611061        # If the calling function was not the cansas reader, return a minidom 
    10621062        #      object rather than an lxml object. 
    1063         entry_node = self._check_origin(entry_node, doc) 
     1063        frm = inspect.stack()[1] 
     1064        doc, entry_node = self._check_origin(entry_node, doc, frm) 
    10641065        return doc, entry_node 
    10651066 
  • src/sas/dataloader/readers/xml_reader.py

    r79492222 r5ce7f17  
    11""" 
    22    Generic XML read and write utility 
    3      
     3 
    44    Usage: Either extend xml_reader or add as a class variable. 
    55""" 
     
    77#This software was developed by the University of Tennessee as part of the 
    88#Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    9 #project funded by the US National Science Foundation.  
    10 #If you use DANSE applications to do scientific research that leads to  
    11 #publication, we ask that you acknowledge the use of the software with the  
     9#project funded by the US National Science Foundation. 
     10#If you use DANSE applications to do scientific research that leads to 
     11#publication, we ask that you acknowledge the use of the software with the 
    1212#following sentence: 
    13 #This work benefited from DANSE software developed under NSF award DMR-0520547.  
     13#This work benefited from DANSE software developed under NSF award DMR-0520547. 
    1414#copyright 2008,2009 University of Tennessee 
    1515############################################################################# 
     
    2525    Generic XML read and write class. Mostly helper functions. 
    2626    Makes reading/writing XML a bit easier than calling lxml libraries directly. 
    27      
     27 
    2828    :Dependencies: 
    2929        This class requires lxml 2.3 or higher. 
    3030    """ 
    31      
     31 
    3232    xml = None 
    3333    xmldoc = None 
     
    3737    encoding = None 
    3838    processing_instructions = None 
    39      
    40     def __init__(self, xml = None, schema = None): 
     39 
     40    def __init__(self, xml=None, schema=None): 
    4141        self.xml = xml 
    4242        self.schema = schema 
     
    5151        else: 
    5252            self.schemadoc = None 
    53      
     53 
    5454    def reader(self): 
    5555        """ 
     
    5757        """ 
    5858        if self.validate_xml(): 
    59             self.xmldoc = etree.parse(self.xml, parser = PARSER) 
     59            self.xmldoc = etree.parse(self.xml, parser=PARSER) 
    6060        else: 
    6161            raise etree.XMLSchemaValidateError(self, self.find_invalid_xml()) 
    6262        return self.xmldoc 
    63      
     63 
    6464    def set_xml_file(self, xml): 
    6565        """ 
     
    6868        try: 
    6969            self.xml = xml 
    70             self.xmldoc = etree.parse(self.xml, parser = PARSER) 
     70            self.xmldoc = etree.parse(self.xml, parser=PARSER) 
    7171            self.xmlroot = self.xmldoc.getroot() 
    7272        except etree.XMLSyntaxError as xml_error: 
     
    7676            self.xmldoc = None 
    7777            self.xmlroot = None 
    78      
     78 
    7979    def set_schema(self, schema): 
    8080        """ 
     
    8383        try: 
    8484            self.schema = schema 
    85             self.schemadoc = etree.parse(self.schema, parser = PARSER) 
     85            self.schemadoc = etree.parse(self.schema, parser=PARSER) 
    8686        except etree.XMLSyntaxError as xml_error: 
    8787            logging.info(xml_error) 
     
    8989            self.schema = None 
    9090            self.schemadoc = None 
    91      
     91 
    9292    def validate_xml(self): 
    9393        """ 
     
    100100            valid = schema_check.validate(self.xmldoc) 
    101101        return valid 
    102      
     102 
    103103    def find_invalid_xml(self): 
    104104        """ 
     
    113113            first_error = str(err) 
    114114        return first_error 
    115      
     115 
    116116    def parse_schema_and_doc(self): 
    117117        """ 
     
    120120        self.set_xml_file(self.xml) 
    121121        self.set_schema(self.schema) 
    122          
     122 
    123123    def to_string(self, elem, pretty_print=False, encoding=None): 
    124124        """ 
    125125        Converts an etree element into a string 
    126126        """ 
    127         return etree.tostring(elem, pretty_print = pretty_print, \ 
    128                               encoding = encoding) 
    129      
     127        return etree.tostring(elem, pretty_print=pretty_print, \ 
     128                              encoding=encoding) 
     129 
    130130    def break_processing_instructions(self, string, dic): 
    131131        """ 
    132132        Method to break a processing instruction string apart and add to a dict 
    133          
     133 
    134134        :param string: A processing instruction as a string 
    135135        :param dic: The dictionary to save the PIs to 
     
    142142        dic[new_pi_name] = attr 
    143143        return dic 
    144      
     144 
    145145    def set_processing_instructions(self): 
    146146        """ 
     
    164164            del dic['xml'] 
    165165        self.processing_instructions = dic 
    166          
     166 
    167167    def set_encoding(self, attr_str): 
    168168        """ 
    169169        Find the encoding in the xml declaration and save it as a string 
    170          
     170 
    171171        :param attr_str: All attributes as a string 
    172172            e.g. "foo1="bar1" foo2="bar2" foo3="bar3" ... foo_n="bar_n"" 
    173173        """ 
    174174        attr_str = attr_str.replace(" = ", "=") 
    175         attr_list = attr_str.split( ) 
     175        attr_list = attr_str.split() 
    176176        for item in attr_list: 
    177177            name_value = item.split("\"=") 
     
    182182                return 
    183183        self.encoding = None 
    184          
    185     def _create_unique_key(self, dictionary, name, numb = 0): 
     184 
     185    def _create_unique_key(self, dictionary, name, numb=0): 
    186186        """ 
    187187        Create a unique key value for any dictionary to prevent overwriting 
     
    198198            name = self._create_unique_key(dictionary, name, numb) 
    199199        return name 
    200      
     200 
    201201    def create_tree(self, root): 
    202202        """ 
    203203        Create an element tree for processing from an etree element 
    204          
     204 
    205205        :param root: etree Element(s)  
    206206        """ 
    207207        return etree.ElementTree(root) 
    208      
     208 
    209209    def create_element_from_string(self, xml_string): 
    210210        """ 
    211211        Create an element from an XML string 
    212          
     212 
    213213        :param xml_string: A string of xml 
    214214        """ 
    215215        return etree.fromstring(xml_string) 
    216      
     216 
    217217    def create_element(self, name, attrib=None, nsmap=None): 
    218218        """ 
    219219        Create an XML element for writing to file 
    220          
     220 
    221221        :param name: The name of the element to be created 
    222222        """ 
     
    224224            attrib = {} 
    225225        return etree.Element(name, attrib, nsmap) 
    226      
     226 
    227227    def write_text(self, elem, text): 
    228228        """ 
    229229        Write text to an etree Element 
    230          
     230 
    231231        :param elem: etree.Element object 
    232232        :param text: text to write to the element 
     
    234234        elem.text = text 
    235235        return elem 
    236      
     236 
    237237    def write_attribute(self, elem, attr_name, attr_value): 
    238238        """ 
    239239        Write attributes to an Element 
    240          
     240 
    241241        :param elem: etree.Element object 
    242242        :param attr_name: attribute name to write 
     
    245245        attr = elem.attrib 
    246246        attr[attr_name] = attr_value 
    247          
     247 
    248248    def return_processing_instructions(self): 
    249249        """ 
    250250        Get all processing instructions saved when loading the document 
    251          
     251 
    252252        :param tree: etree.ElementTree object to write PIs to 
    253253        """ 
     
    259259                pi_list.append(pi_item) 
    260260        return pi_list 
    261      
     261 
    262262    def append(self, element, tree): 
    263263        """ 
    264264        Append an etree Element to an ElementTree. 
    265          
     265 
    266266        :param element: etree Element to append 
    267267        :param tree: ElementTree object to append to 
     
    269269        tree = tree.append(element) 
    270270        return tree 
    271      
     271 
    272272    def ebuilder(self, parent, elementname, text=None, attrib=None): 
    273273        """ 
    274274        Use lxml E builder class with arbitrary inputs. 
    275          
     275 
    276276        :param parnet: The parent element to append a child to 
    277277        :param elementname: The name of the child in string form 
     
    285285        parent = parent.append(elem) 
    286286        return parent 
    287          
  • src/sas/perspectives/fitting/basepage.py

    r7cd87c2 r5ce7f17  
    175175        self.orientation_params = [] 
    176176        self.orientation_params_disp = [] 
    177 #       Self.model should ALWAYS be None here.  It was set to none above in  
     177#       Self.model should ALWAYS be None here.  It was set to none above in 
    178178#       this long init setting.  no obvious function call in between setting 
    179 #       and this - commenting out on 4/8/2014 by PDB.  Remove once clear  
     179#       and this - commenting out on 4/8/2014 by PDB.  Remove once clear 
    180180#       it is pointless. 
    181181#        if self.model != None: 
     
    417417        _on_set_focus_callback = None 
    418418 
    419         def __init__(self, parent, id= -1, 
     419        def __init__(self, parent, id=-1, 
    420420                     value=wx.EmptyString, 
    421421                     pos=wx.DefaultPosition, 
     
    430430 
    431431            wx.TextCtrl.__init__(self, parent, id, value, pos, 
    432                                   size, style, validator, name) 
     432                                 size, style, validator, name) 
    433433 
    434434            # Bind appropriate events 
     
    488488        set some page important information at once 
    489489        """ 
    490 #       THIS METHOD/FUNCTION NO LONGE APPEARS TO BE CALLED.  Started up program  
     490#       THIS METHOD/FUNCTION NO LONGE APPEARS TO BE CALLED.  Started up program 
    491491#       and started new fit window and PR and Invariant and a fit in fitting 
    492492#       but never entered this routine which should be an initialization 
    493 #       routine.  Leave for a while but probably something to clean up at  
     493#       routine.  Leave for a while but probably something to clean up at 
    494494#       some point? 
    495495# 
     
    589589    def get_state(self): 
    590590        """ 
     591        return the current page state 
    591592        """ 
    592593        return self.state 
     
    645646        ## These are called for first time by formfactor_combo_init 
    646647        ## itself called from fitpanel only.  If we find that I'm wrong and 
    647         ## we DO need to initialize somehow here - do it by a call to  
    648         ## formfactor_combo_init  
     648        ## we DO need to initialize somehow here - do it by a call to 
     649        ## formfactor_combo_init 
    649650        ## self.formfator_combo_init() 
    650         ## BUT NOT HERE -- make it last line of this  
     651        ## BUT NOT HERE -- make it last line of this 
    651652        ## method so that structure box is populated before _show_comboox_helper 
    652653        ## is called.  Otherwise wx will complain mightily:-) 
     
    660661#                               self.model_list_box["Shapes"]) 
    661662            self._populate_box(self.structurebox, 
    662                                 self.model_list_box["Structure Factors"]) 
     663                               self.model_list_box["Structure Factors"]) 
    663664            self.structurebox.Insert("None", 0, None) 
    664665            self.structurebox.SetSelection(0) 
     
    686687        #---------------------------------------------------- 
    687688        self.disable_disp = wx.RadioButton(self, -1, 'Off', (10, 10), 
    688                                             style=wx.RB_GROUP) 
     689                                           style=wx.RB_GROUP) 
    689690        self.enable_disp = wx.RadioButton(self, -1, 'On', (10, 30)) 
    690691        # best size for MAC and PC 
     
    696697                                      style=wx.BU_EXACTFIT, 
    697698                                      size=size_q) 
    698         self.disp_help_bt.Bind(wx.EVT_BUTTON, 
    699                         self.on_pd_help_clicked, id=self.disp_help_bt.GetId()) 
     699        self.disp_help_bt.Bind(wx.EVT_BUTTON, self.on_pd_help_clicked, 
     700                              id=self.disp_help_bt.GetId()) 
    700701        self.disp_help_bt.SetToolTipString("Helps for Polydispersion.") 
    701702 
    702703        self.Bind(wx.EVT_RADIOBUTTON, self._set_dipers_Param, 
    703                      id=self.disable_disp.GetId()) 
     704                  id=self.disable_disp.GetId()) 
    704705        self.Bind(wx.EVT_RADIOBUTTON, self._set_dipers_Param, 
    705                    id=self.enable_disp.GetId()) 
     706                  id=self.enable_disp.GetId()) 
    706707        #MAC needs SetValue 
    707708        self.disable_disp.SetValue(True) 
     
    718719        ## fill a sizer for dispersion 
    719720        boxsizer1.Add(sizer_dispersion, 0, 
    720                 wx.TOP | wx.BOTTOM | wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 
    721                 border=5) 
     721                      wx.TOP|wx.BOTTOM|wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 
     722                      border=5) 
    722723        self.sizer4_4 = wx.GridBagSizer(6, 5) 
    723724 
     
    778779                        self._manager.parent._default_save_location 
    779780        dlg = wx.FileDialog(self, "Choose a file", self._default_save_location, 
    780                                         self.window_caption, "*.fitv", wx.SAVE) 
     781                            self.window_caption, "*.fitv", wx.SAVE) 
    781782 
    782783        if dlg.ShowModal() == wx.ID_OK: 
     
    784785            self._default_save_location = os.path.dirname(path) 
    785786            self._manager.parent._default_save_location = \ 
    786                                  self._default_save_location 
     787                                self._default_save_location 
    787788        else: 
    788789            return None 
     
    843844        # inform msg to wx 
    844845        wx.PostEvent(self._manager.parent, 
    845                     StatusEvent(status=msg, info=infor)) 
     846                     StatusEvent(status=msg, info=infor)) 
    846847 
    847848    def _get_time_stamp(self): 
     
    912913        try: 
    913914            if path == None: 
     915                status = " Selected Distribution was not loaded: %s" % path 
    914916                wx.PostEvent(self._manager.parent, 
    915                             StatusEvent(status=\ 
    916                             " Selected Distribution was not loaded: %s" % path)) 
     917                             StatusEvent(status=status)) 
    917918                return None, None 
    918919            input_f = open(path, 'r') 
     
    931932                except: 
    932933                    # Skip non-data lines 
    933                     logging.error(sys.exc_value) 
     934                    logging.error(sys.exc_info()[1]) 
    934935            return numpy.array(angles), numpy.array(weights) 
    935936        except: 
     
    10951096        ## save checkbutton state and txtcrtl values 
    10961097        self._copy_parameters_state(self.orientation_params, 
    1097                                      self.state.orientation_params) 
     1098                                    self.state.orientation_params) 
    10981099        self._copy_parameters_state(self.orientation_params_disp, 
    1099                                      self.state.orientation_params_disp) 
     1100                                    self.state.orientation_params_disp) 
    11001101        self._copy_parameters_state(self.parameters, self.state.parameters) 
    11011102        self._copy_parameters_state(self.fittable_param, 
    1102                                              self.state.fittable_param) 
     1103                                    self.state.fittable_param) 
    11031104        self._copy_parameters_state(self.fixed_param, self.state.fixed_param) 
    11041105 
     
    11361137            category_pos = 0 
    11371138            for ind_cat in range(self.categorybox.GetCount()): 
    1138                 if self.categorycombobox.GetString(ind_form) == \ 
     1139                if self.categorycombobox.GetString(ind_cat) == \ 
    11391140                                        state.categorycombobox: 
    11401141                    category_pos = int(ind_cat) 
     
    13651366            else: 
    13661367                self.model_view.SetLabel("1D Mode") 
    1367         # else: 
    1368  
    1369         if self._manager != None and self.engine_type != None: 
    1370             self._manager._on_change_engine(engine=self.engine_type) 
     1368         
    13711369        ## set the select all check box to the a given state 
    13721370        self.cb1.SetValue(state.cb1) 
     
    14801478                                 [state.values, state.weights] 
    14811479            except: 
    1482                 logging.error(sys.exc_value) 
     1480                logging.error(sys.exc_info()[1]) 
    14831481            selection = self._find_polyfunc_selection(disp_model) 
    14841482            for list in self.fittable_param: 
     
    14971495                            list[6].Disable() 
    14981496                        except: 
    1499                             logging.error(sys.exc_value) 
     1497                            logging.error(sys.exc_info()[1]) 
    15001498            # For array, disable all fixed params 
    15011499            if selection == 1: 
     
    15061504                            item[2].Disable() 
    15071505                        except: 
    1508                             logging.error(sys.exc_value) 
     1506                            logging.error(sys.exc_info()[1]) 
    15091507 
    15101508        # Make sure the check box updated when all checked 
     
    15201518                        self._manager.parent.get_save_location() 
    15211519        dlg = wx.FileDialog(self, "Choose a weight file", 
    1522                                 self._default_save_location, "", 
    1523                                 "*.*", wx.OPEN) 
     1520                            self._default_save_location, "", 
     1521                            "*.*", wx.OPEN) 
    15241522        path = None 
    15251523        if dlg.ShowModal() == wx.ID_OK: 
     
    15871585            try: 
    15881586                is_modified = self._check_value_enter(self.fittable_param, 
    1589                                                      is_modified) 
     1587                                                      is_modified) 
    15901588                is_modified = self._check_value_enter(self.fixed_param, 
    15911589                                                      is_modified) 
     
    15931591                                                      is_modified) 
    15941592            except: 
    1595                 logging.error(sys.exc_value) 
     1593                logging.error(sys.exc_info()[1]) 
    15961594 
    15971595            # Here we should check whether the boundaries have been modified. 
     
    16591657            self._check_value_enter(self.parameters, is_modified) 
    16601658 
    1661             # If qmin and qmax have been modified, update qmin and qmax and  
     1659            # If qmin and qmax have been modified, update qmin and qmax and 
    16621660            # Here we should check whether the boundaries have been modified. 
    1663             # If qmin and qmax have been modified, update qmin and qmax and  
     1661            # If qmin and qmax have been modified, update qmin and qmax and 
    16641662            # set the is_modified flag to True 
    16651663            self.fitrange = self._validate_qrange(self.qmin, self.qmax) 
     
    16811679                        flag = self.update_pinhole_smear() 
    16821680                    else: 
     1681                        enable_smearer = not self.disable_smearer.GetValue() 
    16831682                        self._manager.set_smearer(smearer=temp_smearer, 
    16841683                                                  uid=self.uid, 
     
    16861685                                                  qmin=float(self.qmin_x), 
    16871686                                                  qmax=float(self.qmax_x), 
    1688                             enable_smearer=not self.disable_smearer.GetValue(), 
    1689                                                       draw=False) 
     1687                                                  enable_smearer=enable_smearer, 
     1688                                                  draw=False) 
    16901689                elif not self._is_2D(): 
    16911690                    self._manager.set_smearer(smearer=temp_smearer, 
     
    17351734            self.save_current_state() 
    17361735        except: 
    1737             logging.error(sys.exc_value) 
     1736            logging.error(sys.exc_info()[1]) 
    17381737 
    17391738        return flag 
     
    19901989                    #                 StatusEvent(status=msg, info="error")) 
    19911990        except: 
    1992             msg = "%s\n" % (sys.exc_value) 
     1991            msg = "%s\n" % (sys.exc_info()[1]) 
    19931992            wx.PostEvent(self._manager.parent, 
    19941993                         StatusEvent(status=msg, info="error")) 
     
    19961995 
    19971996    def _on_modify_cat(self, event=None): 
     1997        """ 
     1998        Called when category manager is opened 
     1999        """ 
    19982000        self._manager.parent.on_category_panel(event) 
    19992001 
     
    20592061                else: 
    20602062                    tcrtl.SetBackgroundColour("pink") 
    2061                     msg = "Model Error: wrong value entered: %s" % sys.exc_value 
     2063                    msg = "Model Error: wrong value entered: %s" % \ 
     2064                                    sys.exc_info()[1] 
    20622065                    wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    20632066                    return 
    20642067            except: 
    20652068                tcrtl.SetBackgroundColour("pink") 
    2066                 msg = "Model Error: wrong value entered: %s" % sys.exc_value 
     2069                msg = "Model Error: wrong value entered: %s" % sys.exc_info()[1] 
    20672070                wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    20682071                return 
     
    21162119                else: 
    21172120                    tcrtl.SetBackgroundColour("pink") 
    2118                     msg = "Model Error: wrong value entered: %s" % sys.exc_value 
     2121                    msg = "Model Error: wrong value entered: %s" % \ 
     2122                                        sys.exc_info()[1] 
    21192123                    wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 
    21202124                    return 
    21212125            except: 
    21222126                tcrtl.SetBackgroundColour("pink") 
    2123                 msg = "Model Error: wrong value entered: %s" % sys.exc_value 
     2127                msg = "Model Error: wrong value entered: %s" % sys.exc_info()[1] 
    21242128                wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 
    21252129                return 
     
    25512555                    self.model.set_dispersion(p, disp_model) 
    25522556                except: 
    2553                     logging.error(sys.exc_value) 
     2557                    logging.error(sys.exc_info()[1]) 
    25542558 
    25552559        ## save state into 
     
    27642768            del self.state.model._persistency_dict[name.split('.')[0]] 
    27652769        except: 
    2766             logging.error(sys.exc_value) 
     2770            logging.error(sys.exc_info()[1]) 
    27672771 
    27682772    def _lay_out(self): 
     
    29102914            except: 
    29112915                # Not for control panels 
    2912                 logging.error(sys.exc_value) 
     2916                logging.error(sys.exc_info()[1]) 
    29132917        # Make sure the resduals plot goes to the last 
    29142918        if res_item != None: 
     
    32263230                    disfunc = str(item[7].GetValue()) 
    32273231            except: 
    3228                 logging.error(sys.exc_value) 
     3232                logging.error(sys.exc_info()[1]) 
    32293233 
    32303234            # 2D 
     
    32613265                        disfunc += ' ' + str(weight) 
    32623266            except: 
    3263                 logging.error(sys.exc_value) 
     3267                logging.error(sys.exc_info()[1]) 
    32643268            content += name + ',' + str(check) + ',' + value + disfunc + ':' 
    32653269 
     
    34623466                            is_array = True 
    34633467                except: 
    3464                     logging.error(sys.exc_value) 
     3468                    logging.error(sys.exc_info()[1]) 
    34653469                if not is_array: 
    34663470                    self._disp_obj_dict[name] = disp_model 
     
    34773481 
    34783482            except: 
    3479                 logging.error(sys.exc_value) 
    3480                 print "Error in BasePage._paste_poly_help: %s" % sys.exc_value 
     3483                logging.error(sys.exc_info()[1]) 
     3484                print "Error in BasePage._paste_poly_help: %s" % \ 
     3485                                        sys.exc_info()[1] 
    34813486 
    34823487    def _set_disp_array_cb(self, item): 
     
    35023507        return 
    35033508 
    3504  
    3505  
    3506  
    35073509    def _read_category_info(self): 
    35083510        """ 
    35093511        Reads the categories in from file 
    35103512        """ 
    3511  
    35123513        # # ILL mod starts here - July 2012 kieranrcampbell@gmail.com 
    35133514        self.master_category_dict = defaultdict(list) 
     
    35233524            self._regenerate_model_dict() 
    35243525            cat_file.close() 
    3525  
    35263526        except IOError: 
    35273527            raise 
     
    35363536        along with the enabled mapping 
    35373537        """ 
    3538  
    35393538        self.by_model_dict = defaultdict(list) 
    35403539        for category in self.master_category_dict: 
     
    35643563            self.categorybox.SetSelection(\ 
    35653564                self.categorybox.GetSelection()) 
    3566  
    35673565        #self._on_change_cat(None) 
    3568  
    35693566 
    35703567    def _on_change_cat(self, event): 
     
    35883585                if(enabled): 
    35893586                    self.model_box.Append(model) 
    3590  
    3591  
    3592  
    35933587 
    35943588    def _fill_model_sizer(self, sizer): 
     
    36543648 
    36553649        sizer_radiobutton = wx.GridSizer(2, 2, 5, 5) 
    3656  
    3657  
    36583650        #sizer_radiobutton.Add(self.shape_rbutton) 
    36593651        #sizer_radiobutton.Add(self.shape_indep_rbutton) 
Note: See TracChangeset for help on using the changeset viewer.