summaryrefslogtreecommitdiffstats
path: root/command.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-06-14 16:17:27 -0400
committerMike Frysinger <vapier@google.com>2021-06-15 06:08:13 +0000
commitd58d0dd3bf40f2c5e754c8a0a622c7d4e58425b8 (patch)
tree37fc46209f7822a29b0879bc2aa7405323f3db4a /command.py
parentd88b369a42462cf5fe4ff2a09b9b7b52e0ee333a (diff)
downloadgit-repo-d58d0dd3bf40f2c5e754c8a0a622c7d4e58425b8.tar.gz
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>
Diffstat (limited to 'command.py')
-rw-r--r--command.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/command.py b/command.py
index 94f4d754..dc765db0 100644
--- a/command.py
+++ b/command.py
@@ -43,9 +43,6 @@ class Command(object):
43 """Base class for any command line action in repo. 43 """Base class for any command line action in repo.
44 """ 44 """
45 45
46 manifest = None
47 _optparse = None
48
49 # Singleton for all commands to track overall repo command execution and 46 # Singleton for all commands to track overall repo command execution and
50 # provide event summary to callers. Only used by sync subcommand currently. 47 # provide event summary to callers. Only used by sync subcommand currently.
51 # 48 #
@@ -61,6 +58,15 @@ class Command(object):
61 # it is the number of parallel jobs to default to. 58 # it is the number of parallel jobs to default to.
62 PARALLEL_JOBS = None 59 PARALLEL_JOBS = None
63 60
61 def __init__(self, repodir=None, client=None, manifest=None, gitc_manifest=None):
62 self.repodir = repodir
63 self.client = client
64 self.manifest = manifest
65 self.gitc_manifest = gitc_manifest
66
67 # Cache for the OptionParser property.
68 self._optparse = None
69
64 def WantPager(self, _opt): 70 def WantPager(self, _opt):
65 return False 71 return False
66 72