~roadmr/ubuntu/precise/checkbox/0.13.1

« back to all changes in this revision

Viewing changes to plugins/packages_info.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Tardif
  • Date: 2009-01-20 18:55:20 UTC
  • Revision ID: james.westby@ubuntu.com-20090120185520-s18m2hninrt53fki
Tags: 0.5
* New upstream version:
  * Added concept of hyper text view to display clickable links.
  * Added concept of properties to components.
  * Added pci information to launchpad report.
  * Added dmi information to launchpad report.
  * Added text area to keyboard test.
  * Removed sourcing of base postrm script.
  * Updated translations from Launchpad.
* Fixed handling of interrupt signal (LP: #327810)
* Fixed display of text in graphical interface (LP: #240374)
* Fixed support for regexes in blacklist and whitelist (LP: #327177)
* Fixed opening of subunit log file (LP: #325737)
* Fixed internet test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
 
# Copyright (c) 2008 Canonical
3
 
#
4
 
# Written by Marc Tardif <marc@interunion.ca>
5
 
#
6
2
# This file is part of Checkbox.
7
3
#
 
4
# Copyright 2008 Canonical Ltd.
 
5
#
8
6
# Checkbox is free software: you can redistribute it and/or modify
9
7
# it under the terms of the GNU General Public License as published by
10
8
# the Free Software Foundation, either version 3 of the License, or
18
16
# You should have received a copy of the GNU General Public License
19
17
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.
20
18
#
 
19
from checkbox.properties import Int
21
20
from checkbox.plugin import Plugin
22
21
 
23
22
 
24
23
class PackagesInfo(Plugin):
25
24
 
26
 
    required_attributes = ["max_per_request"]
 
25
    # Maximum number of packages per request
 
26
    max_per_request = Int(default=100)
27
27
 
28
28
    def register(self, manager):
29
29
        super(PackagesInfo, self).register(manager)
30
 
        self._max_per_request = int(self._config.max_per_request)
31
30
        self._manager.reactor.call_on("report", self.report)
32
31
 
33
32
    def report(self):
34
33
        packages = self._manager.registry.packages.values()
35
34
        while packages:
36
 
            message = packages[:self._max_per_request]
37
 
            del packages[:self._max_per_request]
 
35
            message = packages[:self.max_per_request]
 
36
            del packages[:self.max_per_request]
38
37
            self._manager.reactor.fire("report-packages", message)
39
38
 
40
39