]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - pkgs/pyfire/src/__init__.py
Change file layout of the makefiles.
[people/amarx/ipfire-3.x.git] / pkgs / pyfire / src / __init__.py
CommitLineData
b09ca36a
MT
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5# #
6# This program 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# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
d207aa35
MT
21__all__ = [ "config", "executil", "hal", "net", "translate", "web", ]
22
d1aa5c2b 23import os
082638e9 24
d1aa5c2b
MT
25import hal
26
27class System:
28 def __init__(self):
29 self.dbus = hal.get_device("/org/freedesktop/Hal/devices/computer")
30
31 def getKernelVersion(self):
32 ret = None
33 try:
34 ret = self.dbus["system.kernel.version"]
35 except KeyError:
36 pass
37 return ret
38
39 def getFormfactor(self):
40 return self.dbus["system.formfactor"]
41
42 def getVendor(self):
43 ret = None
44 try:
45 ret = self.dbus["system.vendor"]
46 except KeyError:
47 pass
48 return ret
49
50 def getProduct(self):
51 ret = None
52 try:
53 ret = self.dbus["system.product"]
54 except KeyError:
55 pass
56 return ret
57
58
59if __name__ == "__main__":
60 system = System()
61 print "Kernel Version : %s" % system.getKernelVersion()
62 print "System Formfactor : %s" % system.getFormfactor()
63 print "System Vendor : %s" % system.getVendor()
64 print "System Product : %s" % system.getProduct()