コード例 #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