pyuserconfig/userconfig/checks.py

62 lines
1.2 KiB
Python
Raw Normal View History

2013-01-11 00:35:09 +01:00
#!/usr/bin/env python
# encoding: utf-8
2013-01-12 23:04:52 +01:00
#
# $Id$
# $URL$
2013-01-11 00:35:09 +01:00
"""
checks.py
Created by Marcus Stoegbauer on 2013-01-10.
Copyright (c) 2013 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import platform
class checks(object):
def __init__(self):
pass
# def __init__
def __classesForHost__(self):
"""docstring for __classesForHost"""
classes = []
for c in dir(self):
if c.startswith("__"):
continue
# if __
ret = getattr(self, c)()
classes.append(ret)
# for c
return map(lambda k: (k[1],k[2]), sorted(classes, key=lambda k: k[0]))
# def __classesForHost__
2013-01-12 23:04:52 +01:00
def header(self):
"""docstring for header"""
return (0, "", "header")
# def header
def footer(self):
"""docstring for footer"""
return (1000, "", "footer")
2013-01-11 00:35:09 +01:00
def all(self):
"""docstring for all"""
2013-01-12 23:04:52 +01:00
return (998, "", "all")
2013-01-11 00:35:09 +01:00
# def all
def arch(self):
"""docstring for arch"""
2013-01-12 17:17:12 +01:00
return(800, "Arch", platform.system())
2013-01-11 00:35:09 +01:00
# def arch
def hostname(self):
"""docstring for hostname"""
hostname = platform.node()
if hostname.count("."):
hostname = hostname.split(".")[0]
return(10, "Host", hostname)
# def hostname
# def checks