From bf6ae3816fab3dec04161b51a3c6608d42ce0c13 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Fri, 5 Jun 2015 19:45:00 +0300 Subject: [PATCH 01/10] Import urlparse from six.moves to work on both Python 2 and 3. --- mediagoblin/tools/routing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mediagoblin/tools/routing.py b/mediagoblin/tools/routing.py index ae7c7154..8a30bab2 100644 --- a/mediagoblin/tools/routing.py +++ b/mediagoblin/tools/routing.py @@ -15,10 +15,12 @@ # along with this program. If not, see . import logging -import urlparse import six + +from six.moves.urllib.parse import urlparse from werkzeug.routing import Map, Rule + from mediagoblin.tools.common import import_component From 9051f99391cff02829be83e3ad0a004274cc3a4c Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 25 Jun 2015 12:38:58 +0200 Subject: [PATCH 02/10] Fix print statements to be python3 compatible. Refs #5331 --- mediagoblin/media_types/video/transcoders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/media_types/video/transcoders.py b/mediagoblin/media_types/video/transcoders.py index 6e0b702b..f3744fb0 100644 --- a/mediagoblin/media_types/video/transcoders.py +++ b/mediagoblin/media_types/video/transcoders.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from __future__ import division +from __future__ import divisioin, print_function import os import sys @@ -433,4 +433,4 @@ if __name__ == '__main__': print('I\'m a callback!') transcoder.transcode(*args, progress_callback=cb) elif options.action == 'discover': - print transcoder.discover(*args) + print(transcoder.discover(*args)) From 8e4b1fab36693f511d3e3d27673fc60e3a9287fa Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Thu, 25 Jun 2015 15:57:47 +0300 Subject: [PATCH 03/10] Fix more print statements. Refs #5331 --- mediagoblin/media_types/audio/spectrogram.py | 4 +++- mediagoblin/storage/mountstorage.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mediagoblin/media_types/audio/spectrogram.py b/mediagoblin/media_types/audio/spectrogram.py index dd4d0299..433bb300 100644 --- a/mediagoblin/media_types/audio/spectrogram.py +++ b/mediagoblin/media_types/audio/spectrogram.py @@ -19,6 +19,8 @@ # Bram de Jong # 2012, Joar Wandborg +from __future__ import print_function + try: from PIL import Image except ImportError: @@ -29,7 +31,7 @@ import numpy try: import scikits.audiolab as audiolab except ImportError: - print "WARNING: audiolab is not installed so wav2png will not work" + print("WARNING: audiolab is not installed so wav2png will not work") class AudioProcessingException(Exception): diff --git a/mediagoblin/storage/mountstorage.py b/mediagoblin/storage/mountstorage.py index 4125a88d..a829db31 100644 --- a/mediagoblin/storage/mountstorage.py +++ b/mediagoblin/storage/mountstorage.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from __future__ import print_function + import six from mediagoblin.storage import StorageInterface, clean_listy_filepath @@ -61,9 +63,9 @@ class MountStorage(StorageInterface): """ new_ent = clean_listy_filepath(dirpath) - print "Mounting:", repr(new_ent) + print("Mounting:", repr(new_ent)) already, rem_1, table, rem_2 = self._resolve_to_backend(new_ent, True) - print "===", repr(already), repr(rem_1), repr(rem_2), len(table) + print("===", repr(already), repr(rem_1), repr(rem_2), len(table)) assert (len(rem_2) > 0) or (None not in table), \ "That path is already mounted" From 2c1b0dc3e34ff3095ea249df840a21e11fadaaf7 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Thu, 25 Jun 2015 16:03:30 +0300 Subject: [PATCH 04/10] Fix typo. --- mediagoblin/media_types/video/transcoders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/media_types/video/transcoders.py b/mediagoblin/media_types/video/transcoders.py index f3744fb0..57912c54 100644 --- a/mediagoblin/media_types/video/transcoders.py +++ b/mediagoblin/media_types/video/transcoders.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from __future__ import divisioin, print_function +from __future__ import division, print_function import os import sys From cc92922386937d9f416e9166ac1e672a0f775b53 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Thu, 25 Jun 2015 22:24:03 +0300 Subject: [PATCH 05/10] Change all unicode() calls with six.text_type(). Fixes #5329. --- mediagoblin/edit/views.py | 4 ++-- mediagoblin/gmg_commands/batchaddmedia.py | 3 ++- mediagoblin/gmg_commands/users.py | 2 +- mediagoblin/media_types/audio/processing.py | 4 +++- mediagoblin/media_types/video/processing.py | 8 +++++--- mediagoblin/plugins/archivalook/tools.py | 7 +++++-- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 97e33e6a..8cee1cc0 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -219,10 +219,10 @@ def edit_profile(request, url_user=None): # Save location if form.location.data and user.location is None: - user.get_location = Location(name=unicode(form.location.data)) + user.get_location = Location(name=six.text_type(form.location.data)) elif form.location.data: location = user.get_location - location.name = unicode(form.location.data) + location.name = six.text_type(form.location.data) location.save() user.save() diff --git a/mediagoblin/gmg_commands/batchaddmedia.py b/mediagoblin/gmg_commands/batchaddmedia.py index 4137b55c..5a47d698 100644 --- a/mediagoblin/gmg_commands/batchaddmedia.py +++ b/mediagoblin/gmg_commands/batchaddmedia.py @@ -178,11 +178,12 @@ u"FAIL: This file is larger than the upload limits for this site.")) def unicode_csv_reader(unicode_csv_data, dialect=csv.excel, **kwargs): # csv.py doesn't do Unicode; encode temporarily as UTF-8: + # TODO: this probably won't be necessary in Python 3 csv_reader = csv.reader(utf_8_encoder(unicode_csv_data), dialect=dialect, **kwargs) for row in csv_reader: # decode UTF-8 back to Unicode, cell by cell: - yield [unicode(cell, 'utf-8') for cell in row] + yield [six.text_type(cell, 'utf-8') for cell in row] def utf_8_encoder(unicode_csv_data): for line in unicode_csv_data: diff --git a/mediagoblin/gmg_commands/users.py b/mediagoblin/gmg_commands/users.py index 158a1a2d..ad22c169 100644 --- a/mediagoblin/gmg_commands/users.py +++ b/mediagoblin/gmg_commands/users.py @@ -38,7 +38,7 @@ def adduser(args): #TODO: Lets trust admins this do not validate Emails :) commands_util.setup_app(args) - args.username = unicode(commands_util.prompt_if_not_set(args.username, "Username:")) + args.username = six.text_type(commands_util.prompt_if_not_set(args.username, "Username:")) args.password = commands_util.prompt_if_not_set(args.password, "Password:",True) args.email = commands_util.prompt_if_not_set(args.email, "Email:") diff --git a/mediagoblin/media_types/audio/processing.py b/mediagoblin/media_types/audio/processing.py index c1f6cb6b..427309de 100644 --- a/mediagoblin/media_types/audio/processing.py +++ b/mediagoblin/media_types/audio/processing.py @@ -18,6 +18,8 @@ import argparse import logging import os +import six + from mediagoblin import mg_globals as mgg from mediagoblin.processing import ( BadMediaFail, FilenameBuilder, @@ -39,7 +41,7 @@ def sniff_handler(media_file, filename): try: data = discover(media_file.name) except Exception as e: - _log.info(unicode(e)) + _log.info(six.text_type(e)) return None if data and data.get_audio_streams() and not data.get_video_streams(): return MEDIA_TYPE diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index a85b232c..0cdfbdce 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -19,6 +19,8 @@ import os.path import logging import datetime +import six + from mediagoblin import mg_globals as mgg from mediagoblin.processing import ( FilenameBuilder, BaseProcessingFail, @@ -52,8 +54,8 @@ def sniffer(media_file): data = transcoders.discover(media_file.name) except Exception as e: # this is usually GLib.GError, but we don't really care which one - _log.warning(u'GStreamer: {0}'.format(unicode(e))) - raise MissingComponents(u'GStreamer: {0}'.format(unicode(e))) + _log.warning(u'GStreamer: {0}'.format(six.text_type(e))) + raise MissingComponents(u'GStreamer: {0}'.format(six.text_type(e))) _log.debug('Discovered: {0}'.format(data)) if not data.get_video_streams(): @@ -110,7 +112,7 @@ def get_tags(stream_info): dt.get_microsecond()).isoformat() for k, v in tags.items(): # types below are accepted by json; others must not present - if not isinstance(v, (dict, list, basestring, int, float, bool, + if not isinstance(v, (dict, list, six.string_types, int, float, bool, type(None))): del tags[k] return dict(tags) diff --git a/mediagoblin/plugins/archivalook/tools.py b/mediagoblin/plugins/archivalook/tools.py index 9c715c9b..b495624c 100644 --- a/mediagoblin/plugins/archivalook/tools.py +++ b/mediagoblin/plugins/archivalook/tools.py @@ -13,6 +13,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . + +import six + from mediagoblin.db.models import MediaEntry, User from mediagoblin.plugins.archivalook.models import FeaturedMedia from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ @@ -53,7 +56,7 @@ def parse_url(url): who uploaded the piece of media, slug is the media entry's url slug. """ - url = unicode(url) + url = six.text_type(url) u_end, m_start, m_end, end = (url.find('/u/') + 3, url.find('/m/'), url.find('/m/') + 3, @@ -84,7 +87,7 @@ def split_featured_media_list(featured_media): or tertiary) """ - featured_media = unicode(featured_media) + featured_media = six.text_type(featured_media) featured_media_list = featured_media.split("\n") display_type = 0 media_already_featured = [] From 287ba3a0f112ed85c4bc8555c9aeec7303f9282d Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Wed, 22 Jul 2015 10:18:00 +0300 Subject: [PATCH 06/10] Pin mock 1.0.1 in Python 2 for now. mock recently dropped Python 2.6 support and then re-introduced it in its latest release (however, it's a bit unstable right now). I think at this point, we can be more cautious and just use mock==1.0.1. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 10cac2df..68303f25 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ if PY2: # # use pbr, and currently it breaks things, presumably till # # their next release. # pyversion_install_requires.append('pbr==0.5.22') - pyversion_install_requires.append('mock') # mock is in the stdlib for 3.3+ + pyversion_install_requires.append('mock==1.0.1') # mock is in the stdlib for 3.3+ # PyPI version (1.4.2) does not have proper Python 3 support pyversion_install_requires.append('ExifRead') pyversion_install_requires.append('PasteScript') From 75b60cde016f342d0ce4765b985d23a94b76c960 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Wed, 22 Jul 2015 11:24:12 +0300 Subject: [PATCH 07/10] Fix typos reported in #1102 --- .../plugins/archivalook/templates/archivalook/feature.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature.html index ad55f43b..b19029c3 100644 --- a/mediagoblin/plugins/archivalook/templates/archivalook/feature.html +++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature.html @@ -35,7 +35,7 @@

