-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.py
38 lines (31 loc) · 1007 Bytes
/
index.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
import os;
import globs;
from web_pyhtml import pyhtml_parser;
# Returns:
# <s:buffer>, <i:next_offset>
def GET(size_buf, offset, vardict, body): #{
print("index.GET(size_buf:%d, offset:%d, vardict, body)" % (size_buf, offset));
buf = '';
read = 0;
# Variables
title = globs.prod + " " + globs.desc;
ver = '<a href="' + globs.url + '">' \
+ title + " " + globs.ver + "<br>\n" \
+ "on " + os.uname().machine + " (" + os.uname().sysname + ") " + "<br>\n" \
+ "uPython " + os.uname().version + " (" + os.uname().release + ")" \
+ '</a>';
uid = globs.uid;
mac = globs.mac;
tag, buf, read = pyhtml_parser('index.pyhtml', size_buf, offset, vardict, body);
if (tag): #{
print("Processing py tag:|" + buf + "|");
buf = eval(buf, {
'title': title
,'ver': ver
,'uid': uid
,'mac': mac
});
#}
return buf, read;
#}
# vim:ts=4:tw=80:sw=4:et:ai:si