diff -uNr a/logotron/MANIFEST.TXT b/logotron/MANIFEST.TXT --- a/logotron/MANIFEST.TXT 824bfece7088516aaadfdb1d0e37fbae915602d0f5ded55cbc39401af9ceefa8a62f8bf04b35b53811d18a4ec8fea553571a384bf9fdda7d4e76bf31a0d7190d +++ b/logotron/MANIFEST.TXT 46aa85dc41260ed3901fcc47ab6d238e7923b2c48870c88d606e158869ea517b5fe5a93456ab5d628e84a2c844f1b86efb1ab091af22a2d93e1a28f65356c990 @@ -1 +1,2 @@ 589248 logotron_genesis "Genesis." +589480 multsel_and_datefix "Multiline selections and fix for date arrow." diff -uNr a/logotron/nsabot.conf b/logotron/nsabot.conf --- a/logotron/nsabot.conf f447f004041538581919c4d373faa6e957d8ed67e273a93704b952802eeec970213983fb8fbe45e8a913b8831d5c1dbb605d8309df1f70559969b9b1b9b7685d +++ b/logotron/nsabot.conf b02775926d528d67d44fa777248a014d1f5a37fc3486042a4a6e8a2ceb77651fc1681abff6e57e35a1e48e5896d4534c69759ac86bdc85ec1161f661811fcdb4 @@ -44,7 +44,7 @@ # 3 : Present day. # Where the source lives (change to yours) -src_url = http://not.yet +src_url = http://www.loper-os.org/?p=3452 # From where index starts for new chan, so to leave room for archive insert newchan_idx = 1000000 diff -uNr a/logotron/reader.py b/logotron/reader.py --- a/logotron/reader.py 5de963eb326e8f107264fb5d2dceaf715b8daff649353295ff19bfaa560946bd856f8970c69b1b6360fb003b7548fa78302423ecf83512a4bff43cfd3973f628 +++ b/logotron/reader.py 5cff8bf56c249454f81e92cbe693dd68ed16626918e9fce4f159b1173c2c1a58cc66cf9eb4925cf7b97c969fdf834f56b0dafd1bbdf249456c9ce610e2f238c6 @@ -249,7 +249,7 @@ ## Format given log line for display -def format_logline(l, highlights = []): +def format_logline(l, highlights = [], select=[]): payload = html_escape(l['payload']) # Format ordinary links: @@ -266,16 +266,25 @@ if l['speaker'] in Bots: bot = " bot" + # default -- no selection + dclass = l['speaker'] + + # If selection is given: + if select != []: + ss, se = select + if ss <= l['idx'] <= se: + dclass = "highlight" + # HTMLize the given line : - s = ("
" + s = ("
" "{1}: {4}
").format(l['idx'], l['speaker'], l['t'], line_url(l), payload, - bot) - + bot, + dclass) return s # Make above callable from inside htm templater: @@ -316,6 +325,10 @@ if chan not in Channels: return redirect(url_for('log')) + # Get possible selection start and end + sel_start = request.args.get('ss', default = 0, type = int) + sel_end = request.args.get('se', default = 0, type = int) + # Get current time now = datetime.now() @@ -336,6 +349,10 @@ # Determine the end of the interval being shown day_end = day_start + timedelta(days=1) + # Enable 'tail' is day_end is after end of current day + if day_end.day > now.day: + tail = True + # Get the loglines from DB lines = query_db( '''select * from loglines where chan=%s @@ -346,6 +363,7 @@ return render_template('log.html', chan = chan, loglines = lines, + sel = (sel_start, sel_end), date = date, tail = tail) @@ -403,8 +421,6 @@ tokens_formed, Max_Search_Results], one=False) else: - print "from=", from_users - searchres = query_db( '''select * from loglines where chan=%s and speaker ilike any(%s) diff -uNr a/logotron/templates/log.html b/logotron/templates/log.html --- a/logotron/templates/log.html 44d51aaef738815d01d92cbf6a1d0d44803627579352dbaafe0257346e5fdff9d76ec64fd00ebb435e177869502f97c1b72c7322ee6108c6784011d222966ba7 +++ b/logotron/templates/log.html f687b56110c1f5a947f95b3767df3f224f9580a1751cee8f27dc45a099dd1416c3afe6bb205468b7d529d5a1e73e8224fe52aa18158f5ca2e7f8874e74e698a3 @@ -9,7 +9,7 @@ {% for l in loglines %} -{{ format_logline(l) | safe }} +{{ format_logline(l, [], sel) | safe }} {% endfor %}