mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-10 00:11:29 +00:00
Implement conventions found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
This commit is contained in:
parent
444b319c12
commit
069a6926c0
@ -150,7 +150,7 @@ def main():
|
|||||||
)
|
)
|
||||||
if not args.lpapi and not mailserver_host:
|
if not args.lpapi and not mailserver_host:
|
||||||
try:
|
try:
|
||||||
import DNS
|
import DNS # pylint: disable=import-outside-toplevel
|
||||||
|
|
||||||
DNS.DiscoverNameServers()
|
DNS.DiscoverNameServers()
|
||||||
mxlist = DNS.mxlookup(bug_mail_domain)
|
mxlist = DNS.mxlookup(bug_mail_domain)
|
||||||
@ -167,6 +167,7 @@ def main():
|
|||||||
mailserver_pass = config.get_value("SMTP_PASS", compat_keys=["UBUSMTP_PASS", "DEBSMTP_PASS"])
|
mailserver_pass = config.get_value("SMTP_PASS", compat_keys=["UBUSMTP_PASS", "DEBSMTP_PASS"])
|
||||||
|
|
||||||
# import the needed requestsync module
|
# import the needed requestsync module
|
||||||
|
# pylint: disable=import-outside-toplevel
|
||||||
if args.lpapi:
|
if args.lpapi:
|
||||||
from ubuntutools.lp.lpapicache import Distribution, Launchpad
|
from ubuntutools.lp.lpapicache import Distribution, Launchpad
|
||||||
from ubuntutools.requestsync.lp import (
|
from ubuntutools.requestsync.lp import (
|
||||||
@ -259,7 +260,7 @@ def main():
|
|||||||
# 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
|
||||||
if (ubuntu_version >= debian_version) and args.lpapi:
|
if (ubuntu_version >= debian_version) and args.lpapi:
|
||||||
# try rmadison
|
# try rmadison
|
||||||
import ubuntutools.requestsync.mail
|
import ubuntutools.requestsync.mail # pylint: disable=import-outside-toplevel
|
||||||
|
|
||||||
try:
|
try:
|
||||||
debian_srcpkg = ubuntutools.requestsync.mail.get_debian_srcpkg(srcpkg, distro)
|
debian_srcpkg = ubuntutools.requestsync.mail.get_debian_srcpkg(srcpkg, distro)
|
||||||
|
@ -82,8 +82,8 @@ def add_fixed_bugs(changes, bugs):
|
|||||||
# Remove duplicates
|
# Remove duplicates
|
||||||
bugs = set(str(bug) for bug in bugs)
|
bugs = set(str(bug) for bug in bugs)
|
||||||
|
|
||||||
for i in range(len(changes)):
|
for i, change in enumerate(changes):
|
||||||
if changes[i].startswith("Launchpad-Bugs-Fixed:"):
|
if change.startswith("Launchpad-Bugs-Fixed:"):
|
||||||
bugs.update(changes[i][22:].strip().split(" "))
|
bugs.update(changes[i][22:].strip().split(" "))
|
||||||
changes[i] = "Launchpad-Bugs-Fixed: %s" % (" ".join(bugs))
|
changes[i] = "Launchpad-Bugs-Fixed: %s" % (" ".join(bugs))
|
||||||
break
|
break
|
||||||
@ -285,7 +285,7 @@ def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror):
|
|||||||
dist = "unstable"
|
dist = "unstable"
|
||||||
|
|
||||||
requested_version = version
|
requested_version = version
|
||||||
if type(version) == str:
|
if isinstance(version, str):
|
||||||
version = Version(version)
|
version = Version(version)
|
||||||
|
|
||||||
if version is None or component is None:
|
if version is None or component is None:
|
||||||
|
@ -97,7 +97,7 @@ def input_number(question, min_number, max_number, default=None):
|
|||||||
print("Please input a number between %i and %i." % (min_number, max_number))
|
print("Please input a number between %i and %i." % (min_number, max_number))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("Please input a number.")
|
print("Please input a number.")
|
||||||
assert type(selected) == int
|
assert isinstance(selected, int)
|
||||||
return selected
|
return selected
|
||||||
|
|
||||||
|
|
||||||
|
@ -245,8 +245,8 @@ def get_open_ubuntu_bug_task(launchpad, bug, branch=None):
|
|||||||
Logger.info(
|
Logger.info(
|
||||||
"https://launchpad.net/bugs/%i has %i Ubuntu tasks:", bug_id, len(ubuntu_tasks)
|
"https://launchpad.net/bugs/%i has %i Ubuntu tasks:", bug_id, len(ubuntu_tasks)
|
||||||
)
|
)
|
||||||
for i in range(len(ubuntu_tasks)):
|
for i, ubuntu_task in enumerate(ubuntu_tasks):
|
||||||
print("%i) %s" % (i + 1, ubuntu_tasks[i].get_package_and_series()))
|
print("%i) %s" % (i + 1, ubuntu_task.get_package_and_series()))
|
||||||
selected = input_number(
|
selected = input_number(
|
||||||
"To which Ubuntu task does the patch belong", 1, len(ubuntu_tasks)
|
"To which Ubuntu task does the patch belong", 1, len(ubuntu_tasks)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user