diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-08-09 12:13:53 -0500 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-16 15:30:15 -0700 |
commit | 85ead8ac3cf59aeee12ddd3b33ecfeb03c3aa946 (patch) | |
tree | d41cbce28dab9eb632153ec7659137ad5b977567 /mediagoblin/gmg_commands/reprocess.py | |
parent | 58bacb33aca6505673f90460d31811ed487bcb4c (diff) | |
download | mediagoblin-85ead8ac3cf59aeee12ddd3b33ecfeb03c3aa946.tar.lz mediagoblin-85ead8ac3cf59aeee12ddd3b33ecfeb03c3aa946.tar.xz mediagoblin-85ead8ac3cf59aeee12ddd3b33ecfeb03c3aa946.zip |
"initial" reprocessing subcommand now works!
We are on our way now to a working reprocessing system under this
redesign!
This commit sponsored by Bjarni RĂșnar Einarsson. Thank you!
Diffstat (limited to 'mediagoblin/gmg_commands/reprocess.py')
-rw-r--r-- | mediagoblin/gmg_commands/reprocess.py | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/mediagoblin/gmg_commands/reprocess.py b/mediagoblin/gmg_commands/reprocess.py index 30575033..d6ac99ac 100644 --- a/mediagoblin/gmg_commands/reprocess.py +++ b/mediagoblin/gmg_commands/reprocess.py @@ -199,13 +199,35 @@ def _set_media_state(args): args[0].state = 'processed' +def extract_entry_and_type(media_id): + raise NotImplementedError + + def available(args): # Get the media type, either by looking up media id, or by specific type + try: + media_id = int(args.id_or_type) + media_type, media_entry = extract_entry_and_type(media_id) + except ValueError: + media_type = args.id_or_type + media_entry = None + + manager_class = hook_handle(('reprocess_manager', media_type)) + manager = manager_class() - ### TODO: look up by id + if media_entry is None: + processors = manager.list_all_processors() + else: + processors = manager.list_eligible_processors(media_entry) + + print "Available processors:" + print "---------------------" - # - pass + for processor in processors: + if processor.description: + print " - %s: %s" % (processor.name, processor.description) + else: + print " - %s" % processor.name def run(args): @@ -214,7 +236,6 @@ def run(args): # Run eagerly unless explicetly set not to if not args.celery: os.environ['CELERY_ALWAYS_EAGER'] = 'true' - commands_util.setup_app(args) _set_media_state(args) _set_media_type(args) @@ -227,6 +248,8 @@ def run(args): def reprocess(args): + commands_util.setup_app(args) + if args.reprocess_subcommand == "run": run(args) elif args.reprocess_subcommand == "available": |