From cdb12929637626a3ee3fa011a68dd2c948de2351 Mon Sep 17 00:00:00 2001 From: Michael Bienia Date: Sat, 25 Jul 2009 17:03:14 +0200 Subject: [PATCH] - lpapiwrapper.py: fix typos - buildd: add options for the new mode (v2) --- buildd | 18 ++++++++++++++++++ ubuntutools/lp/lpapiwrapper.py | 8 ++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/buildd b/buildd index 2a30d44..6379dab 100755 --- a/buildd +++ b/buildd @@ -49,8 +49,26 @@ retryRescoreOptions.add_option("-a", "--arch", type = "string", "Valid architectures include: " \ "%s." % ", ".join(validArchs)) +# A new calling interface (v2) +v2options = OptionGroup(optParser, "Extended calling convention", + "These options and parameter ordering is only available in the --v2 mode.\n" + "Usage: buildd --v2 [options] --series=SERIES ...") +v2options.add_option('--v2', action = 'store_true', dest = 'v2mode', default = False, + help = 'Enable the new (v2) mode') +v2options.add_option('--series', action = 'store', dest = 'series', type = 'string', + help = 'Selects the Ubuntu series to operate on.') +v2options.add_option('--retry', action = 'store_true', dest = 'retry', default = False, + help = 'Retry builds (give-back).') +v2options.add_option('--rescore', action = 'store', dest = 'priority', type = 'int', + help = 'Rescore builds to .') +v2options.add_option('--arch2', action = 'append', dest = 'architecture', type = 'string', + help = "Affect only 'architecture' (can be used several times). " + "Valid architectures include: %s." % ', '.join(validArchs)) + # Add the retry options to the main group. optParser.add_option_group(retryRescoreOptions) +# Add the new v2 mode to the main group. +optParser.add_option_group(v2options) # Parse our options. (options, args) = optParser.parse_args() diff --git a/ubuntutools/lp/lpapiwrapper.py b/ubuntutools/lp/lpapiwrapper.py index c5ed5b6..7e0489c 100644 --- a/ubuntutools/lp/lpapiwrapper.py +++ b/ubuntutools/lp/lpapiwrapper.py @@ -420,7 +420,7 @@ class SourcePackage(BaseWrapper): else: res.append(' %s: failed' % arch) return "Retrying builds of '%s':\n%s" % ( - self.PackageName(), '\n'.join(res)) + self.getPackageName(), '\n'.join(res)) class PersonTeam(BaseWrapper): @@ -527,12 +527,12 @@ class Build(BaseWrapper): def rescore(self, score): if self.can_be_rescored: - self.rescore(score = score) + self().rescore(score = score) return True return False def retry(self): - if self.can_be_tried: - self.retry() + if self.can_be_retried: + self().retry() return True return False