aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands/reprocess.py
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-08-01 15:55:39 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-08-16 15:30:13 -0700
commit065db04730936286bbe213133a3175d48950fd32 (patch)
treeb03cea049aee259152a56ba369b8d52b372d36a8 /mediagoblin/gmg_commands/reprocess.py
parent842ba30529040fb47ac9905df6373d7c1f0286ed (diff)
downloadmediagoblin-065db04730936286bbe213133a3175d48950fd32.tar.lz
mediagoblin-065db04730936286bbe213133a3175d48950fd32.tar.xz
mediagoblin-065db04730936286bbe213133a3175d48950fd32.zip
add command option for regenerating all thumbnails
Diffstat (limited to 'mediagoblin/gmg_commands/reprocess.py')
-rw-r--r--mediagoblin/gmg_commands/reprocess.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/mediagoblin/gmg_commands/reprocess.py b/mediagoblin/gmg_commands/reprocess.py
index f3445ea6..b45543e4 100644
--- a/mediagoblin/gmg_commands/reprocess.py
+++ b/mediagoblin/gmg_commands/reprocess.py
@@ -35,6 +35,10 @@ def reprocess_parser_setup(subparser):
'--media_id',
nargs='*',
help="The media_entry id(s) you wish to reprocess.")
+ subparser.add_argument(
+ '--thumbnails',
+ action="store_true",
+ help="Regenerate thumbnails for all processed media")
def _set_media_type(args):
@@ -68,20 +72,31 @@ def _set_media_type(args):
def _reprocess_all(args):
if not args[0].type:
- if args[0].state == 'failed':
+ if args[0].thumbnails:
+ if args[0].available:
+ print _('Available options for regenerating all processed'
+ ' media thumbnails: \n'
+ '\t --size: max_width max_height'
+ ' (defaults to config specs)')
+ else:
+ #TODO regenerate all thumbnails
+ pass
+
+ elif 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".'))
- _run_reprocessing(args)
+ else:
+ _run_reprocessing(args)
def _run_reprocessing(args):