diff options
Diffstat (limited to 'mediagoblin/plugins/api')
-rw-r--r-- | mediagoblin/plugins/api/__init__.py | 2 | ||||
-rw-r--r-- | mediagoblin/plugins/api/tools.py | 6 | ||||
-rw-r--r-- | mediagoblin/plugins/api/views.py | 14 |
3 files changed, 11 insertions, 11 deletions
diff --git a/mediagoblin/plugins/api/__init__.py b/mediagoblin/plugins/api/__init__.py index 1eddd9e0..51e22e85 100644 --- a/mediagoblin/plugins/api/__init__.py +++ b/mediagoblin/plugins/api/__init__.py @@ -28,7 +28,7 @@ def setup_plugin(): config = pluginapi.get_config(__name__) - _log.debug('API config: {0}'.format(config)) + _log.debug('API config: {}'.format(config)) routes = [ ('mediagoblin.plugins.api.test', diff --git a/mediagoblin/plugins/api/tools.py b/mediagoblin/plugins/api/tools.py index e406888e..eff9009d 100644 --- a/mediagoblin/plugins/api/tools.py +++ b/mediagoblin/plugins/api/tools.py @@ -30,7 +30,7 @@ from mediagoblin.storage.filestorage import BasicFileStorage _log = logging.getLogger(__name__) -class Auth(object): +class Auth: ''' An object with two significant methods, 'trigger' and 'run'. @@ -115,7 +115,7 @@ def api_auth(controller): for auth in PluginManager().get_hook_callables('auth'): if auth.trigger(request): - _log.debug('{0} believes it is capable of authenticating this request.'.format(auth)) + _log.debug('{} believes it is capable of authenticating this request.'.format(auth)) auth_candidates.append(auth) # If we can't find any authentication methods, we should not let them @@ -126,7 +126,7 @@ def api_auth(controller): # For now, just select the first one in the list auth = auth_candidates[0] - _log.debug('Using {0} to authorize request {1}'.format( + _log.debug('Using {} to authorize request {}'.format( auth, request.url)) if not auth(request, *args, **kw): diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py index fdd22ace..84f919b4 100644 --- a/mediagoblin/plugins/api/views.py +++ b/mediagoblin/plugins/api/views.py @@ -54,16 +54,16 @@ def post_entry(request): callback_url = request.form.get('callback_url') if callback_url: - callback_url = six.text_type(callback_url) + callback_url = str(callback_url) try: entry = submit_media( mg_app=request.app, user=request.user, submitted_file=request.files['file'], filename=request.files['file'].filename, - title=six.text_type(request.form.get('title')), - description=six.text_type(request.form.get('description')), - license=six.text_type(request.form.get('license', '')), - tags_string=six.text_type(request.form.get('tags', '')), + title=str(request.form.get('title')), + description=str(request.form.get('description')), + license=str(request.form.get('license', '')), + tags_string=str(request.form.get('tags', '')), callback_url=callback_url) return json_response(get_entry_serializable(entry, request.urlgen)) @@ -71,7 +71,7 @@ def post_entry(request): # Handle upload limit issues except FileUploadLimit: raise BadRequest( - _(u'Sorry, the file size is too big.')) + _('Sorry, the file size is too big.')) except UserUploadLimit: raise BadRequest( _('Sorry, uploading this file will put you over your' @@ -99,7 +99,7 @@ def get_entries(request): entries = request.db.MediaEntry.query # TODO: Make it possible to fetch unprocessed media, or media in-processing - entries = entries.filter_by(state=u'processed') + entries = entries.filter_by(state='processed') # TODO: Add sort order customization entries = entries.order_by(request.db.MediaEntry.created.desc()) |