mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-10 17:43:28 +00:00
pm-helper: make use of YesNoQuestion
This commit is contained in:
parent
d35268b797
commit
7f5e9c8680
11
pm-helper
11
pm-helper
@ -22,6 +22,7 @@ from argparse import ArgumentParser
|
|||||||
import yaml
|
import yaml
|
||||||
from launchpadlib.launchpad import Launchpad
|
from launchpadlib.launchpad import Launchpad
|
||||||
|
|
||||||
|
from ubuntutools.question import YesNoQuestion
|
||||||
from ubuntutools.utils import get_url
|
from ubuntutools.utils import get_url
|
||||||
|
|
||||||
# proposed-migration is only concerned with the devel series; unlike other
|
# proposed-migration is only concerned with the devel series; unlike other
|
||||||
@ -56,10 +57,8 @@ def claim_excuses_bug(launchpad, bug, package):
|
|||||||
if our_task.assignee:
|
if our_task.assignee:
|
||||||
print(f"Currently assigned to {our_task.assignee.name}")
|
print(f"Currently assigned to {our_task.assignee.name}")
|
||||||
|
|
||||||
print("""Do you want to claim this bug? [yN] """, end="")
|
answer = YesNoQuestion().ask("Do you want to claim this bug?", "no")
|
||||||
sys.stdout.flush()
|
if answer == "yes":
|
||||||
response = sys.stdin.readline()
|
|
||||||
if response.strip().lower().startswith("y"):
|
|
||||||
our_task.assignee = launchpad.me
|
our_task.assignee = launchpad.me
|
||||||
our_task.lp_save()
|
our_task.lp_save()
|
||||||
return True
|
return True
|
||||||
@ -131,7 +130,9 @@ def main():
|
|||||||
if not proposed_version:
|
if not proposed_version:
|
||||||
print(f"Package {args.package} not found in -proposed.")
|
print(f"Package {args.package} not found in -proposed.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
create_excuses_bug(args.launchpad, args.package, proposed_version)
|
answer = YesNoQuestion().ask("Do you want to create a bug?", "no")
|
||||||
|
if answer == "yes":
|
||||||
|
create_excuses_bug(args.launchpad, args.package, proposed_version)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
sys.stderr.write(f"{e}\n")
|
sys.stderr.write(f"{e}\n")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user