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

« back to all changes in this revision

Viewing changes to checkbox-ng/checkbox_ng/config.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
# This file is part of Checkbox.
 
2
#
 
3
# Copyright 2013 Canonical Ltd.
 
4
# Written by:
 
5
#   Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
 
6
#
 
7
# Checkbox is free software: you can redistribute it and/or modify
 
8
# it under the terms of the GNU General Public License as published by
 
9
# the Free Software Foundation, either version 3 of the License, or
 
10
# (at your option) any later version.
 
11
#
 
12
# Checkbox is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
# GNU General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.
 
19
 
 
20
"""
 
21
:mod:`checkbox_ng.config` -- CheckBoxNG configuration
 
22
=====================================================
 
23
"""
 
24
 
 
25
import os
 
26
import itertools
 
27
 
 
28
from plainbox.impl.applogic import PlainBoxConfig
 
29
 
 
30
 
 
31
class CheckBoxConfig(PlainBoxConfig):
 
32
    """
 
33
    Configuration for checkbox-ng
 
34
    """
 
35
 
 
36
    class Meta(PlainBoxConfig.Meta):
 
37
        # TODO: properly depend on xdg and use real code that also handles
 
38
        # XDG_CONFIG_HOME.
 
39
        #
 
40
        # NOTE: filename_list is composed of checkbox and plainbox variables,
 
41
        # mixed so that:
 
42
        # - checkbox takes precedence over plainbox
 
43
        # - ~/.config takes precedence over /etc
 
44
        filename_list = list(
 
45
            itertools.chain(
 
46
                *zip(
 
47
                    PlainBoxConfig.Meta.filename_list, (
 
48
                        '/etc/xdg/checkbox.conf',
 
49
                        os.path.expanduser('~/.config/checkbox.conf')))))