~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/distroseries.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-28 18:30:43 UTC
  • mfrom: (13543.2.2 bug-782210)
  • Revision ID: launchpad@pqm.canonical.com-20110728183043-gx13tmlw3hxgpwxp
[r=jcsackett][bug=782210] Add an option to search among "All
        packages" (and remove the option to search among "Ignored packages").

Show diffs side-by-side

added added

removed removed

Lines of Context:
747
747
 
748
748
# A helper to create package filtering radio button vocabulary.
749
749
NON_IGNORED = 'non-ignored'
750
 
IGNORED = 'ignored'
751
750
HIGHER_VERSION_THAN_PARENT = 'higher-than-parent'
752
751
RESOLVED = 'resolved'
 
752
ALL = 'all'
753
753
 
754
754
DEFAULT_PACKAGE_TYPE = NON_IGNORED
755
755
 
756
756
 
757
757
def make_package_type_vocabulary(parent_name, higher_version_option=False):
758
758
    voc = [
759
 
        SimpleTerm(
760
 
            NON_IGNORED, NON_IGNORED, 'Non ignored packages'),
761
 
        SimpleTerm(IGNORED, IGNORED, 'Ignored packages'),
762
 
        SimpleTerm(RESOLVED, RESOLVED, "Resolved package differences")]
 
759
        SimpleTerm(NON_IGNORED, NON_IGNORED, 'Non ignored packages'),
 
760
        SimpleTerm(RESOLVED, RESOLVED, "Resolved package differences"),
 
761
        SimpleTerm(ALL, ALL, 'All packages'),
 
762
        ]
763
763
    if higher_version_option:
764
764
        higher_term = SimpleTerm(
765
765
            HIGHER_VERSION_THAN_PARENT,
766
766
            HIGHER_VERSION_THAN_PARENT,
767
767
            "Ignored packages with a higher version than in %s"
768
768
                % parent_name)
769
 
        voc.insert(2, higher_term)
 
769
        voc.insert(1, higher_term)
770
770
    return SimpleVocabulary(tuple(voc))
771
771
 
772
772
 
1058
1058
        package_type_dsd_status = {
1059
1059
            NON_IGNORED: (
1060
1060
                DistroSeriesDifferenceStatus.NEEDS_ATTENTION,),
1061
 
            IGNORED: DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT,
1062
1061
            HIGHER_VERSION_THAN_PARENT: (
1063
1062
                DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT),
1064
1063
            RESOLVED: DistroSeriesDifferenceStatus.RESOLVED,
 
1064
            ALL: DistroSeriesDifferenceStatus.items,
1065
1065
        }
1066
1066
 
1067
1067
        status = package_type_dsd_status[self.specified_package_type]