I'm trying to write a Python script using launchpadlib that can access the Ubuntu bug database, but I can't find any obvious way to restrict the search to the bugs of a particular project/distro. I know I can access bugs using
bug_one = launchpad.bugs[<bug number>]
and I can access the Ubuntu distribution using
ubuntu = launchpad.distributions['ubuntu']
but I can't find a way to combine the two so that I can retrieve a list of the bugs affecting Ubuntu. The API reference documentation doesn't mention any attribute of the project or distribution entry relating to the actual bugs (just the bug supervisor), nor does the bug entry make it clear what project it affects. Given the way the functions above work, I would have expected
ubuntu_bugs = launchpad.distributions['ubuntu'].bugs[<bug number>]
to return a certain bug affecting Ubuntu, but it doesn't and there's no obvious way to do it.