Skip to content

Commit

Permalink
Merge pull request readthedocs#4321 from stsewd/fix-deprecations-mana…
Browse files Browse the repository at this point in the history
…gement-commands

Fix deprecations in management commands
  • Loading branch information
ericholscher authored Jul 3, 2018
2 parents ab3b567 + c6fd24d commit d413341
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 33 deletions.
26 changes: 15 additions & 11 deletions readthedocs/core/management/commands/clean_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ class Command(BaseCommand):

help = __doc__

option_list = BaseCommand.option_list + (
make_option('--days',
dest='days',
type='int',
default=365,
help='Find builds older than DAYS days, default: 365'),
make_option('--dryrun',
action='store_true',
dest='dryrun',
help='Perform dry run on build cleanup'),
)
def add_arguments(self, parser):
parser.add_argument(
'--days',
dest='days',
type='int',
default=365,
help='Find builds older than DAYS days, default: 365'
)

parser.add_argument(
'--dryrun',
action='store_true',
dest='dryrun',
help='Perform dry run on build cleanup'
)

def handle(self, *args, **options):
"""Find stale builds and remove build paths"""
Expand Down
14 changes: 8 additions & 6 deletions readthedocs/core/management/commands/reindex_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
class Command(BaseCommand):

help = __doc__
option_list = BaseCommand.option_list + (
make_option('-p',
dest='project',
default='',
help='Project to index'),
)

def add_arguments(self, parser):
parser.add_argument(
'-p',
dest='project',
default='',
help='Project to index'
)

def handle(self, *args, **options):
"""Build/index all versions or a single project's version"""
Expand Down
40 changes: 24 additions & 16 deletions readthedocs/core/management/commands/update_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,30 @@ class Command(BaseCommand):
"""Management command for rebuilding documentation on projects"""

help = __doc__
option_list = BaseCommand.option_list + (
make_option('-r',
action='store_true',
dest='record',
default=False,
help='Make a Build'),
make_option('-f',
action='store_true',
dest='force',
default=False,
help='Force a build in sphinx'),
make_option('-V',
dest='version',
default=None,
help='Build a version, or all versions')
)

def add_arguments(self, parser):
parser.add_argument(
'-r',
action='store_true',
dest='record',
default=False,
help='Make a Build'
)

parser.add_argument(
'-f',
action='store_true',
dest='force',
default=False,
help='Force a build in sphinx'
)

parser.add_argument(
'-V',
dest='version',
default=None,
help='Build a version, or all versions'
)

def handle(self, *args, **options):
record = options['record']
Expand Down

0 comments on commit d413341

Please sign in to comment.