-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.py
executable file
·100 lines (82 loc) · 2.81 KB
/
Menu.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env python
import os
import sys
import datetime
import HTMLgen
from HTMLcolors import *
##
# HvD -- Ha! :)
Created = datetime.datetime.fromtimestamp(os.path.getmtime('Oops.json')).strftime("%d %B %Y")
Kopje = HTMLgen.Heading(4, Created)
#doc = HTMLgen.SimpleDocument( 'HTML.rc' )
doc = HTMLgen.SeriesDocument('Menu.rc')
#doc.place_nav_buttons = 'no'
S = HTMLgen.Strong()
C = HTMLgen.Center()
BR = HTMLgen.BR()
AboutTxt = HTMLgen.RawText("""
During the COVID pandemic there was an explosion in SSH
connection attempts. A big list didn't give much insight. So I
created a few (python) scripts for generating a JSON file which I could
feed to a
<a href=https://github.com/vasturiano/circlepack-chart>circlepacking</a>
module.<br>
This is the result.<br>
Circles are zoomable, at the non-world levels dragable.<br>
A mouseover reveals textual info.<br>
<a
href=http://www.tabellenboekje.nl/landcodes-tabel-2-letter.php#sortering-code>Country codes</a>
""")
MiscTxt = HTMLgen.RawText("""
Got errors on Korea.<br>
Made a minor change in .../ipwhois/nir.py line 111.<br>
changed to: 'url': 'https://xn--c79as89aj0e29b77z.xn--3e0b707e/eng/main.jsp',
""")
TodoTxt = HTMLgen.RawText("""
Lots...<br>
Give a 'TOR-color' to tor-exitnodes.<br>
Make labels more visible.<br>
Use GeoIP(?)<br>
Use canvas(?)<br>
Make a history view(?)<br>
Create a search thing(?)<br>
""")
ContactTxt = HTMLgen.RawText( """
andrevandervlies[at]gmail[dot]com
vastur[at]gmail[dot]com <a href=https://github.com/vasturiano/circlepack-chart target=BODY>github</a>
""")
SourcesTxt = HTMLgen.RawText("""
http://vandervlies.xs4all.nl/~andre/BAN/src
""")
Table = HTMLgen.TableLite( CLASS='menu' )
ChoiceList = [('About', 'caption', ''),
('About', 'info', AboutTxt),
('Misc', 'caption', ''),
('Misc', 'info', MiscTxt),
('Todo', 'caption', ''),
('Todo', 'info', TodoTxt),
('Contact', 'caption', ''),
('Contact', 'info', ContactTxt),
('Sources', 'caption', ''),
('Sources', 'url', SourcesTxt),
]
for (item, kind, content) in ChoiceList:
if kind == 'caption':
cell = [ HTMLgen.TD(item, CLASS='menuhead') ]
elif kind == 'url':
contents = HTMLgen.Href(url=content, text=item, target='body')
#contents.append(info)
cell = [ HTMLgen.TD(contents, CLASS='menuoption') ]
elif kind == 'info':
cell = [ HTMLgen.TD(content, CLASS='menuinfo') ]
row = HTMLgen.TR()
row = row + cell
Table.append(row)
#pragma = HTMLgen.Meta(equiv='PRAGMA', content='NO-CACHE')
#doc.append(pragma)
doc.append(Kopje)
doc.append( HTMLgen.BR() )
doc.append( Table )
print """Content-type: text/html"""
print
print doc