Пример #1
0
    def __setitem__(self, field_name, value):
        if fofu.is_frame_number(field_name) and (self.media_type == "video"):
            self.frames[field_name] = value
            return

        self._secure_media(field_name, value)
        self.set_field(field_name, value=value)
Пример #2
0
    def __getitem__(self, field_name):
        if fofu.is_frame_number(field_name) and self.media_type == fomm.VIDEO:
            return self.frames[field_name]

        if field_name == "frames" and self.media_type == fomm.VIDEO:
            return self._frames._serve(self)

        try:
            return self.get_field(field_name)
        except AttributeError:
            raise KeyError("%s has no field '%s'" %
                           (self.__class__.__name__, field_name))
Пример #3
0
 def validate(self, value):
     try:
         fofu.is_frame_number(value)
     except fofu.FrameError as e:
         self.error(str(e))