From b33feb18a77fcd9ff5b9c0cdb9ed6d81c467e759 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 28 Aug 2013 11:11:41 -0500 Subject: Fix failing to build docs --- mediagoblin/tools/staticdirect.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'mediagoblin') diff --git a/mediagoblin/tools/staticdirect.py b/mediagoblin/tools/staticdirect.py index ef8b20d0..8381b8b6 100644 --- a/mediagoblin/tools/staticdirect.py +++ b/mediagoblin/tools/staticdirect.py @@ -35,7 +35,8 @@ class StaticDirect(object): staticdirect to. In general, you should supply a None domain, as that's the "default" domain. - Things work like this: + Things work like this:: + >>> staticdirect = StaticDirect( ... {None: "/static/", ... "theme": "http://example.org/themestatic/"}) @@ -69,17 +70,18 @@ class PluginStatic(object): This has two mandatory attributes that you must pass in on class init: - - name: this name will be both used for lookup in "urlgen" for - your plugin's static resources and for the subdirectory that - it'll be "mounted" to for serving via your web browser. It - *MUST* be unique. If writing a plugin bundled with MediaGoblin - please use the pattern 'coreplugin__foo' where 'foo' is your - plugin name. All external plugins should use their modulename, - so if your plugin is 'mg_bettertags' you should also call this - name 'mg_bettertags'. - - file_path: the directory your plugin's static resources are - located in. It's recommended that you use - pkg_resources.resource_filename() for this. + + - *name:* this name will be both used for lookup in "urlgen" for + your plugin's static resources and for the subdirectory that + it'll be "mounted" to for serving via your web browser. It + *MUST* be unique. If writing a plugin bundled with MediaGoblin + please use the pattern 'coreplugin__foo' where 'foo' is your + plugin name. All external plugins should use their modulename, + so if your plugin is 'mg_bettertags' you should also call this + name 'mg_bettertags'. + - *file_path:* the directory your plugin's static resources are + located in. It's recommended that you use + pkg_resources.resource_filename() for this. An example of using this:: -- cgit v1.2.3 From 93874d0a662fc3abd73c56ad3939a13f3d372493 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Wed, 28 Aug 2013 07:56:44 -0700 Subject: image media_type now have their own config_spec.ini --- mediagoblin/config_spec.ini | 6 ------ mediagoblin/media_types/image/config_spec.ini | 7 +++++++ mediagoblin/media_types/image/processing.py | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 mediagoblin/media_types/image/config_spec.ini (limited to 'mediagoblin') diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index 8f03509d..790c31a5 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -104,12 +104,6 @@ max_height = integer(default=640) max_width = integer(default=180) max_height = integer(default=180) -[media_type:mediagoblin.media_types.image] -# One of BICUBIC, BILINEAR, NEAREST, ANTIALIAS -resize_filter = string(default="ANTIALIAS") -#level of compression used when resizing images -quality = integer(default=90) - [media_type:mediagoblin.media_types.video] # Should we keep the original file? keep_original = boolean(default=False) diff --git a/mediagoblin/media_types/image/config_spec.ini b/mediagoblin/media_types/image/config_spec.ini new file mode 100644 index 00000000..08111df2 --- /dev/null +++ b/mediagoblin/media_types/image/config_spec.ini @@ -0,0 +1,7 @@ +[plugin_spec] +# One of BICUBIC, BILINEAR, NEAREST, ANTIALIAS +resize_filter = string(default="ANTIALIAS") +#level of compression used when resizing images +quality = integer(default=90) + + diff --git a/mediagoblin/media_types/image/processing.py b/mediagoblin/media_types/image/processing.py index 088979bc..555a0e0a 100644 --- a/mediagoblin/media_types/image/processing.py +++ b/mediagoblin/media_types/image/processing.py @@ -138,8 +138,8 @@ class CommonImageProcessor(MediaProcessor): """ Set up the workbench directory and pull down the original file """ - self.image_config = mgg.global_config[ - 'media_type:mediagoblin.media_types.image'] + self.image_config = mgg.global_config['plugins'][ + 'mediagoblin.media_types.image'] ## @@: Should this be two functions? # Conversions subdirectory to avoid collisions -- cgit v1.2.3 From 9a6741d7bfa091ebbebfc5f657dca2e8995f814a Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Wed, 28 Aug 2013 08:10:47 -0700 Subject: video media_type now have their own config_spec.ini --- mediagoblin/config_spec.ini | 21 --------------------- mediagoblin/media_types/video/config_spec.ini | 22 ++++++++++++++++++++++ mediagoblin/media_types/video/processing.py | 2 +- mediagoblin/media_types/video/util.py | 2 +- .../mediagoblin/media_displays/video.html | 2 +- 5 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 mediagoblin/media_types/video/config_spec.ini (limited to 'mediagoblin') diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index 790c31a5..eb00b07c 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -104,27 +104,6 @@ max_height = integer(default=640) max_width = integer(default=180) max_height = integer(default=180) -[media_type:mediagoblin.media_types.video] -# Should we keep the original file? -keep_original = boolean(default=False) - -# 0 means autodetect, autodetect means number_of_CPUs - 1 -vp8_threads = integer(default=0) -# Range: 0..10 -vp8_quality = integer(default=8) -# Range: -0.1..1 -vorbis_quality = float(default=0.3) - -# Autoplay the video when page is loaded? -auto_play = boolean(default=False) - -[[skip_transcode]] -mime_types = string_list(default=list("video/webm")) -container_formats = string_list(default=list("Matroska")) -video_codecs = string_list(default=list("VP8 video")) -audio_codecs = string_list(default=list("Vorbis")) -dimensions_match = boolean(default=True) - [media_type:mediagoblin.media_types.audio] keep_original = boolean(default=True) # vorbisenc quality diff --git a/mediagoblin/media_types/video/config_spec.ini b/mediagoblin/media_types/video/config_spec.ini new file mode 100644 index 00000000..98714f56 --- /dev/null +++ b/mediagoblin/media_types/video/config_spec.ini @@ -0,0 +1,22 @@ +[plugin_spec] +# Should we keep the original file? +keep_original = boolean(default=False) + +# 0 means autodetect, autodetect means number_of_CPUs - 1 +vp8_threads = integer(default=0) +# Range: 0..10 +vp8_quality = integer(default=8) +# Range: -0.1..1 +vorbis_quality = float(default=0.3) + +# Autoplay the video when page is loaded? +auto_play = boolean(default=False) + +[[skip_transcode]] +mime_types = string_list(default=list("video/webm")) +container_formats = string_list(default=list("Matroska")) +video_codecs = string_list(default=list("VP8 video")) +audio_codecs = string_list(default=list("Vorbis")) +dimensions_match = boolean(default=True) + + diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index 506c7501..4d1d5ea2 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -126,7 +126,7 @@ class CommonVideoProcessor(MediaProcessor): def common_setup(self): self.video_config = mgg \ - .global_config['media_type:mediagoblin.media_types.video'] + .global_config['plugins'][MEDIA_TYPE] # Pull down and set up the processing file self.process_filename = get_process_filename( diff --git a/mediagoblin/media_types/video/util.py b/mediagoblin/media_types/video/util.py index c33cce5a..beb10129 100644 --- a/mediagoblin/media_types/video/util.py +++ b/mediagoblin/media_types/video/util.py @@ -27,7 +27,7 @@ def skip_transcode(metadata, size): Returns True if the video matches the requirements in the configuration. ''' - config = mgg.global_config['media_type:mediagoblin.media_types.video']\ + config = mgg.global_config['plugins']['mediagoblin.media_types.video']\ ['skip_transcode'] medium_config = mgg.global_config['media:medium'] diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html index 5c52f9f0..e35169bf 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/video.html +++ b/mediagoblin/templates/mediagoblin/media_displays/video.html @@ -30,7 +30,7 @@ {% set display_type, display_path = media.get_display_media() %}