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

« back to all changes in this revision

Viewing changes to checkbox-old/scripts/uname_resource

  • Committer: Tarmac
  • Author(s): Brendan Donegan
  • Date: 2013-06-03 11:12:58 UTC
  • mfrom: (2154.2.1 bug1185759)
  • Revision ID: tarmac-20130603111258-1b3m5ydvkf1accts
"[r=zkrynicki][bug=1185759][author=brendan-donegan] automatic merge by tarmac"

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/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 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
import os
 
21
import sys
 
22
 
 
23
 
 
24
def get_uname():
 
25
    keys = ("name", "node", "release", "version", "machine")
 
26
    values = os.uname()
 
27
    return dict(list(zip(keys, values)))
 
28
 
 
29
 
 
30
def main():
 
31
    uname = get_uname()
 
32
    for key, value in uname.items():
 
33
        print("%s: %s" % (key, value))
 
34
 
 
35
    return 0
 
36
 
 
37
 
 
38
if __name__ == "__main__":
 
39
    sys.exit(main())