-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbs.py
88 lines (74 loc) · 1.74 KB
/
bs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/python3
#
#
hprefix = " "
osicons = {
"Debian": "debian",
"RedHat": "hat-fedora",
"FreeBSD": "freebsd",
"OpenBSD": "openbsd",
"Suse": "opensuse",
"LibreELEC": "youtube-tv",
"OpenWrt": "router-wireless",
"Windows": "windows",
"Darwin": "apple",
}
def osicons_get(osfamily, distribution = ""):
if osfamily in osicons:
return osicons[osfamily]
elif distribution in osicons:
return osicons[distribution]
else:
return "monitor"
def bs_card_begin(title, icon = ""):
global hprefix
html = ""
html += hprefix + "<div class='card'>\n"
if icon != "":
html += hprefix + " <div class='card-header'>" + title + "<img class='float-right' src='assets/MaterialDesignIcons/" + icon + ".svg'></div>\n"
else:
html += hprefix + " <div class='card-header'>" + title + "</div>\n"
html += hprefix + " <div class='card-body'>\n"
hprefix += " "
hprefix += " "
return html
def bs_card_end():
global hprefix
hprefix = hprefix[:-1]
hprefix = hprefix[:-1]
html = hprefix + "</div></div><!--/card-->\n"
return html
def bs_row_begin():
global hprefix
html = hprefix + "<div class='row'>\n"
hprefix += " "
return html
def bs_row_end():
global hprefix
hprefix = hprefix[:-1]
html = hprefix + "</div><!--/row-->\n"
return html
def bs_col_begin(width):
global hprefix
html = hprefix + "<div class='col-" + width + "'>\n"
hprefix += " "
return html
def bs_col_end():
global hprefix
hprefix = hprefix[:-1]
html = hprefix + "</div><!--/col-->\n"
return html
def bs_table_begin():
global hprefix
html = hprefix + "<table>\n"
hprefix += " "
return html
def bs_table_end():
global hprefix
hprefix = hprefix[:-1]
html = hprefix + "</table>\n"
return html
def bs_add(html):
global hprefix
html = hprefix + html + "\n"
return html