Пример #1
0
 def _getField(self, name, const):
     field = Field._getField(self, name, const)
     if field is None:
         if name in self._fields:
             field = self._fields[name]
         elif self._field_generator is not None and not const:
             field = self._feedUntil(name)
     return field
Пример #2
0
 def _getField(self, name, const):
     field = Field._getField(self, name, const)
     if field is None:
         if name in self._fields:
             field = self._fields[name]
         elif self._field_generator is not None and not const:
             field = self._feedUntil(name)
     return field
 def _getField(self, key, const):
     field = Field._getField(self, key, const)
     if field is not None:
         return field
     if key in self._field_dict:
         return self._field_dict[key]
     if self._generator and not const:
         try:
             while True:
                 field = self._feedOne()
                 if field.name == key:
                     return field
         except StopIteration:
             self._stopFeed()
         except HACHOIR_ERRORS, err:
             self.error("Error: %s" % makeUnicode(err))
             self._stopFeed()
Пример #4
0
 def _getField(self, key, const):
     field = Field._getField(self, key, const)
     if field is not None:
         return field
     if key in self._field_dict:
         return self._field_dict[key]
     if self._generator and not const:
         try:
             while True:
                 field = self._feedOne()
                 if field.name == key:
                     return field
         except StopIteration:
             self._stopFeed()
         except HACHOIR_ERRORS, err:
             self.error("Error: %s" % makeUnicode(err))
             self._stopFeed()