Commit e7d81d35 authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: According to Gabriel, convertFile() only work with format, not mimetype.

Also update Interface for other methods based on the manager implementation.

WIP because: convertBundle() too? but it is not implemented anywhere so remove?
parent 8945f3a0
Pipeline #6332 failed with stage
in 0 seconds
...@@ -33,12 +33,12 @@ class IManager(Interface): ...@@ -33,12 +33,12 @@ class IManager(Interface):
"""Provides public method to communicate with Cloudooo clients """Provides public method to communicate with Cloudooo clients
""" """
def convertFile(content, source_mimetype, destination_mimetype, **kw): def convertFile(content, source_format, destination_format, **kw):
"""Returns the converted file in the given format. """Returns the converted file in the given format.
content : binary data to convert content : binary data to convert
source_mimetype : mimetype of given content source_format : input format (extension without '.')
destination_mimetype : expected output conversion mimetype destination_format : output conversion format (extension without '.')
**kw holds specific parameters for the conversion **kw holds specific parameters for the conversion
""" """
...@@ -59,17 +59,17 @@ class IManager(Interface): ...@@ -59,17 +59,17 @@ class IManager(Interface):
**kw holds specific parameters for the conversion **kw holds specific parameters for the conversion
""" """
def getFileMetadataItemList(content, source_mimetype): def getFileMetadataItemList(content, source_format):
"""Returns a list key, value pairs representing the """Returns a list key, value pairs representing the
metadata values for the document. The structure of this metadata values for the document. The structure of this
list is "unpredictable" and follows the convention of each file. list is "unpredictable" and follows the convention of each file.
content : binary data where to reads metadata content : binary data where to reads metadata
source_mimetype : mimetype of given content source_format : input format (extension without '.')
""" """
def convertFileAndGetMetadataItemList(content, source_mimetype, def convertFileAndGetMetadataItemList(content, source_format,
destination_mimetype, **kw): destination_format, **kw):
"""returns a converted version of provided content plus a """returns a converted version of provided content plus a
dictionary of extracted metadata. dictionary of extracted metadata.
signature of method is same as convertFile signature of method is same as convertFile
...@@ -78,12 +78,12 @@ class IManager(Interface): ...@@ -78,12 +78,12 @@ class IManager(Interface):
'metadata' entries. 'metadata' entries.
""" """
def updateFileMetadata(content, source_mimetype, metadata_dict): def updateFileMetadata(content, source_format, metadata_dict):
"""Updates the content with provided metadata and """Updates the content with provided metadata and
return the new file. return the new file.
content : binary data to convert content : binary data to convert
source_mimetype : mimetype of given content source_format : input format (extension without '.')
metadata_dict : Metadatas to include in content metadata_dict : Metadatas to include in content
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment