From 9dfca6b3ce3b38419c5be27e197f8afd9b05a0b1 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 28 Aug 2013 11:06:07 -0500 Subject: [PATCH 1/9] double colon here was killing the build --- docs/source/api/client_register.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/api/client_register.rst b/docs/source/api/client_register.rst index 4ad7908e..08f92c47 100644 --- a/docs/source/api/client_register.rst +++ b/docs/source/api/client_register.rst @@ -49,7 +49,7 @@ redirect_uri Response -------- -You will get back a response:: +You will get back a response: client_id This identifies a client From b33feb18a77fcd9ff5b9c0cdb9ed6d81c467e759 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 28 Aug 2013 11:11:41 -0500 Subject: [PATCH 2/9] Fix failing to build docs --- docs/Makefile | 2 +- docs/source/index.rst | 1 - docs/source/siteadmin/relnotes.rst | 1 + mediagoblin/tools/staticdirect.py | 26 ++++++++++++++------------ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 4461893f..0b97bf7c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = -W +SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = build diff --git a/docs/source/index.rst b/docs/source/index.rst index 777c4d26..e7fda4ad 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -56,7 +56,6 @@ Part 2: Core plugin documentation plugindocs/flatpagesfile plugindocs/sampleplugin - plugindocs/oauth plugindocs/trim_whitespace plugindocs/raven plugindocs/basic_auth diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 40e84766..e7bf003a 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -141,6 +141,7 @@ please note the following: **New features** + * PDF media type! * Improved plugin system. More flexible, better documented, with a new plugin authoring section of the docs. 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:: From 6a01fafc9828023b449df004d30580a341fd6279 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 29 Aug 2013 09:36:34 -0500 Subject: [PATCH 3/9] Explicitly require a newer celery --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 66f21b0c..4856824a 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ setup( 'pytest>=2.3.1', 'pytest-xdist', 'werkzeug>=0.7', - 'celery', + 'celery>=3.0', 'kombu', 'jinja2', 'sphinx', From 93874d0a662fc3abd73c56ad3939a13f3d372493 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Wed, 28 Aug 2013 07:56:44 -0700 Subject: [PATCH 4/9] 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 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 From 9a6741d7bfa091ebbebfc5f657dca2e8995f814a Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Wed, 28 Aug 2013 08:10:47 -0700 Subject: [PATCH 5/9] 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 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() %}