tree checksum vpatch file split hunks

all signers: asciilifeform diana_coman lobbes

antecedents: logotron_genesis.kv line_wraps.kv

press order:

logotron_genesis.kvasciilifeform diana_coman
multsel_and_datefix.kvasciilifeform diana_coman
raw_line_export.kvasciilifeform diana_coman
rle_errata.kvasciilifeform diana_coman
irssi2tmsr.kvasciilifeform diana_coman
uniturds_etc.kvasciilifeform diana_coman
line_wraps.kvasciilifeform diana_coman
znc2tmsr_etc.kvasciilifeform diana_coman lobbes

patch:

- 5A0FB740265D9CBED4638A8D65B1509DB23094969ECF783D97EC77E11FC1E4962EB8976A9C6BC12DA098293E8C1C9084C34B78A149BDCFF8FDED569E88C8144B
+ 65B06852DE68A2C839B687F0863E261CD387A25A94F10D8C84BEB58DA455057E6FFD0244A664C1CC64A6004CC4DD1A44B5440EBFCB83BDBAF62C605BEE42737F
logotron/MANIFEST.TXT
(5 . 3)(5 . 4)
5 589783 irssi2tmsr diana_coman "Converter of irssi logs to the tmsr format used by the logotron. Added authors in MANIFEST.TXT."
6 590448 uniturds_etc asciilifeform "Phf's algo for uniturd digestion; cosmetic improvements to WWW displayer."
7 590458 line_wraps asciilifeform "Trinque's method to force wrap in long lines; Removed some commented rubbish from reader.py."
8 590714 znc2tmsr_etc lobbes "Converter of znc logs to the tmsr format used by the logotron. Small fixes to eat_dump.py."
- 5614D6523B1512656953C12732DB5DAA56B49288251B879427A9B8E33DA7DB95847E441D2AD007896182C5ACB27F0ED808B072A25C12B4789CF85CC186E68F68
+ E2818C8381E2A08187A2B3859FE79AC92E2694F14D9214C3FC008E52A48DBE2BB17B40601C30950D3035BBB892B21D2C83D1AB1A45BB595CD1E3EBAF26C97CBA
logotron/eat_dump.py
(62 . 9)(62 . 16)
13 if speaker == "*":
14 spl = payload.split(' ', 1)
15 speaker = spl[0]
16 payload = spl[1]
17 try:
18 payload = spl[1]
19 except IndexError:
20 payload = ""
21 self_speak = True
22
23
24 ## Handle uniturds using the phf algorithm
25 payload = payload.decode('latin-1')
26 payload = payload.encode('utf-8')
27
28 ## Put in DB:
29 try:
30 exec_db('''insert into loglines (idx, t, chan, era, speaker, self, payload)
-
+ 32C82B3D22623BD85715E1B568BEC222B708CF817F00558D41DAB821C4B1769B7FA78465CB19671146C780041090AB6595233BA7DFA260C6B1B1D413AC158443
logotron/logconverters/znc2tmsr/convert.py
(0 . 0)(1 . 58)
35 #!/usr/bin/env python
36
37 from os import listdir
38 from os.path import isfile, join
39 from datetime import datetime
40
41 # Set the dir you'd like to eat, the suffix of each file, and the filename to shit into
42 dir_to_eat = '/path/to/eat/dir/'
43 dir_files_end_with = '.log'
44 shit_into = '/path/to/shitfile.txt'
45
46 # Set the top limit of the line index
47 archive_top_inx = 999999
48
49 # Leave these variables alone
50 archive_bottom_inx = 0
51 dir_data = [f for f in listdir(dir_to_eat) if isfile(join(dir_to_eat, f))]
52 logline_array = []
53
54 # Sort the dir_data in chronological order
55 date_format = '%Y-%m-%d'
56 dir_data_chrono = []
57 for logfile in dir_data:
58 if dir_files_end_with in logfile:
59 logdate = logfile.replace('.log','')
60 dir_data_chrono.append(logdate)
61 dir_data_chrono = sorted(dir_data_chrono, key=lambda d:datetime.strptime(d,date_format))
62
63 # Shit lines into a single file
64 def shit_lines(line_inx):
65 f = open(shit_into, 'a')
66 for line in logline_array:
67 indexed_line = ('%s;%s') % (line_inx,line)
68 f.write(indexed_line)
69 line_inx = line_inx + 1
70 f.close()
71
72 # Eat each file in the dir
73 for logfile in dir_data_chrono:
74 logfile_full_path = join(dir_to_eat,('%s.log' % logfile))
75 with open(logfile_full_path, 'r') as logfile_data:
76 for logline in logfile_data:
77 znc_timestamp = ('%s %s') % (logfile, logline[1:9])
78 znc_datetimestamp = datetime.strptime(znc_timestamp, '%Y-%m-%d %H:%M:%S')
79 epoch_datetimestamp = znc_datetimestamp.strftime('%s')
80 if '<' in logline[11:12]:
81 #normal line
82 speaker = logline[12:logline.find('>')]
83 logline_array.append(('%s;%s;%s') % (epoch_datetimestamp, speaker, logline[logline.find('>')+2:]))
84 elif '*' in logline[12:13]:
85 #connectolade; ignore
86 pass
87 else:
88 #action
89 logline_array.append(('%s;*;%s') % (epoch_datetimestamp, logline[13:]))
90 archive_bottom_inx = archive_top_inx - (len(logline_array) - 1)
91 shit_lines(archive_bottom_inx)
92 logline_array = []