1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- """
- media (Media Tools)
- ===================
-
- **Author:**
-
- * Dirk Alders <sudo-dirk@mount-mockery.de>
-
- **Description:**
-
- This module helps on all issues with media files, like tags (e.g. exif, id3) and transformations.
-
- **Submodules:**
-
- * :func:`media.get_media_data`
-
- **Unittest:**
-
- See also the :download:`unittest <../../media/_testresults_/unittest.pdf>` documentation.
- """
- __DEPENDENCIES__ = []
-
- import logging
- from media import metadata
-
- logger_name = 'MEDIA'
- logger = logging.getLogger(logger_name)
-
-
- __DESCRIPTION__ = """The Module {\\tt %s} is designed to help on all issues with media files, like tags (e.g. exif, id3) and transformations.
- For more Information read the documentation.""" % __name__.replace('_', '\_')
- """The Module Description"""
- __INTERPRETER__ = (3, )
- """The Tested Interpreter-Versions"""
-
-
- def get_media_data(full_path):
- ft = metadata.get_filetype(full_path)
- #
- if ft == metadata.FILETYPE_AUDIO:
- return metadata.get_audio_data(full_path)
- elif ft == metadata.FILETYPE_IMAGE:
- return metadata.get_image_data(full_path)
- elif ft == metadata.FILETYPE_VIDEO:
- return metadata.get_video_data(full_path)
- else:
- logger.warning('Filetype not known: %s', full_path)
|