~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to plugins/attachment_info.py

  • Committer: Zygmunt Krynicki
  • Date: 2013-05-17 13:54:25 UTC
  • mto: This revision was merged to the branch mainline in revision 2130.
  • Revision ID: zygmunt.krynicki@canonical.com-20130517135425-cxcenxx5t0qrtbxd
checkbox-ng: add CheckBoxNG sub-project

CheckBoxNG (or lowercase as checkbox-ng, pypi:checkbox-ng) is a clean
implementation of CheckBox on top of PlainBox. It provides a new
executable, 'checkbox' that has some of the same commands that were
previously implemented in the plainbox package.

In particular CheckBoxNG comes with the 'checkbox sru' command
(the same one as in plainbox). Later on this sub-command will be removed
from plainbox.

CheckBoxNG depends on plainbox >= 0.3

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# This file is part of Checkbox.
 
3
#
 
4
# Copyright 2008 Canonical Ltd.
 
5
#
 
6
# Checkbox is free software: you can redistribute it and/or modify
 
7
# it under the terms of the GNU General Public License as published by
 
8
# the Free Software Foundation, either version 3 of the License, or
 
9
# (at your option) any later version.
 
10
#
 
11
# Checkbox is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
# GNU General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License
 
17
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.
 
18
#
 
19
from checkbox.plugin import Plugin
 
20
 
 
21
 
 
22
class AttachmentInfo(Plugin):
 
23
 
 
24
    def register(self, manager):
 
25
        super(AttachmentInfo, self).register(manager)
 
26
 
 
27
        self._manager.reactor.call_on("prompt-attachment",
 
28
            self.prompt_attachment)
 
29
        self._manager.reactor.call_on("report-attachment",
 
30
            self.report_attachment, -10)
 
31
 
 
32
    def report_attachment(self, attachment):
 
33
        attachment["type"] = "attachment"
 
34
 
 
35
    def prompt_attachment(self, interface, attachment):
 
36
        self._manager.reactor.fire("prompt-shell", interface, attachment)
 
37
 
 
38
 
 
39
factory = AttachmentInfo