"id_or_type",
help="Media id or media type to check")
+ available_parser.add_argument(
+ "--action-help",
+ action="store_true",
+ help="List argument help for each action available")
+
############################################
# run command (TODO: and bulk_run command??)
processors = manager.list_eligible_processors(media_entry)
print "Available processors:"
- print "---------------------"
+ print "====================="
- for processor in processors:
- if processor.description:
- print " - %s: %s" % (processor.name, processor.description)
- else:
- print " - %s" % processor.name
+ if args.action_help:
+ for processor in processors:
+ print processor.name
+ print "-" * len(processor.name)
+
+ parser = processor.generate_parser()
+ parser.print_help()
+
+ else:
+ for processor in processors:
+ if processor.description:
+ print " - %s: %s" % (processor.name, processor.description)
+ else:
+ print " - %s" % processor.name
def run(args):
def resize_step(self):
pass
- def _add_width_height_args(self, parser):
+ @classmethod
+ def _add_width_height_args(cls, parser):
parser.add_argument(
"--width", default=None,
help=(
description = "Initial processing"
@classmethod
- def media_is_eligibile(self, media_entry):
+ def media_is_eligibile(cls, media_entry):
"""
Determine if this media type is eligible for processing
"""
###############################
@classmethod
- def generate_parser(self):
+ def generate_parser(cls):
parser = argparse.ArgumentParser(
- description=self.description)
+ description=cls.description,
+ prog=cls.name)
- self._add_width_height_args(parser)
+ cls._add_width_height_args(parser)
return parser
@classmethod
- def args_to_request(self, args):
+ def args_to_request(cls, args):
raise NotImplementedError
raise NotImplementedError
@classmethod
- def media_is_eligibile(self, media_entry):
+ def media_is_eligibile(cls, media_entry):
raise NotImplementedError
###############################
###############################
@classmethod
- def generate_parser(self):
+ def generate_parser(cls):
raise NotImplementedError
@classmethod
- def parser_to_request(self, parser):
+ def parser_to_request(cls, parser):
raise NotImplementedError
##########################################