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

« back to all changes in this revision

Viewing changes to providers/plainbox-provider-resource-generic/bin/meminfo_resource

  • Committer: Zygmunt Krynicki
  • Date: 2013-05-29 07:50:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2153.
  • Revision ID: zygmunt.krynicki@canonical.com-20130529075030-ngwz245hs2u3y6us
checkbox: move current checkbox code into checkbox-old

This patch cleans up the top-level directory of the project into dedicated
sub-project directories. One for checkbox-old (the current checkbox and all the
associated stuff), one for plainbox and another for checkbox-ng.

There are some associated changes, such as updating the 'source' mode of
checkbox provider in plainbox, and fixing paths in various test scripts that we
have.

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python3
2
 
#
3
 
# This file is part of Checkbox.
4
 
#
5
 
# Copyright 2009 Canonical Ltd.
6
 
#
7
 
# Checkbox is free software: you can redistribute it and/or modify
8
 
# it under the terms of the GNU General Public License version 3,
9
 
# as published by the Free Software Foundation.
10
 
 
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
 
import sys
21
 
 
22
 
from checkbox_support.parsers.meminfo import MeminfoParser
23
 
 
24
 
# Filename where meminfo is stored.
25
 
MEMINFO_FILENAME = "/proc/meminfo"
26
 
 
27
 
 
28
 
class MeminfoResult:
29
 
 
30
 
    def setMemory(self, memory):
31
 
        for key, value in sorted(memory.items()):
32
 
            print("%s: %s" % (key, value))
33
 
 
34
 
 
35
 
def main():
36
 
    stream = open(MEMINFO_FILENAME)
37
 
    parser = MeminfoParser(stream)
38
 
 
39
 
    result = MeminfoResult()
40
 
    parser.run(result)
41
 
 
42
 
    return 0
43
 
 
44
 
 
45
 
if __name__ == "__main__":
46
 
    sys.exit(main())