unfinished changes, needs to be continued
This commit is contained in:
19
userconfig/checks.py
Normal file
19
userconfig/checks.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import platform
|
||||
|
||||
|
||||
def get_short_hostname():
|
||||
hostname = platform.node()
|
||||
if hostname.count("."):
|
||||
hostname = hostname.split(".")[0]
|
||||
return hostname
|
||||
|
||||
|
||||
def classes_for_host(reverse=False):
|
||||
classes = [(0, "", "header"),
|
||||
(1000, "", "footer"),
|
||||
(998, "", "all"),
|
||||
(800, "Arch", platform.system()),
|
||||
(10, "Host", get_short_hostname())
|
||||
]
|
||||
classes.sort(key=lambda k: k[0], reverse=reverse)
|
||||
return [(k[1], k[2]) for k in classes]
|
||||
Reference in New Issue
Block a user