RFE: Packages of projects/distros

Bug #249461 reported by Stephan Rügamer
2
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Fix Released
Undecided
Unassigned

Bug Description

Dear Colleagues,

while having the projectlists, we want also to know what packages are in a project which could be a distro, too (i.e. ubuntu)

I'll added some magic code to html_projectlist.py + projectbase.py, which works now according to the other parts of py-lp-bugs.

If the project is not a distro, so http://launchpad.net/<project>/+allpackages doesn't exists, it throws the standard launchpadbugs.exceptions.LaunchpadURLError automatically...this needs to be catched before you declare a project a distro.

Please find attached the related branch :)

Regards,

\sh

Revision history for this message
Stephan Rügamer (sruegamer) wrote :

TEstscript:

#!/usr/bin/python

import launchpadbugs.connector as Connector
from launchpadbugs.basebuglistfilter import URLBugListFilter
import launchpadbugs.html_bug, launchpadbugs.html_projectlist

def counter_hook(counter,block_size,size):
    print "Counter %d %d %d " % (counter, block_size, size)

projectList=Connector.ConnectProjectPackageList(method="html")
projectList.set_progress_hook(counter_hook,300)
f=URLBugListFilter()
f.add_option("batch",300)
packagelist=projectList(f("http://launchpad.net/leonov/+allpackages"))

for package in packagelist:
  print "Package Name: %s -> Package URL: %s" % (package.package_name, package.package_url)

Revision history for this message
Markus Korn (thekorn) wrote :

I did not make a close code review yet, but on the very first view two questions came in my mind:

1.) Naming: Why did you choose 'ConnectProjectPackageList'? - projects can not have packages. So in my opinion it should either be ConnectDistroPackageList or ConnectPackageList

2.) In the example above it should be:
packagelist = projectList(f("https://edge.launchpad.net/ubuntu/+allpackages"))
right?

I will look at the code tomorrow morning.
Thanks again for your work,
Markus

Revision history for this message
Stephan Rügamer (sruegamer) wrote :

Hi Markus,

2) Yes :) But you can also insert /debian/+allpackages (0 packages)
or a simple project, which will raise the described exception (which is correct)

1) Well, A Distro is also listed under projects, so I think it's quite correct, to call it ProjectPackageList, because I think we will have in the future, projects which could be distros (i.e. derivatives of ubuntu).

More on IRC :)

\sh

Revision history for this message
Markus Korn (thekorn) wrote :

Thanks, Good work Stephan.
merged and pushed
------------------------------------------------------------
revno: 137
committer: Markus Korn <email address hidden>
branch nick: main
timestamp: Fri 2008-07-18 10:09:25 +0200
message:
  Stephan Hermann added support package lists, thanks Stephan
  (LP: #249461)
    ------------------------------------------------------------

Changed in python-launchpad-bugs:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.