requestsync: Make pylint happier.

This commit is contained in:
Benjamin Drung 2010-12-27 20:06:23 +01:00
parent 08042bf61f
commit 086ca39f10

View File

@ -45,44 +45,47 @@ def main():
# Our usage options. # Our usage options.
usage = ('Usage: %prog [options] ' usage = ('Usage: %prog [options] '
'<source package> [<target release> [base version]]') '<source package> [<target release> [base version]]')
p = OptionParser(usage) parser = OptionParser(usage)
p.add_option('-d', type='string', parser.add_option('-d', type='string',
dest='dist', default='unstable', dest='dist', default='unstable',
help='Debian distribution to sync from.') help='Debian distribution to sync from.')
p.add_option('-k', type='string', parser.add_option('-k', type='string',
dest='keyid', default=None, dest='keyid', default=None,
help='GnuPG key ID to use for signing report ' help='GnuPG key ID to use for signing report '
'(only used when emailing the sync request).') '(only used when emailing the sync request).')
p.add_option('-n', action='store_true', parser.add_option('-n', action='store_true',
dest='newpkg', default=False, dest='newpkg', default=False,
help='Whether package to sync is a new package in Ubuntu.') help='Whether package to sync is a new package in '
p.add_option('--lp', action='store_true', 'Ubuntu.')
parser.add_option('--lp', action='store_true',
dest='lpapi', default=False, dest='lpapi', default=False,
help='Specify whether to use the LP API for filing ' help='Specify whether to use the LP API for filing '
'the sync request (recommended).') 'the sync request (recommended).')
p.add_option('-l', '--lpinstance', metavar='INSTANCE', parser.add_option('-l', '--lpinstance', metavar='INSTANCE',
dest='lpinstance', default=None, dest='lpinstance', default=None,
help='Launchpad instance to connect to (default: production).') help='Launchpad instance to connect to '
p.add_option('-s', action='store_true', '(default: production).')
parser.add_option('-s', action='store_true',
dest='sponsorship', default=False, dest='sponsorship', default=False,
help='Force sponsorship') help='Force sponsorship')
p.add_option('-C', action='store_true', parser.add_option('-C', action='store_true',
dest='missing_changelog_ok', default=False, dest='missing_changelog_ok', default=False,
help='Allow changelog to be manually filled in when missing') help='Allow changelog to be manually filled in '
p.add_option('-e', action='store_true', 'when missing')
parser.add_option('-e', action='store_true',
dest='ffe', default=False, dest='ffe', default=False,
help='Use this after FeatureFreeze for non-bug fix syncs, ' help='Use this after FeatureFreeze for non-bug fix '
'changes default subscription to the appropriate ' 'syncs, changes default subscription to the '
'release team.') 'appropriate release team.')
p.add_option('--no-conf', action='store_true', parser.add_option('--no-conf', action='store_true',
dest='no_conf', default=False, dest='no_conf', default=False,
help="Don't read config files or environment variables") help="Don't read config files or environment variables")
(options, args) = p.parse_args() (options, args) = parser.parse_args()
if not len(args): if not len(args):
p.print_help() parser.print_help()
sys.exit(1) sys.exit(1)
config = UDTConfig(options.no_conf) config = UDTConfig(options.no_conf)
@ -151,7 +154,7 @@ def main():
force_base_version = Version(args[2]) force_base_version = Version(args[2])
else: else:
print >> sys.stderr, 'E: Too many arguments.' print >> sys.stderr, 'E: Too many arguments.'
p.print_help() parser.print_help()
sys.exit(1) sys.exit(1)
# Get the current Ubuntu source package # Get the current Ubuntu source package
@ -177,8 +180,8 @@ def main():
debian_srcpkg = getDebianSrcPkg(srcpkg, distro) debian_srcpkg = getDebianSrcPkg(srcpkg, distro)
debian_version = Version(debian_srcpkg.getVersion()) debian_version = Version(debian_srcpkg.getVersion())
debian_component = debian_srcpkg.getComponent() debian_component = debian_srcpkg.getComponent()
except udtexceptions.PackageNotFoundException, e: except udtexceptions.PackageNotFoundException, error:
print >> sys.stderr, "E: %s" % e print >> sys.stderr, "E: %s" % error
sys.exit(1) sys.exit(1)
# Stop if Ubuntu has already the version from Debian or a newer version # Stop if Ubuntu has already the version from Debian or a newer version
@ -190,8 +193,8 @@ def main():
srcpkg, distro) srcpkg, distro)
debian_version = Version(debian_srcpkg.getVersion()) debian_version = Version(debian_srcpkg.getVersion())
debian_component = debian_srcpkg.getComponent() debian_component = debian_srcpkg.getComponent()
except udtexceptions.PackageNotFoundException, e: except udtexceptions.PackageNotFoundException, error:
print >> sys.stderr, "E: %s" % e print >> sys.stderr, "E: %s" % error
sys.exit(1) sys.exit(1)
if ubuntu_version == debian_version: if ubuntu_version == debian_version: