示例#1
0
文件: bcd.py 项目: kupiakos/pybcd
 def __getitem__(self, guid):
     guid = guid_bracket(guid)
     for o in self.objects:
         if o.guid == guid or knownguids.get(o.guid,[None])[0] == guid:
             return o
     else:
         raise KeyError('No guid ' + guid)
示例#2
0
 def __getitem__(self, guid):
     guid = guid_bracket(guid)
     for o in self.objects:
         if o.guid == guid or knownguids.get(o.guid, [None])[0] == guid:
             return o
     else:
         raise KeyError('No guid ' + guid)
示例#3
0
文件: bcd.py 项目: kupiakos/pybcd
 def guid_to_known(self, guid):
     guid = guid_bracket(guid)
     
     v = knownguids.get(guid)
     
     if v:
         return v[0]
         
     default = self.default
     
     if default and guid == default.guid:
         return '{default}'
     else:
         return guid
示例#4
0
    def guid_to_known(self, guid):
        guid = guid_bracket(guid)

        v = knownguids.get(guid)

        if v:
            return v[0]

        default = self.default

        if default and guid == default.guid:
            return '{default}'
        else:
            return guid