Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from jogwen/fix_for_django_pre_1.8
Browse files Browse the repository at this point in the history
Support Django < v1.8 again
  • Loading branch information
saippuakauppias committed Jul 8, 2015
2 parents d39b5ab + c8758cd commit 14c9240
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions django_maven/management/commands/maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def usage(self, subcommand):
return usage

def create_parser(self, prog_name, subcommand, subcommand_class):
if not self.use_argparse:
if hasattr(self, 'use_argparse') and self.use_argparse:
return super(Command, self).create_parser(prog_name, subcommand)
else:
return OptionParser(prog=prog_name,
usage=subcommand_class.usage(subcommand),
version=subcommand_class.get_version(),
option_list=subcommand_class.option_list)
else:
return super(Command, self).create_parser(prog_name, subcommand)

def run_from_argv(self, argv):
if len(argv) <= 2 or argv[2] in ['-h', '--help']:
Expand All @@ -50,7 +50,7 @@ def run_from_argv(self, argv):

subcommand_class = self._get_subcommand_class(argv[2])
parser = self.create_parser(argv[0], argv[2], subcommand_class)
if self.use_argparse:
if hasattr(self, 'use_argparse') and self.use_argparse:
options = parser.parse_args(argv[3:])
cmd_options = vars(options)
args = cmd_options.pop('args', ())
Expand Down

0 comments on commit 14c9240

Please sign in to comment.