20 from __future__
import print_function
30 if os.access(
'/usr/bin/lsb_release', os.X_OK):
31 return subprocess.getstatusoutput(
'/usr/bin/lsb_release')[1].strip()
34 initdefault_re = re.compile(
r':(\d+):initdefault:')
39 with open(
'/etc/inittab')
as i_tab:
40 inittab = i_tab.read()
41 match = initdefault_re.search(inittab)
43 defaultRunlevel = match.group(1)
46 defaultRunlevel = subprocess.getstatusoutput(
'/sbin/runlevel')[1].split()[1].strip()
48 sys.stderr.write(
_(
'Cannot Determine Runlevel'))
49 return defaultRunlevel.strip()
52 return smolt_config.get_config_attr(
"OS",
"Calvin and Hobbes")
54 if __name__ ==
'__main__':
60 for k, v
in list(dict.items()):
61 print(
'%s: "%s"' % (k, v))