aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2012-01-04 11:57:08 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-01-04 11:57:39 +0100
commit228c4470f40d66e8b9383321d44d89e2a1c0ecad (patch)
tree391a77e5994b76dd38ea4257c1b0d815659836d1
parent010fe2d71bf8b1c47c12234466d759561df18355 (diff)
downloadmediagoblin-228c4470f40d66e8b9383321d44d89e2a1c0ecad.tar.lz
mediagoblin-228c4470f40d66e8b9383321d44d89e2a1c0ecad.tar.xz
mediagoblin-228c4470f40d66e8b9383321d44d89e2a1c0ecad.zip
Dot-Notation for MediaEntry.media_files
-rw-r--r--mediagoblin/gmg_commands/import_export.py4
-rw-r--r--mediagoblin/media_types/video/processing.py6
-rw-r--r--mediagoblin/templates/mediagoblin/edit/attachments.html2
-rw-r--r--mediagoblin/templates/mediagoblin/edit/edit.html2
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/ascii.html4
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/video.html4
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html4
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html2
-rw-r--r--mediagoblin/templates/mediagoblin/utils/object_gallery.html2
-rw-r--r--mediagoblin/tools/files.py2
10 files changed, 16 insertions, 16 deletions
diff --git a/mediagoblin/gmg_commands/import_export.py b/mediagoblin/gmg_commands/import_export.py
index eda41f4c..7f699429 100644
--- a/mediagoblin/gmg_commands/import_export.py
+++ b/mediagoblin/gmg_commands/import_export.py
@@ -65,7 +65,7 @@ def _import_media(db, args):
args._cache_path['queue'])
for entry in db.MediaEntry.find():
- for name, path in entry['media_files'].items():
+ for name, path in entry.media_files.items():
_log.info('Importing: {0} - {1}'.format(
entry.title,
name))
@@ -207,7 +207,7 @@ def _export_media(db, args):
args._cache_path['queue'])
for entry in db.MediaEntry.find():
- for name, path in entry['media_files'].items():
+ for name, path in entry.media_files.items():
_log.info(u'Exporting {0} - {1}'.format(
entry.title,
name))
diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py
index 7d261226..c260cfd6 100644
--- a/mediagoblin/media_types/video/processing.py
+++ b/mediagoblin/media_types/video/processing.py
@@ -74,7 +74,7 @@ def process_video(entry):
tmp_dst.read())
_log.debug('Saved medium')
- entry['media_files']['webm_640'] = medium_filepath
+ entry.media_files['webm_640'] = medium_filepath
# Save the width and height of the transcoded video
entry.media_data['video'] = {
@@ -94,7 +94,7 @@ def process_video(entry):
tmp_thumb.read())
_log.debug('Saved thumbnail')
- entry['media_files']['thumb'] = thumbnail_filepath
+ entry.media_files['thumb'] = thumbnail_filepath
if video_config['keep_original']:
# Push original file to public storage
@@ -111,7 +111,7 @@ def process_video(entry):
original_file.write(queued_file.read())
_log.debug('Saved original')
- entry['media_files']['original'] = original_filepath
+ entry.media_files['original'] = original_filepath
mgg.queue_store.delete_file(queued_filepath)
diff --git a/mediagoblin/templates/mediagoblin/edit/attachments.html b/mediagoblin/templates/mediagoblin/edit/attachments.html
index 124d0313..06062cd3 100644
--- a/mediagoblin/templates/mediagoblin/edit/attachments.html
+++ b/mediagoblin/templates/mediagoblin/edit/attachments.html
@@ -27,7 +27,7 @@
<h1>Editing attachments for {{ media.title }}</h1>
<div style="text-align: center;" >
<img src="{{ request.app.public_store.file_url(
- media['media_files']['thumb']) }}" />
+ media.media_files['thumb']) }}" />
</div>
{% if media.attachment_files|count %}
diff --git a/mediagoblin/templates/mediagoblin/edit/edit.html b/mediagoblin/templates/mediagoblin/edit/edit.html
index 2dfaddc8..024a2b4d 100644
--- a/mediagoblin/templates/mediagoblin/edit/edit.html
+++ b/mediagoblin/templates/mediagoblin/edit/edit.html
@@ -29,7 +29,7 @@
<h1>{% trans media_title=media.title %}Editing {{ media_title }}{% endtrans %}</h1>
<div style="text-align: center;" >
<img src="{{ request.app.public_store.file_url(
- media['media_files']['thumb']) }}" />
+ media.media_files['thumb']) }}" />
</div>
{{ wtforms_util.render_divs(form) }}
<div class="form_submit_buttons">
diff --git a/mediagoblin/templates/mediagoblin/media_displays/ascii.html b/mediagoblin/templates/mediagoblin/media_displays/ascii.html
index 9e77066a..6b40bf08 100644
--- a/mediagoblin/templates/mediagoblin/media_displays/ascii.html
+++ b/mediagoblin/templates/mediagoblin/media_displays/ascii.html
@@ -23,14 +23,14 @@
<pre>
{%- autoescape False -%}
{{- request.app.public_store.get_file(
- media['media_files']['unicode']).read()|string -}}
+ media.media_files['unicode']).read()|string -}}
{%- endautoescape -%}
</pre>
</div>
{% if 'original' in media.media_files %}
<p>
<a href="{{ request.app.public_store.file_url(
- media['media_files']['original']) }}">
+ media.media_files['original']) }}">
{%- trans -%}
Original
{%- endtrans -%}
diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html
index fc08f963..6b5e7a0e 100644
--- a/mediagoblin/templates/mediagoblin/media_displays/video.html
+++ b/mediagoblin/templates/mediagoblin/media_displays/video.html
@@ -27,7 +27,7 @@
preload="auto"
data-setup="">
<source src="{{ request.app.public_store.file_url(
- media['media_files']['webm_640']) }}"
+ media.media_files['webm_640']) }}"
type="video/webm; codecs=&quot;vp8, vorbis&quot;" />
<div class="no_html5">
{%- trans -%}Sorry, this video will not work because
@@ -42,7 +42,7 @@
{% if 'original' in media.media_files %}
<p>
<a href="{{ request.app.public_store.file_url(
- media['media_files']['original']) }}">
+ media.media_files['original']) }}">
{%- trans -%}
Original
{%- endtrans -%}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index ca650f63..d52f544f 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -36,9 +36,9 @@
{# if there's a medium file size, that means the medium size
# isn't the original... so link to the original!
#}
- {% if media['media_files'].has_key('medium') %}
+ {% if media.media_files.has_key('medium') %}
<a href="{{ request.app.public_store.file_url(
- media['media_files']['original']) }}">
+ media.media_files['original']) }}">
<img class="media_image"
src="{{ display_media }}"
alt="Image for {{ media.title }}" />
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
index 6c483769..408bca05 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
@@ -34,7 +34,7 @@
<div style="text-align: center;" >
<img src="{{ request.app.public_store.file_url(
- media['media_files']['thumb']) }}" />
+ media.media_files['thumb']) }}" />
</div>
<br />
diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
index b8155f03..5f628dc7 100644
--- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html
+++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
@@ -31,7 +31,7 @@
{%- elif loop.last %} thumb_entry_last{% endif %}">
<a href="{{ entry_url }}">
<img src="{{ request.app.public_store.file_url(
- entry['media_files']['thumb']) }}" />
+ entry.media_files['thumb']) }}" />
</a>
{% if entry.title %}
<br />
diff --git a/mediagoblin/tools/files.py b/mediagoblin/tools/files.py
index e0bf0569..10f1d994 100644
--- a/mediagoblin/tools/files.py
+++ b/mediagoblin/tools/files.py
@@ -23,7 +23,7 @@ def delete_media_files(media):
Arguments:
- media: A MediaEntry document
"""
- for listpath in media['media_files'].itervalues():
+ for listpath in media.media_files.itervalues():
mg_globals.public_store.delete_file(
listpath)