diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-08-09 13:56:23 -0500 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-16 15:30:15 -0700 |
commit | 55a10fef0ae97cb33c8393a7a25487c2666b4cf1 (patch) | |
tree | 90169c25ce2bfa91c33775682a3bced47ce214cf /mediagoblin/media_types | |
parent | 85ead8ac3cf59aeee12ddd3b33ecfeb03c3aa946 (diff) | |
download | mediagoblin-55a10fef0ae97cb33c8393a7a25487c2666b4cf1.tar.lz mediagoblin-55a10fef0ae97cb33c8393a7a25487c2666b4cf1.tar.xz mediagoblin-55a10fef0ae97cb33c8393a7a25487c2666b4cf1.zip |
`gmg reprocess available --action-help` now tells you processor arguments!
Every reprocessing action possible can inform you of its command line
argument stuff! Is that awesome or what?
Diffstat (limited to 'mediagoblin/media_types')
-rw-r--r-- | mediagoblin/media_types/image/processing.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mediagoblin/media_types/image/processing.py b/mediagoblin/media_types/image/processing.py index ea372e76..f4ba4e5a 100644 --- a/mediagoblin/media_types/image/processing.py +++ b/mediagoblin/media_types/image/processing.py @@ -313,7 +313,8 @@ class CommonImageProcessor(MediaProcessor): 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=( @@ -332,7 +333,7 @@ class InitialProcessor(CommonImageProcessor): 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 """ @@ -344,16 +345,17 @@ class InitialProcessor(CommonImageProcessor): ############################### @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 |