-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_page.py
61 lines (57 loc) · 2.28 KB
/
main_page.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
import lxml
from lxml.html import builder as E
#
import config
import initiate
import utilfunctions
def main_page_gen(default_style):
html = E.HTML(
E.HEAD(
E.META(**{'http-equiv':"Default-Style", 'content':default_style, 'id':'stylemetatag'}),
E.TITLE("U2ch - Main Page"),
E.SCRIPT(type = 'text/javascript', src = '/mainscript.js'), #js
*initiate.style_cache
),
E.BODY(
E.UL(initiate.stats_cache,
style = "display: none;",
id = "mblstatscache"),
E.TABLE(
E.CLASS("maintable"),
E.THEAD(E.TR(E.TD(E.DIV(E.CLASS("mainslogandiv"),
E.SPAN("U2CH"),
E.SPAN("",
style="display: inline-block; width: 5em;"),
E.SPAN("Viewing above imageboards"),
),
E.DIV(E.CLASS("mainimagediv"),
E.IMG(src="u-2.jpg", style="width:496px;height:334px;"),
),
)), id = 'header'),
E.TBODY(E.TR(E.TD(
E.HR(E.CLASS("delimeter")),
E.DIV(E.CLASS("mblcontainer"),
E.DIV(E.CLASS("mblcentering"),
initiate.board_cache_main_page,
),
),
E.HR(E.CLASS("delimeter")),
)), id = 'mainpart'),
E.TFOOT(E.TR(E.TD(
E.DIV('powered by ',
E.A('Farlight Imageboard Engine',
href='https://github.com/Alpherie/farlight_board_engine',
target='_blank',
),
id='credentials'),
)), id = 'footer'),
),
onload = 'mainpagefunc()'
)
)
return lxml.html.tostring(html)
@utilfunctions.decorator_for_style
def get(requesth, **kwargs):
return main_page_gen(kwargs['default_style'])
if __name__ == '__main__':
print(main_page_gen())