{% trans %} - Go to the page of the media entry you want to feature. Copy it's URL and + Go to the page of the media entry you want to feature. Copy its URL and then paste it into a new line in the text box above. There should be only one url per line. The url that you paste into the text box should be under the header describing how prominent a feature it will be (whether Primary, @@ -86,7 +86,7 @@ featured?{% endtrans %}

{% trans %} - When a media entry is featured, the entry's title, it's thumbnail and a + When a media entry is featured, the entry's title, its thumbnail and a portion of its description will be displayed on your website's front page. The number of characters displayed varies on the prominence of the feature. Primary Features display the first 512 characters of their description, From da0be53c3b87724754375a8f462fc572400aa6f2 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Wed, 22 Jul 2015 11:26:08 +0300 Subject: [PATCH 08/10] Regenerate po file after 8e832f84597bd1505f23f4abd4eef96ce12d3822 --- mediagoblin/i18n/templates/en/mediagoblin.po | 155 ++++++------------- 1 file changed, 44 insertions(+), 111 deletions(-) diff --git a/mediagoblin/i18n/templates/en/mediagoblin.po b/mediagoblin/i18n/templates/en/mediagoblin.po index 75aa94d9..057daccd 100644 --- a/mediagoblin/i18n/templates/en/mediagoblin.po +++ b/mediagoblin/i18n/templates/en/mediagoblin.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2015-01-16 15:13-0600\n" +"POT-Creation-Date: 2015-07-22 11:25+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -179,7 +179,7 @@ msgstr "" #: mediagoblin/edit/forms.py:29 mediagoblin/edit/forms.py:90 #: mediagoblin/media_types/blog/forms.py:24 -#: mediagoblin/media_types/blog/forms.py:33 mediagoblin/submit/forms.py:37 +#: mediagoblin/media_types/blog/forms.py:38 mediagoblin/submit/forms.py:37 #: mediagoblin/submit/forms.py:61 #: mediagoblin/templates/mediagoblin/moderation/media_panel.html:40 #: mediagoblin/templates/mediagoblin/moderation/media_panel.html:69 @@ -201,7 +201,7 @@ msgid "" " Markdown for formatting." msgstr "" -#: mediagoblin/edit/forms.py:37 mediagoblin/media_types/blog/forms.py:27 +#: mediagoblin/edit/forms.py:37 mediagoblin/media_types/blog/forms.py:28 #: mediagoblin/submit/forms.py:45 msgid "Tags" msgstr "" @@ -224,7 +224,7 @@ msgid "" "this." msgstr "" -#: mediagoblin/edit/forms.py:48 mediagoblin/media_types/blog/forms.py:29 +#: mediagoblin/edit/forms.py:48 mediagoblin/media_types/blog/forms.py:32 #: mediagoblin/submit/forms.py:50 #: mediagoblin/templates/mediagoblin/utils/license.html:20 msgid "License" @@ -354,7 +354,7 @@ msgstr "" msgid "You need to confirm the deletion of your account." msgstr "" -#: mediagoblin/edit/views.py:363 mediagoblin/submit/views.py:134 +#: mediagoblin/edit/views.py:363 mediagoblin/submit/views.py:125 #: mediagoblin/user_pages/views.py:254 #, python-format msgid "You already have a collection called \"%s\"!" @@ -474,22 +474,22 @@ msgid "" "this domain." msgstr "" -#: mediagoblin/media_types/__init__.py:79 -#: mediagoblin/media_types/__init__.py:101 +#: mediagoblin/media_types/__init__.py:77 +#: mediagoblin/media_types/__init__.py:100 +#: mediagoblin/media_types/__init__.py:136 msgid "Sorry, I don't support that file type :(" msgstr "" #: mediagoblin/media_types/blog/forms.py:26 -#: mediagoblin/media_types/blog/forms.py:35 -#: mediagoblin/plugins/oauth/forms.py:36 +#: mediagoblin/media_types/blog/forms.py:40 msgid "Description" msgstr "" -#: mediagoblin/media_types/blog/forms.py:40 mediagoblin/user_pages/forms.py:31 +#: mediagoblin/media_types/blog/forms.py:45 mediagoblin/user_pages/forms.py:31 msgid "I am sure I want to delete this" msgstr "" -#: mediagoblin/media_types/blog/views.py:158 mediagoblin/submit/views.py:71 +#: mediagoblin/media_types/blog/views.py:158 mediagoblin/submit/views.py:70 msgid "Woohoo! Submitted!" msgstr "" @@ -582,7 +582,6 @@ msgid "Create/Edit a Blog" msgstr "" #: mediagoblin/media_types/blog/templates/mediagoblin/blog/blog_edit_create.html:37 -#: mediagoblin/plugins/oauth/templates/oauth/client/register.html:29 #: mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/add.html:39 #: mediagoblin/templates/mediagoblin/submit/collection.html:30 #: mediagoblin/templates/mediagoblin/submit/start.html:39 @@ -619,7 +618,7 @@ msgstr "" msgid "unoconv failing to run, check log file" msgstr "" -#: mediagoblin/media_types/video/processing.py:44 +#: mediagoblin/media_types/video/processing.py:47 msgid "Video transcoding failed" msgstr "" @@ -732,18 +731,18 @@ msgstr "" msgid "No request token found." msgstr "" -#: mediagoblin/plugins/api/views.py:78 mediagoblin/plugins/piwigo/views.py:157 -#: mediagoblin/submit/views.py:80 +#: mediagoblin/plugins/api/views.py:77 mediagoblin/plugins/piwigo/views.py:157 +#: mediagoblin/submit/views.py:79 msgid "Sorry, the file size is too big." msgstr "" -#: mediagoblin/plugins/api/views.py:81 mediagoblin/plugins/piwigo/views.py:160 -#: mediagoblin/submit/views.py:83 +#: mediagoblin/plugins/api/views.py:80 mediagoblin/plugins/piwigo/views.py:160 +#: mediagoblin/submit/views.py:82 msgid "Sorry, uploading this file will put you over your upload limit." msgstr "" -#: mediagoblin/plugins/api/views.py:85 mediagoblin/plugins/piwigo/views.py:164 -#: mediagoblin/submit/views.py:89 +#: mediagoblin/plugins/api/views.py:84 mediagoblin/plugins/piwigo/views.py:164 +#: mediagoblin/submit/views.py:88 msgid "Sorry, you have reached your upload limit." msgstr "" @@ -751,19 +750,19 @@ msgstr "" msgid "Enter the URL for the media to be featured" msgstr "" -#: mediagoblin/plugins/archivalook/tools.py:132 +#: mediagoblin/plugins/archivalook/tools.py:135 msgid "Primary" msgstr "" -#: mediagoblin/plugins/archivalook/tools.py:133 +#: mediagoblin/plugins/archivalook/tools.py:136 msgid "Secondary" msgstr "" -#: mediagoblin/plugins/archivalook/tools.py:134 +#: mediagoblin/plugins/archivalook/tools.py:137 msgid "Tertiary" msgstr "" -#: mediagoblin/plugins/archivalook/tools.py:135 +#: mediagoblin/plugins/archivalook/tools.py:138 msgid "-----------{display_type}-Features---------------------------\n" msgstr "" @@ -778,8 +777,8 @@ msgstr "" #: mediagoblin/plugins/archivalook/templates/archivalook/feature.html:37 msgid "" "\n" -" Go to the page of the media entry you want to feature. Copy it's " -"URL and\n" +" Go to the page of the media entry you want to feature. Copy its URL" +" and\n" " then paste it into a new line in the text box above. There should " "be only\n" " one url per line. The url that you paste into the text box should " @@ -864,7 +863,7 @@ msgstr "" #: mediagoblin/plugins/archivalook/templates/archivalook/feature.html:88 msgid "" "\n" -" When a media entry is featured, the entry's title, it's thumbnail " +" When a media entry is featured, the entry's title, its thumbnail " "and a\n" " portion of its description will be displayed on your website's " "front page.\n" @@ -1143,72 +1142,6 @@ msgstr "" msgid "Edit Metadata" msgstr "" -#: mediagoblin/plugins/oauth/forms.py:29 -msgid "Allow" -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:30 -msgid "Deny" -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:34 -msgid "Name" -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:35 -msgid "The name of the OAuth client" -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:38 -msgid "" -"This will be visible to users allowing your\n" -" application to authenticate as them." -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:40 -msgid "Type" -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:45 -msgid "" -"Confidential - The client can\n" -" make requests to the GNU MediaGoblin instance that can " -"not be\n" -" intercepted by the user agent (e.g. server-side " -"client).
\n" -" Public - The client can't make " -"confidential\n" -" requests to the GNU MediaGoblin instance (e.g. client-" -"side\n" -" JavaScript client)." -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:52 -msgid "Redirect URI" -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:54 -msgid "" -"The redirect URI for the applications, this field\n" -" is required for public clients." -msgstr "" - -#: mediagoblin/plugins/oauth/forms.py:66 -msgid "This field is required for public clients" -msgstr "" - -#: mediagoblin/plugins/oauth/views.py:57 -msgid "The client {0} has been registered!" -msgstr "" - -#: mediagoblin/plugins/oauth/templates/oauth/client/connections.html:22 -msgid "OAuth client connections" -msgstr "" - -#: mediagoblin/plugins/oauth/templates/oauth/client/list.html:22 -msgid "Your OAuth clients" -msgstr "" - #: mediagoblin/plugins/openid/__init__.py:97 #: mediagoblin/plugins/openid/views.py:271 #: mediagoblin/plugins/openid/views.py:300 @@ -1349,15 +1282,15 @@ msgstr "" msgid "Or register with Persona!" msgstr "" -#: mediagoblin/processing/__init__.py:422 +#: mediagoblin/processing/__init__.py:421 msgid "Invalid file given for media type." msgstr "" -#: mediagoblin/processing/__init__.py:429 +#: mediagoblin/processing/__init__.py:428 msgid "Copying to public storage failed." msgstr "" -#: mediagoblin/processing/__init__.py:437 +#: mediagoblin/processing/__init__.py:436 msgid "An acceptable processing file was not found" msgstr "" @@ -1377,11 +1310,11 @@ msgid "" " Markdown for formatting." msgstr "" -#: mediagoblin/submit/views.py:57 +#: mediagoblin/submit/views.py:56 msgid "You must provide a file." msgstr "" -#: mediagoblin/submit/views.py:140 +#: mediagoblin/submit/views.py:131 #, python-format msgid "Collection \"%s\" added!" msgstr "" @@ -1761,7 +1694,7 @@ msgid "Media tagged with: %(tag_name)s" msgstr "" #: mediagoblin/templates/mediagoblin/media_displays/ascii.html:36 -#: mediagoblin/templates/mediagoblin/media_displays/audio.html:58 +#: mediagoblin/templates/mediagoblin/media_displays/audio.html:56 #: mediagoblin/templates/mediagoblin/media_displays/pdf.html:69 #: mediagoblin/templates/mediagoblin/media_displays/video.html:76 msgid "Download" @@ -1771,27 +1704,27 @@ msgstr "" msgid "Original" msgstr "" -#: mediagoblin/templates/mediagoblin/media_displays/audio.html:45 +#: mediagoblin/templates/mediagoblin/media_displays/audio.html:43 msgid "" -"Sorry, this audio will not work because \n" -"\t your web browser does not support HTML5 \n" +"Sorry, this audio will not work because\n" +"\t your web browser does not support HTML5\n" "\t audio." msgstr "" -#: mediagoblin/templates/mediagoblin/media_displays/audio.html:48 +#: mediagoblin/templates/mediagoblin/media_displays/audio.html:46 msgid "" -"You can get a modern web browser that \n" +"You can get a modern web browser that\n" "\t can play the audio at \n" "\t http://getfirefox.com!" msgstr "" -#: mediagoblin/templates/mediagoblin/media_displays/audio.html:62 +#: mediagoblin/templates/mediagoblin/media_displays/audio.html:60 #: mediagoblin/templates/mediagoblin/media_displays/pdf.html:75 #: mediagoblin/templates/mediagoblin/media_displays/video.html:82 msgid "Original file" msgstr "" -#: mediagoblin/templates/mediagoblin/media_displays/audio.html:65 +#: mediagoblin/templates/mediagoblin/media_displays/audio.html:63 msgid "WebM file (Vorbis codec)" msgstr "" @@ -2548,27 +2481,27 @@ msgid "" "moved or deleted." msgstr "" -#: mediagoblin/tools/timesince.py:62 +#: mediagoblin/tools/timesince.py:50 msgid "year" msgstr "" -#: mediagoblin/tools/timesince.py:63 +#: mediagoblin/tools/timesince.py:51 msgid "month" msgstr "" -#: mediagoblin/tools/timesince.py:64 +#: mediagoblin/tools/timesince.py:52 msgid "week" msgstr "" -#: mediagoblin/tools/timesince.py:65 +#: mediagoblin/tools/timesince.py:53 msgid "day" msgstr "" -#: mediagoblin/tools/timesince.py:66 +#: mediagoblin/tools/timesince.py:54 msgid "hour" msgstr "" -#: mediagoblin/tools/timesince.py:67 +#: mediagoblin/tools/timesince.py:55 msgid "minute" msgstr "" From e2a8d303071dc3701436a8a28701e4659ddf5784 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sat, 1 Aug 2015 05:05:07 +0300 Subject: [PATCH 09/10] Fix urlparse import in tools/routing.py urlparse is already a function, so we don't need to specify a module name. Refs #5339 --- mediagoblin/tools/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/tools/routing.py b/mediagoblin/tools/routing.py index 8a30bab2..a2c89f2a 100644 --- a/mediagoblin/tools/routing.py +++ b/mediagoblin/tools/routing.py @@ -80,7 +80,7 @@ def extract_url_arguments(url, urlmap): """ This extracts the URL arguments from a given URL """ - parsed_url = urlparse.urlparse(url) + parsed_url = urlparse(url) map_adapter = urlmap.bind( server_name=parsed_url.netloc, script_name=parsed_url.path, From 6e38fec80ebaadc3b3cfdc912f40cc4e8bb9b31c Mon Sep 17 00:00:00 2001 From: ayleph Date: Thu, 17 Dec 2015 21:06:42 -0500 Subject: [PATCH 10/10] Fix Issue 5375 Deprecated function in video thumb This patch fixes issue 5375 by replacing a function call that has been removed in recent versions of PIL with the recommended replacement. (cherry picked from commit 564a48e018bcd786aa32b232cb7216be3ef3fb5e) --- mediagoblin/media_types/video/transcoders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/media_types/video/transcoders.py b/mediagoblin/media_types/video/transcoders.py index 57912c54..f8020497 100644 --- a/mediagoblin/media_types/video/transcoders.py +++ b/mediagoblin/media_types/video/transcoders.py @@ -132,7 +132,7 @@ def capture_thumb(video_path, dest_path, width=None, height=None, percent=0.5): buffer = sample.get_buffer() # get the image from the buffer and save it to disk - im = Image.fromstring('RGB', (width, height), + im = Image.frombytes('RGB', (width, height), buffer.extract_dup(0, buffer.get_size())) im.save(dest_path) _log.info('thumbnail saved to {0}'.format(dest_path))