Esempio n. 1
0
def convert_file(self, h, path, p, metadata, processor_state, ignore_limit):
    f = File.from_hash(h)

    if p not in processor_table:
        p = 'default'

    processor = processor_table[p](path, f, processor_state, ignore_limit)

    # Execute the synchronous step.
    processor.sync()

    # Save compression information
    f = File.from_hash(
        h
    )  # Reload file; user might have changed the config vector while processing
    f.compression = compression_rate(path, f)
    f.metadata = json.dumps(metadata)
    f.save()

    # Notify frontend: sync step is done.
    self.update_state(state="READY")

    # Execute the asynchronous step.
    processor.important = False
    processor. async ()
Esempio n. 2
0
def convert_file(self, h, path, p, extra):
    f = File.from_hash(h)

    if p not in processor_table:
        p = 'default'

    processor = processor_table[p](path, f, extra)

    # Execute the synchronous step.
    processor.sync()

    # Save compression information
    f.compression = compression_rate(path, f)
    f.save()

    # Notify frontend: sync step is done.
    self.update_state(state="READY")

    # Execute the asynchronous step.
    processor.important = False
    processor.async()
Esempio n. 3
0
def convert_file(self, h, path, p, metadata, processor_state, ignore_limit):
    f = File.from_hash(h)

    if p not in processor_table:
        p = 'default'

    processor = processor_table[p](path, f, processor_state, ignore_limit)

    # Execute the synchronous step.
    processor.sync()

    # Save compression information
    f = File.from_hash(h) # Reload file; user might have changed the config vector while processing
    f.compression = compression_rate(path, f)
    f.metadata = json.dumps(metadata)
    f.save()

    # Notify frontend: sync step is done.
    self.update_state(state="READY")

    # Execute the asynchronous step.
    processor.important = False
    processor.async()