** Description changed:

  Binary package hint: python-launchpadlib
  
  The scenario is searching for bug tasks associated with a package
  requested by the user. In order to do this, the developer must:
  
  1. query the current (or desired distro) for source histories that match the 
string supplied by the user. As this is a user entered string, typically the 
developer will want to offer a list to the user to choose the correct package.
  2. After the user chooses the correct history object, use the 
source_package_name attribute on that object to return the package itself.
  3. Use the searchTasks method on the source package object to find the but 
tasks.
  (Note that this is very hard to figure out from the documentation, but the 
#launchpad community is very helpful)
  
  #1
  package_text = text
  ubuntu = self.launchpad.distributions['ubuntu']
  archive = ubuntu.main_archive
- packages = archive.getPublishedSources( source_name=params['text'], 
status='Published', distro_series=ubuntu.current_series)
+ packages = archive.getPublishedSources( package_text, status='Published', 
distro_series=ubuntu.current_series)
  
  #2
  pack_name = params["package"].source_package_name
  package = self.launchpad.distributions['ubuntu'].getSourcePackage( name = 
pack_name )
   
  #3
  tasks = package.searchTasks(status="New")
  return tasks
  
  I would propose that more intuitive approach for the developer might be to 
support two ways of accomplishing this task. First, have a method to directly 
search for packages in a distro, and second, support searching for packages in 
the searchTasks method.
  pseudo code:
  #1
  packages = launchpad.distributions['ubunut'].searchSourcePackages(text = 
'foo')
  
  #2
  bug_tasks = launchpad.distributions['ubuntu'].myseries.searchTasks( 
source_package = packages[0] )
  
  ProblemType: Bug
  Architecture: amd64
  DistroRelease: Ubuntu 9.04
  Package: python-launchpadlib 0.2~bzr35-0ubuntu1
  PackageArchitecture: all
  ProcEnviron:
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: python-launchpadlib
  Uname: Linux 2.6.28-11-generic x86_64

-- 
Could be much easier to find packages in a distro
https://bugs.launchpad.net/bugs/349189
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to