mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
commands: pass settings via __init__
Instead of setting properties on the instantiated command, pass them via the constructor like normal objects. Change-Id: I8787499bd2be68565875ffe243c3cf2024b36ae7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/309324 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
12
command.py
12
command.py
@ -43,9 +43,6 @@ class Command(object):
|
||||
"""Base class for any command line action in repo.
|
||||
"""
|
||||
|
||||
manifest = None
|
||||
_optparse = None
|
||||
|
||||
# Singleton for all commands to track overall repo command execution and
|
||||
# provide event summary to callers. Only used by sync subcommand currently.
|
||||
#
|
||||
@ -61,6 +58,15 @@ class Command(object):
|
||||
# it is the number of parallel jobs to default to.
|
||||
PARALLEL_JOBS = None
|
||||
|
||||
def __init__(self, repodir=None, client=None, manifest=None, gitc_manifest=None):
|
||||
self.repodir = repodir
|
||||
self.client = client
|
||||
self.manifest = manifest
|
||||
self.gitc_manifest = gitc_manifest
|
||||
|
||||
# Cache for the OptionParser property.
|
||||
self._optparse = None
|
||||
|
||||
def WantPager(self, _opt):
|
||||
return False
|
||||
|
||||
|
Reference in New Issue
Block a user