Exemplo n.º 1
0
def remove_marker(object):
    changed = False
    if IVideo.providedBy(object):
        noLongerProvides(object, IVideo)
        changed = True
    if IAudio.providedBy(object):
        noLongerProvides(object, IAudio)
        changed = True
    if changed:
        object.reindexObject(idxs=['object_provides'])
Exemplo n.º 2
0
def remove_marker(object):
    changed = False
    if IVideo.providedBy(object):
        noLongerProvides(object, IVideo)
        changed = True
    if IAudio.providedBy(object):
        noLongerProvides(object, IAudio)
        changed = True
    if changed:
        object.reindexObject(idxs=['object_provides'])
Exemplo n.º 3
0
    def handleAudio(self):
        handle = self.file_handle
        metadata = parse_raw(handle)
        handle.close()

        if not IAudio.providedBy(self.content):
            alsoProvides(self.content, IAudio)
            self.object.reindexObject(idxs=['object_provides'])

        info = IMediaInfo(self.content)
        info.height = defensive_get(metadata, 'height')
        info.width = defensive_get(metadata, 'width')
        info.duration = defensive_get(metadata, 'duration')
Exemplo n.º 4
0
    def handleAudio(self):
        handle = self.file_handle
        metadata = parse_raw(handle)
        handle.close()

        if not IAudio.providedBy(self.content):
            alsoProvides(self.content, IAudio)
            self.object.reindexObject(idxs=['object_provides'])

        info = IMediaInfo(self.content)
        info.height = defensive_get(metadata, 'height')
        info.width = defensive_get(metadata, 'width')
        info.duration = defensive_get(metadata, 'duration')
Exemplo n.º 5
0
 def update(self):
     if self.isAudio is None:
         self.isAudio = IAudio.providedBy(self.context)
     if self.isVideo is None:
         self.isVideo = IVideo.providedBy(self.context)
Exemplo n.º 6
0
 def update(self):
     if self.isAudio is None:
         self.isAudio = IAudio.providedBy(self.context)
     if self.isVideo is None:
         self.isVideo = IVideo.providedBy(self.context)