media/__init__.py

51 lines
1.3 KiB
Python
Raw Normal View History

2020-01-27 09:16:53 +01:00
#!/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`
2020-01-27 09:16:53 +01:00
**Unittest:**
See also the :download:`unittest <../../media/_testresults_/unittest.pdf>` documentation.
"""
__DEPENDENCIES__ = []
import logging
from media import metadata
2020-01-27 09:16:53 +01:00
logger_name = 'MEDIA'
2020-01-27 09:16:53 +01:00
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, )
2020-01-27 09:16:53 +01:00
"""The Tested Interpreter-Versions"""
def get_media_data(full_path):
ft = metadata.get_filetype(full_path)
2020-01-27 09:16:53 +01:00
#
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)
2020-01-27 09:16:53 +01:00
else:
logger.warning('Filetype not known: %s', full_path)