Create an abstract Manifest base class
This will help as we add support for another manifest type. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
ca3d8ff4fc
commit
f1a6b14fdc
7 changed files with 99 additions and 39 deletions
10
command.py
10
command.py
|
@ -17,6 +17,8 @@ import os
|
|||
import optparse
|
||||
import sys
|
||||
|
||||
import manifest_loader
|
||||
|
||||
from error import NoSuchProjectError
|
||||
|
||||
class Command(object):
|
||||
|
@ -24,7 +26,6 @@ class Command(object):
|
|||
"""
|
||||
|
||||
common = False
|
||||
manifest = None
|
||||
_optparse = None
|
||||
|
||||
def WantPager(self, opt):
|
||||
|
@ -57,6 +58,13 @@ class Command(object):
|
|||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def manifest(self):
|
||||
return self.GetManifest()
|
||||
|
||||
def GetManifest(self, reparse=False):
|
||||
return manifest_loader.GetManifest(self.repodir, reparse)
|
||||
|
||||
def GetProjects(self, args, missing_ok=False):
|
||||
"""A list of projects that match the arguments.
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue