예제 #1
0
    def execute(self,
                workspace,       # workspace object
                item_id,         # item pk
                source_variant,  # name of the variant
                output_variant,  # name of the variat
                output_preset,   # a mime type or a Mediadart PRESET
                **preset_params  # additional parameters (see adapter server for explanation)
                ):

        log.info('%s.execute' % self)
        log.info('output_preset %s'%output_preset)
        log.info('self.presets %s'%self.presets)
        if output_preset not in self.presets:
            raise  Exception('%s: unsupported output_preset' % (self, output_preset))

        try:
            output_type = Type.objects.get_or_create_by_mime(self.presets[output_preset])
            item, source = get_source_rendition(item_id, source_variant, workspace)
            output_variant_obj = Variant.objects.get(name = output_variant)
            output_component = item.create_variant(output_variant_obj, workspace, output_type)
            output_component.source = source
            output_file = get_storage_file_name(item.ID, workspace.pk, output_variant_obj.name, output_type.ext)
        except Exception, e:
            self.deferred.errback(Failure(e))
            return
예제 #2
0
    def __init__(self, workspace, item_id, variant_name):
        self.workspace = workspace
        self.item = Item.objects.get(pk = item_id)
        self.item, self.component = get_source_rendition(item_id, variant_name, workspace)

        self.ctype = None
        self.result = []
예제 #3
0
    def execute(
        self,
        workspace,  # workspace object
        item_id,  # item pk
        source_variant,  # name of the variant
        output_variant,  # name of the variat
        output_preset,  # a mime type or a Mediadart PRESET
        **preset_params  # additional parameters (see adapter server for explanation)
    ):

        log.info("%s.execute" % self)
        log.info("output_preset %s" % output_preset)
        log.info("self.presets %s" % self.presets)
        if output_preset not in self.presets:
            raise Exception("%s: unsupported output_preset" % (self, output_preset))

        try:
            output_type = Type.objects.get_or_create_by_mime(self.presets[output_preset])
            item, source = get_source_rendition(item_id, source_variant, workspace)
            output_variant_obj = Variant.objects.get(name=output_variant)
            output_component = item.create_variant(output_variant_obj, workspace, output_type)
            output_component.source = source
            output_file = get_storage_file_name(item.ID, workspace.pk, output_variant_obj.name, output_type.ext)
        except Exception, e:
            self.deferred.errback(Failure(e))
            return
예제 #4
0
 def __init__(self, deferred, workspace, item_id, source_variant_name):    
     if self.get_cmdline is None:
         raise Exception('Analyzer is an abstract base class: instantiate a derived class')
     self.deferred = deferred
     self._fc = Storage()
     self.workspace = workspace
     self.item, self.source = get_source_rendition(item_id, source_variant_name, workspace)
예제 #5
0
 def __init__(self, deferred, workspace, item_id, variant_name):
     self.deferred = deferred
     self.workspace = workspace
     self.proxy = Proxy('XMPEmbedder')
     self.item = Item.objects.get(pk=item_id)
     self.item, self.component = get_source_rendition(
         item_id, variant_name, workspace)
예제 #6
0
    def __init__(self, deferred, workspace, item_id, variant_name):
        self.deferred = deferred
        self.proxy = Proxy("XMPExtractor")
        self.workspace = workspace
        self.item = Item.objects.get(pk=item_id)
        self.item, self.component = get_source_rendition(item_id, variant_name, workspace)

        self.ctype = None
        self.result = []
예제 #7
0
파일: adapter.py 프로젝트: relic7/nd1404
 def __init__(self, workspace, item_id, source_variant_name):    
     if self.get_cmdline is None:
         raise Exception('Adapter is an abstract base class: instantiate a derived class')
     self.workspace = workspace
     self.item, self.source = get_source_rendition(item_id, source_variant_name, workspace)
예제 #8
0
 def __init__(self, deferred, workspace, item_id, variant_name):
     self.deferred = deferred
     self.workspace = workspace
     self.proxy = Proxy('XMPEmbedder') 
     self.item = Item.objects.get(pk = item_id)
     self.item, self.component = get_source_rendition(item_id, variant_name, workspace)