from mediagoblin.media_types import MediaManagerBase
from mediagoblin.media_types.ascii.processing import AsciiProcessingManager, \
sniff_handler
-from mediagoblin.tools import pluginapi
ACCEPTED_EXTENSIONS = ["txt", "asc", "nfo"]
MEDIA_TYPE = 'mediagoblin.media_types.ascii'
-def setup_plugin():
- config = pluginapi.get_config(MEDIA_TYPE)
-
-
class ASCIIMediaManager(MediaManagerBase):
human_readable = "ASCII"
display_template = "mediagoblin/media_displays/ascii.html"
hooks = {
- 'setup': setup_plugin,
'get_media_type_and_manager': get_media_type_and_manager,
('media_manager', MEDIA_TYPE): lambda: ASCIIMediaManager,
('reprocess_manager', MEDIA_TYPE): lambda: AsciiProcessingManager,
from mediagoblin.media_types import MediaManagerBase
from mediagoblin.media_types.image.processing import sniff_handler, \
ImageProcessingManager
-from mediagoblin.tools import pluginapi
+
_log = logging.getLogger(__name__)
MEDIA_TYPE = 'mediagoblin.media_types.image'
-def setup_plugin():
- config = pluginapi.get_config('mediagoblin.media_types.image')
-
-
class ImageMediaManager(MediaManagerBase):
human_readable = "Image"
display_template = "mediagoblin/media_displays/image.html"
hooks = {
- 'setup': setup_plugin,
'get_media_type_and_manager': get_media_type_and_manager,
'sniff_handler': sniff_handler,
('media_manager', MEDIA_TYPE): lambda: ImageMediaManager,
from mediagoblin.media_types import MediaManagerBase
from mediagoblin.media_types.pdf.processing import PdfProcessingManager, \
sniff_handler
-from mediagoblin.tools import pluginapi
+
ACCEPTED_EXTENSIONS = ['pdf']
MEDIA_TYPE = 'mediagoblin.media_types.pdf'
-def setup_plugin():
- config = pluginapi.get_config(MEDIA_TYPE)
-
-
class PDFMediaManager(MediaManagerBase):
human_readable = "PDF"
display_template = "mediagoblin/media_displays/pdf.html"
hooks = {
- 'setup': setup_plugin,
'get_media_type_and_manager': get_media_type_and_manager,
'sniff_handler': sniff_handler,
('media_manager', MEDIA_TYPE): lambda: PDFMediaManager,
from mediagoblin.media_types import MediaManagerBase
from mediagoblin.media_types.stl.processing import StlProcessingManager, \
sniff_handler
-from mediagoblin.tools import pluginapi
+
MEDIA_TYPE = 'mediagoblin.media_types.stl'
ACCEPTED_EXTENSIONS = ["obj", "stl"]
-def setup_plugin():
- config = pluginapi.get_config(MEDIA_TYPE)
-
-
class STLMediaManager(MediaManagerBase):
human_readable = "stereo lithographics"
display_template = "mediagoblin/media_displays/stl.html"
return MEDIA_TYPE, STLMediaManager
hooks = {
- 'setup': setup_plugin,
'get_media_type_and_manager': get_media_type_and_manager,
'sniff_handler': sniff_handler,
('media_manager', MEDIA_TYPE): lambda: STLMediaManager,
from mediagoblin.media_types import MediaManagerBase
from mediagoblin.media_types.video.processing import VideoProcessingManager, \
sniff_handler
-from mediagoblin.tools import pluginapi
+
MEDIA_TYPE = 'mediagoblin.media_types.video'
ACCEPTED_EXTENSIONS = [
"mp4", "mov", "webm", "avi", "3gp", "3gpp", "mkv", "ogv", "m4v"]
-def setup_plugin():
- config = pluginapi.get_config(MEDIA_TYPE)
-
-
class VideoMediaManager(MediaManagerBase):
human_readable = "Video"
display_template = "mediagoblin/media_displays/video.html"
return MEDIA_TYPE, VideoMediaManager
hooks = {
- 'setup': setup_plugin,
'get_media_type_and_manager': get_media_type_and_manager,
'sniff_handler': sniff_handler,
('media_manager', MEDIA_TYPE): lambda: VideoMediaManager,