>>> for peertask in bugtask.related_tasks:
... if peertask.bug_target_display_name.endswith("(Ubuntu)"):
... continue
... dump_launchpad_object(peertask)
... if len(peertask.bug.bug_watches) > 0:
... print "Has a bug watch"
That only tells you if the bug has a watch; it may not be associated
with this particular bug task. If you need to know that, try:
>>> for peertask in bugtask.related_tasks:
... if peertask.bug_target_display_name.endswith("(Ubuntu)"):
... continue
... dump_launchpad_object(peertask)
... # Don't do this!
... watch_link = task._wadl_resource.representation['bug_watch_link']
... if watch_link is not None:
... print "Has a bug watch"
That's ugly and nasty, but it should work for now. I don't know of any
plans to change the internals of launchpadlib, but it /could/ change
at any moment, so don't forget to revert any hack when the fix is
released.
As a work around you could do:
>>> for peertask in bugtask. related_ tasks: bug_target_ display_ name.endswith( "(Ubuntu) "): object( peertask) bug.bug_ watches) > 0:
... if peertask.
... continue
... dump_launchpad_
... if len(peertask.
... print "Has a bug watch"
That only tells you if the bug has a watch; it may not be associated
with this particular bug task. If you need to know that, try:
>>> for peertask in bugtask. related_ tasks: bug_target_ display_ name.endswith( "(Ubuntu) "): object( peertask) resource. representation[ 'bug_watch_ link']
... if peertask.
... continue
... dump_launchpad_
... # Don't do this!
... watch_link = task._wadl_
... if watch_link is not None:
... print "Has a bug watch"
That's ugly and nasty, but it should work for now. I don't know of any
plans to change the internals of launchpadlib, but it /could/ change
at any moment, so don't forget to revert any hack when the fix is
released.