Example #1
0
    def results(self):
        d = routines.obj_to_dict(self)
        results = {}
        for section in d.keys():
            results[section] = {}
            for method in d[section].keys():
                s = d[section][method]
                if s.get('Value', False) is not False:
                    results[section][method] = {'short': s['Short'],
                                                'symbol': s['Symbol'],
                                                'value': s['Value'],
                                                'unit': s['Unit'],
                                                'latexname': s.get('LatexName')}

        return results
Example #2
0
 def xml(self, filename=None):
     d = routines.obj_to_dict(self)
     if not filename:
         return routines.dict_to_xml(d)
     routines.dict_to_xml(d, filename=filename)