import wizard
-class Error(wizard.Error):
- """Base error class for deploy errors"""
- pass
-
-class NoSuchApplication(Error):
- pass
-
-class DeploymentParseError(Error):
- def __init__(self, malformed):
- self.malformed = malformed
- def __str__(self):
- return """
-
-ERROR: Could not parse deployment string:
-%s
-""" % self.malformed
-
-class ScriptsVersionTooManyFieldsError(Error):
- def __str__(self):
- return """
-
-ERROR: Could not parse .scripts-version file. It
-contained too many fields.
-"""
-
-class ScriptsVersionNotEnoughFieldsError(Error):
- def __str__(self):
- return """
-
-ERROR: Could not parse .scripts-version file. It
-didn't contain enough fields.
-"""
-
-class ScriptsVersionNoSuchFile(Error):
- def __init__(self, file):
- self.file = file
- def __str__(self):
- return """
-
-ERROR: File %s didn't exist.
-""" % self.file
-
def getInstallLines(global_options):
"""Retrieves a list of lines from the version directory that
can be passed to Deployment.parse()"""
def __init__(self, name):
self.name = name
self.versions = {}
- # Some cache variables for fast access of calculated data
+ # This is 'wizard summary' specific code
self._total = 0
self._max = 0
self._c_exists = {}
+ def getRepository(self):
+ """Returns the Git repository that would contain this application."""
+ repo = os.path.join("/afs/athena.mit.edu/contrib/scripts/wizard/srv", self.name + ".git")
+ if not os.path.isdir(repo):
+ raise NoRepositoryError(app)
+ return repo
def getVersion(self, version):
if version not in self.versions:
self.versions[version] = ApplicationVersion(distutils.version.LooseVersion(version), self)
self.application = application
self.c = 0
self.c_exists = {}
+ def getScriptsTag(self):
+ """Returns the name of the Git tag for this version"""
+ # XXX: This assume sthat there's only a -scripts version
+ # which will not be true in the future.
+ return "v%s-scripts" % self.version
def __cmp__(x, y):
return cmp(x.version, y.version)
@staticmethod
return " %-12s %3d %s" \
% (self.version, self.c, self.application._graph(self.c))
+class Error(wizard.Error):
+ """Base error class for deploy errors"""
+ pass
+
+class NoSuchApplication(Error):
+ pass
+
+class DeploymentParseError(Error):
+ def __init__(self, malformed):
+ self.malformed = malformed
+ def __str__(self):
+ return """
+
+ERROR: Could not parse deployment string:
+%s
+""" % self.malformed
+
+class ScriptsVersionTooManyFieldsError(Error):
+ def __str__(self):
+ return """
+
+ERROR: Could not parse .scripts-version file. It
+contained too many fields.
+"""
+
+class ScriptsVersionNotEnoughFieldsError(Error):
+ def __str__(self):
+ return """
+
+ERROR: Could not parse .scripts-version file. It
+didn't contain enough fields.
+"""
+
+class ScriptsVersionNoSuchFile(Error):
+ def __init__(self, file):
+ self.file = file
+ def __str__(self):
+ return """
+
+ERROR: File %s didn't exist.
+""" % self.file
+
# If you want, you can wrap this up into a registry and access things
# through that, but it's not really necessary