tree checksum vpatch file split hunks
all signers: asciilifeform diana_coman
antecedents: logotron_genesis.kv multsel_and_datefix.kv
press order:
logotron_genesis.kv | asciilifeform diana_coman |
multsel_and_datefix.kv | asciilifeform diana_coman |
raw_line_export.kv | asciilifeform diana_coman |
patch:
(1 . 2)(1 . 3)
5 589248 logotron_genesis "Genesis."
6 589480 multsel_and_datefix "Multiline selections and fix for date arrow."
7 589662 raw_line_export "Export lines in Phf format; fix for debug knob."
- 2209F578062ECC5636E67FCB9904CD26204C832FFD170B373773B6B6E1BD1FB85E79E99BE44A49BB1AABC99CDAE4F6DF4CEF203BDADBE3773C3586048A61888F(65 . 9)(65 . 18)
12 (3) Double-quoted search terms.
13 (4) Paste archiving.
14 (5) Multi-headed IRC bot for weather resistance.
15 (6) 'Ecologically clean' export of raw log material.
16 (7) Informative eggogology for bot commands.
17 (8) Automatic synchronization with mirrors (see 6)
18 (6) Informative eggogology for bot commands.
19 (7) Automatic synchronization with mirrors
20
21 A ZNC log eater is also required, to properly fill in the archives.
22 This is not yet available at the time of this writing.
23
24 ###############
25 Aug. 11 Update:
26 ###############
27
28 (1) Multi-line selection is implemented.
29
30 (2) User may request export of raw log lines in Phf-classical format.
31 E.g. :
32 http://logs.nosuchlabs.com/log-raw/trilema?istart=1925000&iend=1925500
- B02775926D528D67D44FA777248A014D1F5A37FC3486042A4A6E8A2CEB77651FC1681ABFF6E57E35A1E48E5896D4534C69759AC86BDC85EC1161F661811FCDB4(58 . 6)(58 . 12)
37 # On what port will sit the www logtron
38 www_port = 5002
39
40 # Maximum # of Raw Lines which may be requested in one shot:
41 max_raw = 500
42
43 # Toggle for WWWtron debug
44 www_dbg = 0
45
46 [db]
47 # Change to your DB (set it up so only answers locally)
48 db_name = nsalog
- 5CFF8BF56C249454F81E92CBE693DD68ED16626918E9FCE4F159B1173C2C1A58CC66CF9EB4925CF7B97C969FDF834F56B0DAFD1BBDF249456C9CE610E2F238C6(17 . 7)(17 . 7)
53 import re
54 from datetime import datetime
55 from urlparse import urljoin
56 from flask import Flask, request, session, url_for, redirect, \
57 from flask import Flask, request, session, url_for, redirect, Response, \
58 render_template, abort, g, flash, _app_ctx_stack, make_response, \
59 jsonify
60 from flask import Flask
(45 . 10)(45 . 12)
62 # DBism:
63 DB_Name = cfg.get("db", "db_name")
64 DB_User = cfg.get("db", "db_user")
65 DB_DEBUG = cfg.get("db", "db_debug")
66 DB_DEBUG = int(cfg.get("db", "db_debug"))
67 # Logism:
68 Base_URL = cfg.get("logotron", "base_url")
69 Era = int(cfg.get("logotron", "era"))
70 DEBUG = int(cfg.get("logotron", "www_dbg"))
71 Max_Raw_Ln = int(cfg.get("logotron", "max_raw"))
72 # WWW:
73 WWW_Port = int(cfg.get("logotron", "www_port"))
74
(66 . 9)(68 . 6)
76
77 ## Format for Date in Log Lines
78 Date_Short_Format = "%Y-%m-%d"
79
80 ## WWW Debug Knob
81 DEBUG = False
82 ##############################################################################
83
84 app = Flask(__name__)
(368 . 6)(367 . 48)
86 tail = tail)
87
88
89 @app.route('/log-raw/<chan>')
90 def rawlog(chan):
91 res = ""
92
93 # Handle rubbish chan:
94 if chan not in Channels:
95 return Response("EGGOG: No such Channel!", mimetype='text/plain')
96
97 # Get start and end indices:
98 idx_start = request.args.get('istart', default = 0, type = int)
99 idx_end = request.args.get('iend', default = 0, type = int)
100
101 # Malformed bounds?
102 if idx_start > idx_end:
103 return Response("EGGOG: Start must precede End!",
104 mimetype='text/plain')
105
106 # Demanded too many in one burst ?
107 if (idx_end - idx_start) > Max_Raw_Ln :
108 return Response("EGGOG: May request Max. of %s Lines !" % Max_Raw_Ln,
109 mimetype='text/plain')
110
111 # Get the loglines from DB
112 lines = query_db(
113 '''select * from loglines where chan=%s
114 and idx between %s and %s order by idx asc;''',
115 [chan, idx_start, idx_end], one=False)
116
117 # Retrieve raw lines in classical Phf format:
118 for l in lines:
119 action = ""
120 if l['self']:
121 action = "*;"
122 res += "%s;%s;%s%s;%s\n" % (l['idx'],
123 l['t'].strftime('%s'),
124 action,
125 l['speaker'],
126 l['payload'])
127
128 # Return plain text:
129 return Response(res, mimetype='text/plain')
130
131
132 Name_Chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-"
133