From: olivier <> Date: Wed, 11 Apr 2007 08:25:27 +0000 (+0000) Subject: moved export package into main app folder X-Git-Tag: 1.1~991 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d4a79f6549494dae2e4bb2d048d97c86471083ff;p=telemeta.git moved export package into main app folder --- diff --git a/export/__init__.py b/export/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/export/api.py b/export/api.py deleted file mode 100644 index 6cce485a..00000000 --- a/export/api.py +++ /dev/null @@ -1,56 +0,0 @@ - -class IExporter: - """Export driver interface""" - - # Remark: the method prototypes do not include any self or cls argument - # because an interface is meant to show what methods a class must expose - # from the caller's point of view. However, when implementing the class - # you'll obviously want to include this extra argument. - - def get_format(): - """Return the export/encoding format as a short string - Example: "MP3", "OGG", "AVI", ... - """ - - def get_description(): - """Return a string describing what this export format provides, is good - for, etc... The description is meant to help the end user decide what - format is good for him/her - """ - - def get_file_extension(): - """Return the filename extension corresponding to this export format""" - - def get_mime_type(): - """Return the mime type corresponding to this export format""" - - def set_cache_directory(path): - """Set the directory where cached files should be stored. Does nothing - if the exporter doesn't support caching. - - The driver shouldn't assume that this method will always get called. A - temporary directory should be used if that's not the case. - """ - - def process(item_id, source, metadata): - """Perform the exporting process and return the absolute path - to the resulting file. - - item_id is the media item id that uniquely identifies this audio/video - resource - - source is the audio/video source file absolute path. For audio that should - be a WAV file - - metadata is a dictionary - - The returned file path is not meant to be permanent in any way, it - should be considered temporary/volatile by the caller. - - It is highly recommended that export drivers implement some sort of cache - instead of re-encoding each time process() is called. - - It should be possible to make subsequent calls to process() with different - items, using the same driver instance. - """ - diff --git a/telemeta/export/__init__.py b/telemeta/export/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/telemeta/export/api.py b/telemeta/export/api.py new file mode 100644 index 00000000..6cce485a --- /dev/null +++ b/telemeta/export/api.py @@ -0,0 +1,56 @@ + +class IExporter: + """Export driver interface""" + + # Remark: the method prototypes do not include any self or cls argument + # because an interface is meant to show what methods a class must expose + # from the caller's point of view. However, when implementing the class + # you'll obviously want to include this extra argument. + + def get_format(): + """Return the export/encoding format as a short string + Example: "MP3", "OGG", "AVI", ... + """ + + def get_description(): + """Return a string describing what this export format provides, is good + for, etc... The description is meant to help the end user decide what + format is good for him/her + """ + + def get_file_extension(): + """Return the filename extension corresponding to this export format""" + + def get_mime_type(): + """Return the mime type corresponding to this export format""" + + def set_cache_directory(path): + """Set the directory where cached files should be stored. Does nothing + if the exporter doesn't support caching. + + The driver shouldn't assume that this method will always get called. A + temporary directory should be used if that's not the case. + """ + + def process(item_id, source, metadata): + """Perform the exporting process and return the absolute path + to the resulting file. + + item_id is the media item id that uniquely identifies this audio/video + resource + + source is the audio/video source file absolute path. For audio that should + be a WAV file + + metadata is a dictionary + + The returned file path is not meant to be permanent in any way, it + should be considered temporary/volatile by the caller. + + It is highly recommended that export drivers implement some sort of cache + instead of re-encoding each time process() is called. + + It should be possible to make subsequent calls to process() with different + items, using the same driver instance. + """ +