aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/Makefile2
-rw-r--r--docs/source/api/client_register.rst2
-rw-r--r--docs/source/index.rst1
-rw-r--r--docs/source/siteadmin/relnotes.rst1
-rw-r--r--mediagoblin/config_spec.ini41
-rw-r--r--mediagoblin/media_types/ascii/config_spec.ini4
-rw-r--r--mediagoblin/media_types/ascii/processing.py4
-rw-r--r--mediagoblin/media_types/audio/config_spec.ini8
-rw-r--r--mediagoblin/media_types/audio/processing.py2
-rw-r--r--mediagoblin/media_types/image/config_spec.ini7
-rw-r--r--mediagoblin/media_types/image/processing.py4
-rw-r--r--mediagoblin/media_types/pdf/config_spec.ini5
-rw-r--r--mediagoblin/media_types/video/config_spec.ini22
-rw-r--r--mediagoblin/media_types/video/processing.py2
-rw-r--r--mediagoblin/media_types/video/util.py2
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/pdf.html2
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/video.html2
-rw-r--r--mediagoblin/tools/staticdirect.py26
-rw-r--r--setup.py4
19 files changed, 74 insertions, 67 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/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
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/config_spec.ini b/mediagoblin/config_spec.ini
index 8f03509d..43e1898c 100644
--- a/mediagoblin/config_spec.ini
+++ b/mediagoblin/config_spec.ini
@@ -104,47 +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)
-
-# 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
-quality = float(default=0.3)
-create_spectrogram = boolean(default=True)
-spectrogram_fft_size = integer(default=4096)
-
-[media_type:mediagoblin.media_types.ascii]
-thumbnail_font = string(default=None)
-
-[media_type:mediagoblin.media_types.pdf]
-pdf_js = boolean(default=True)
-
-
[celery]
# default result stuff
CELERY_RESULT_BACKEND = string(default="database")
diff --git a/mediagoblin/media_types/ascii/config_spec.ini b/mediagoblin/media_types/ascii/config_spec.ini
new file mode 100644
index 00000000..24b05053
--- /dev/null
+++ b/mediagoblin/media_types/ascii/config_spec.ini
@@ -0,0 +1,4 @@
+[plugin_spec]
+thumbnail_font = string(default=None)
+
+
diff --git a/mediagoblin/media_types/ascii/processing.py b/mediagoblin/media_types/ascii/processing.py
index 9b6b3ad4..f42edfdd 100644
--- a/mediagoblin/media_types/ascii/processing.py
+++ b/mediagoblin/media_types/ascii/processing.py
@@ -55,8 +55,8 @@ class CommonAsciiProcessor(MediaProcessor):
acceptable_files = ['original', 'unicode']
def common_setup(self):
- self.ascii_config = mgg.global_config[
- 'media_type:mediagoblin.media_types.ascii']
+ self.ascii_config = mgg.global_config['plugins'][
+ 'mediagoblin.media_types.ascii']
# Conversions subdirectory to avoid collisions
self.conversions_subdir = os.path.join(
diff --git a/mediagoblin/media_types/audio/config_spec.ini b/mediagoblin/media_types/audio/config_spec.ini
new file mode 100644
index 00000000..743deaa4
--- /dev/null
+++ b/mediagoblin/media_types/audio/config_spec.ini
@@ -0,0 +1,8 @@
+[plugin_spec]
+keep_original = boolean(default=True)
+# vorbisenc quality
+quality = float(default=0.3)
+create_spectrogram = boolean(default=True)
+spectrogram_fft_size = integer(default=4096)
+
+
diff --git a/mediagoblin/media_types/audio/processing.py b/mediagoblin/media_types/audio/processing.py
index 6a506741..d0716448 100644
--- a/mediagoblin/media_types/audio/processing.py
+++ b/mediagoblin/media_types/audio/processing.py
@@ -60,7 +60,7 @@ class CommonAudioProcessor(MediaProcessor):
the audio_config, transcoder, thumbnailer and spectrogram_tmp path
"""
self.audio_config = mgg \
- .global_config['media_type:mediagoblin.media_types.audio']
+ .global_config['plugins']['mediagoblin.media_types.audio']
# Pull down and set up the processing file
self.process_filename = get_process_filename(
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
diff --git a/mediagoblin/media_types/pdf/config_spec.ini b/mediagoblin/media_types/pdf/config_spec.ini
new file mode 100644
index 00000000..c8a12cba
--- /dev/null
+++ b/mediagoblin/media_types/pdf/config_spec.ini
@@ -0,0 +1,5 @@
+[plugin_spec]
+pdf_js = boolean(default=True)
+
+
+
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/pdf.html b/mediagoblin/templates/mediagoblin/media_displays/pdf.html
index 9319e87c..a615cba6 100644
--- a/mediagoblin/templates/mediagoblin/media_displays/pdf.html
+++ b/mediagoblin/templates/mediagoblin/media_displays/pdf.html
@@ -29,7 +29,7 @@
media.media_files['original']) %}
{% endif %}
-{% set pdf_js = global_config.get('media_type:mediagoblin.media_types.pdf', {}).get('pdf_js', False) %}
+{% set pdf_js = global_config['plugins'].get('mediagoblin.media_types.pdf', {}).get('pdf_js', False) %}
{% if pdf_js %}
{% block mediagoblin_html_tag %}
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() %}
<video controls
- {% if global_config['media_type:mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
+ {% if global_config['plugins']['mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
preload="auto" class="video-js vjs-mg-skin"
data-setup='{"height": {{ media.media_data.height }},
"width": {{ media.media_data.width }} }'>
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::
diff --git a/setup.py b/setup.py
index 66f21b0c..cf3c2018 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',
@@ -63,7 +63,7 @@ setup(
'itsdangerous',
'pytz',
'six',
- 'oauthlib',
+ 'oauthlib==0.5.0',
## This is optional!
# 'translitcodec',
## For now we're expecting that users will install this from