diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-01 13:23:40 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-16 15:30:13 -0700 |
commit | 6fc8aaf65f483ab523cab74489dd3421314e2b7e (patch) | |
tree | 8156a5c77c0198e6977aaac389a8597390c39146 | |
parent | 99b34c4ce68b636583657bccec137d04875a5bf1 (diff) | |
download | mediagoblin-6fc8aaf65f483ab523cab74489dd3421314e2b7e.tar.lz mediagoblin-6fc8aaf65f483ab523cab74489dd3421314e2b7e.tar.xz mediagoblin-6fc8aaf65f483ab523cab74489dd3421314e2b7e.zip |
add reprocess_all function. still need to add code to reprocess all failed entries
-rw-r--r-- | mediagoblin/gmg_commands/reprocess.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mediagoblin/gmg_commands/reprocess.py b/mediagoblin/gmg_commands/reprocess.py index 9dbadefb..f458cd1d 100644 --- a/mediagoblin/gmg_commands/reprocess.py +++ b/mediagoblin/gmg_commands/reprocess.py @@ -16,6 +16,7 @@ from mediagoblin.db.models import MediaEntry from mediagoblin.gmg_commands import util as commands_util from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ +from mediagoblin.tools.pluginapi import hook_handle def reprocess_parser_setup(subparser): @@ -81,7 +82,34 @@ def _set_media_type(args): ' set the --type flag')) +def _reprocess_all(args): + if not args[0].type: + if args[0].state == 'failed': + if args[0].available: + print '\n Available reprocess actions for all failed' \ + ' media_entries: \n \t --initial_processing' + return + else: + #TODO reprocess all failed entries + pass + else: + raise Exception(_('You must set --type when trying to reprocess' + ' all media_entries, unless you set --state' + ' to "failed".')) + + if args[0].available: + return hook_handle(('reprocess_action', args[0].type), args) + else: + return hook_handle(('media_reprocess', args[0].type), args) + + def reprocess(args): commands_util.setup_app(args[0]) + if not args[0].state: + args[0].state = 'processed' + + if args[0].all: + return _reprocess_all(args) + _set_media_type(args) |