Merge branch 'master' of git://gitorious.org/mediagoblin/mediagoblin

This commit is contained in:
Aditi Mittal 2013-08-31 12:34:02 +05:30
commit a7f02e9514
19 changed files with 74 additions and 67 deletions

View File

@ -2,7 +2,7 @@
#
# You can set these variables from the command line.
SPHINXOPTS = -W
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build

View File

@ -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

View File

@ -56,7 +56,6 @@ Part 2: Core plugin documentation
plugindocs/flatpagesfile
plugindocs/sampleplugin
plugindocs/oauth
plugindocs/trim_whitespace
plugindocs/raven
plugindocs/basic_auth

View File

@ -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.

View File

@ -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")

View File

@ -0,0 +1,4 @@
[plugin_spec]
thumbnail_font = string(default=None)

View File

@ -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(

View File

@ -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)

View File

@ -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(

View File

@ -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)

View File

@ -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

View File

@ -0,0 +1,5 @@
[plugin_spec]
pdf_js = boolean(default=True)

View File

@ -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)

View File

@ -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(

View File

@ -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']

View File

@ -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 %}

View File

@ -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 }} }'>

View File

@ -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::

View File

@ -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