From: Christopher Allan Webber Date: Sun, 25 Aug 2013 18:59:34 +0000 (-0500) Subject: Removing unnecessary "setup_plugin()" calls, as pointed out by Velmont. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7b12cbd98b76c0b437e06e78da1406cab34996dc;p=mediagoblin.git Removing unnecessary "setup_plugin()" calls, as pointed out by Velmont. --- diff --git a/mediagoblin/media_types/ascii/__init__.py b/mediagoblin/media_types/ascii/__init__.py index b0f7551d..1ee44988 100644 --- a/mediagoblin/media_types/ascii/__init__.py +++ b/mediagoblin/media_types/ascii/__init__.py @@ -17,16 +17,11 @@ 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" @@ -39,7 +34,6 @@ def get_media_type_and_manager(ext): 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, diff --git a/mediagoblin/media_types/image/__init__.py b/mediagoblin/media_types/image/__init__.py index 99643409..06e0f08f 100644 --- a/mediagoblin/media_types/image/__init__.py +++ b/mediagoblin/media_types/image/__init__.py @@ -19,7 +19,7 @@ import logging 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__) @@ -28,10 +28,6 @@ ACCEPTED_EXTENSIONS = ["jpg", "jpeg", "png", "gif", "tiff"] 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" @@ -67,7 +63,6 @@ def get_media_type_and_manager(ext): hooks = { - 'setup': setup_plugin, 'get_media_type_and_manager': get_media_type_and_manager, 'sniff_handler': sniff_handler, ('media_manager', MEDIA_TYPE): lambda: ImageMediaManager, diff --git a/mediagoblin/media_types/pdf/__init__.py b/mediagoblin/media_types/pdf/__init__.py index bc5c373b..de70389e 100644 --- a/mediagoblin/media_types/pdf/__init__.py +++ b/mediagoblin/media_types/pdf/__init__.py @@ -17,16 +17,12 @@ 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" @@ -39,7 +35,6 @@ def get_media_type_and_manager(ext): hooks = { - 'setup': setup_plugin, 'get_media_type_and_manager': get_media_type_and_manager, 'sniff_handler': sniff_handler, ('media_manager', MEDIA_TYPE): lambda: PDFMediaManager, diff --git a/mediagoblin/media_types/stl/__init__.py b/mediagoblin/media_types/stl/__init__.py index 7170a45b..d5b56b4b 100644 --- a/mediagoblin/media_types/stl/__init__.py +++ b/mediagoblin/media_types/stl/__init__.py @@ -17,16 +17,12 @@ 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" @@ -38,7 +34,6 @@ def get_media_type_and_manager(ext): 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, diff --git a/mediagoblin/media_types/video/__init__.py b/mediagoblin/media_types/video/__init__.py index 0ed19d1b..c85cc0b2 100644 --- a/mediagoblin/media_types/video/__init__.py +++ b/mediagoblin/media_types/video/__init__.py @@ -17,17 +17,13 @@ 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" @@ -43,7 +39,6 @@ def get_media_type_and_manager(ext): 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,