#garfield Logs

Mar 27 2012

#garfield Calendar


09:09 rue_house tobbor has like over 30000 nicks in the seen database and I really dont want ot clear them
21:04 atom1 we can take up here if you like
21:04 atom1 ok, repeat your request
21:04 katsmeow-afk [20:52] <katsmeow-afk> can we do one thing before htmlizing each event? hit return to make a new line before 177, insert s = '<!--test-->
21:04 katsmeow-afk [20:52] <katsmeow-afk> so i can see that html isn't removed, and can be logged
21:04 katsmeow-afk [20:52] <katsmeow-afk> then do antyhing loggable, and see that it gets logged
21:04 katsmeow-afk [20:53] <katsmeow-afk> see that it gets logged where it belongs, too
21:05 katsmeow-afk [20:54] <katsmeow-afk> my py syntax is prolly wrong n assiging the value to s, you should make sure it's right
21:05 katsmeow-afk it won't help to add code to each event, only to find the py code is removing it before actually writing it
21:06 atom1 ok read me the line to insert before
21:06 katsmeow-afk log.write(s)
21:06 atom1 lemme get you a different file to look at since i have to mod a different one to test that
21:07 katsmeow-afk we are changing the s to '<!--test-->' , just as a test, then we remove it if it works
21:08 Tom_L the current plugin.py i renamed to plugin1.py
21:08 katsmeow-afk url?
21:08 Tom_L grab the new file 'plugin.py
21:08 Tom_L same place
21:08 Tom_L just a sec
21:08 Tom_L http://tom-itx.dyndns.org:81/~tom-itx/valen/
21:09 katsmeow-afk again, like 177
21:09 katsmeow-afk log.write(s)
21:09 Tom_L plugin.py is a copy of the one i'll be changing
21:09 katsmeow-afk which one ARE you changing?
21:10 atom1 the function 'dolog'
21:10 katsmeow-afk because you just said : [20:58] <Tom_L> grab the new file 'plugin.py
21:10 atom1 yes, i renamed the first one
21:10 atom1 all these plugin files have the same file sets
21:10 atom1 plugin.py
21:10 katsmeow-afk atm, i have no clue which file we will both be working on in here
21:11 tsmeow-afk deletes plugin1
21:11 atom1 plugin.py
21:11 katsmeow-afk and reloads plugin
21:11 atom1 yes good idea
21:11 atom1 but i'm not modifying 'that' file
21:11 atom1 the file i'm modding is on another pc
21:11 atom1 and not public
21:11 atom1 sry
21:11 katsmeow-afk line 177, make it be line 178, add the s= line i said to add as a test
21:11 atom1 this pc
21:12 atom1 log.write(s)
21:12 katsmeow-afk is that file you are modding exactly the same as the file ia m loking at?
21:12 atom1 before that?
21:12 katsmeow-afk yeas
21:12 atom1 that's line 175 here
21:12 atom1 sry
21:13 tsmeow-afk grabs her keybd and faceplats Tom wit
21:13 atom1 it's the best i can do
21:13 atom1 sry
21:14 katsmeow-afk run the test, all the log file lines adding after you do that should now read <!--test-->
21:14 katsmeow-afk if they do, great, remove the line you are adding now, or comment it out if you wanna play with it later
21:14 atom1 ok, here's what i did:
21:15 atom1 log.write('<!--test-->')
21:15 atom1 log.write(s)
21:15 atom1 that should work
21:15 katsmeow-afk that isn't what i said to do
21:15 katsmeow-afk but it's ok, run it
21:15 atom1 i wasn't sure how to assign it to s
21:15 atom1 yet
21:16 katsmeow-afk you have GOT to rtfm, assigng a text value to string is the first thing you should learn
21:16 atom1 ok hopefully it will join us
21:17 atom1 hang on
21:17 katsmeow-afk the test line will not show ina browser, but will oviously show in a text reader/editor/etc
21:18 atom1 i had to kill the other one
21:18 atom1 ok
21:18 atom1 let's see the log now
21:19 katsmeow-afk i can't
21:19 atom1 i know :)
21:19 atom1 21:09:14 <!--test--><katsmeow-afk> i can't
21:19 atom1 21:09:22 <!--test--><atom1> i know :)
21:19 katsmeow-afk ok,, that tells me it also did not add the <br> or \n or \r
21:20 katsmeow-afk odd
21:20 katsmeow-afk but it got thru
21:20 atom1 i may have formatted it wrong too
21:20 atom1 lemme check
21:20 katsmeow-afk so comment out the extra log.write , or delete it
21:21 katsmeow-afk go down to line 189
21:21 katsmeow-afk 189 = if ircmsgs.isAction(msg):
21:21 katsmeow-afk go to line else: below that
21:21 atom1 i'm trying to do 2 things at once here sry
21:21 atom1 ppl talking to me too
21:22 katsmeow-afk umm, i am not goint to compete with them
21:22 atom1 ok
21:23 atom1 was i supposed to add the \n \r to the output?
21:23 atom1 cause i didn't add it
21:23 katsmeow-afk no
21:23 atom1 ok
21:24 atom1 if ircmsgs.isAction(msg):
21:24 atom1 self.doLog(irc, channel,
21:24 atom1 '* %s %s\n', nick, ircmsgs.unAction(msg))
21:24 atom1 else:
21:24 atom1 self.doLog(irc, channel, '<%s> %s\n', nick, text)
21:24 atom1 ok?
21:24 katsmeow-afk yeas, that's the area
21:24 katsmeow-afk make a copy of
21:24 katsmeow-afk self.doLog(irc, channel, '<%s> %s\n', nick, text)
21:24 katsmeow-afk and comment out one of the copies
21:25 atom1 ok
21:25 katsmeow-afk this saves the original where it belongs in case of error, you have instant backup
21:25 atom1 right o
21:25 atom1 i do that alot
21:25 atom1 be patient ... this keyboard sucks
21:25 katsmeow-afk k
21:25 atom1 it's a $2 kbd
21:25 atom1 and i can tell
21:26 atom1 ok, what to change?
21:26 katsmeow-afk change "nick" to : "<font color=orange>nick</font>"
21:27 atom1 include the quotes?
21:27 katsmeow-afk i think orange need not be in quotes, not sure
21:27 katsmeow-afk no
21:27 katsmeow-afk where it says
21:27 katsmeow-afk nick
21:27 katsmeow-afk make it say
21:27 atom1 ok
21:27 katsmeow-afk <font color=orange>nick</font>
21:27 katsmeow-afk that's the line AFTER the
21:27 katsmeow-afk else:
21:28 katsmeow-afk just so we are on the same line
21:28 atom1 i think some of that needs single quotes
21:28 atom1 self.doLog(irc, channel, '<%s> %s\n', <font color=orange>nick</font>, text)
21:28 katsmeow-afk oh,, right, py syntax
21:28 atom1 before and after each < >
21:28 katsmeow-afk that will error
21:28 katsmeow-afk yeas
21:28 atom1 i'll add em
21:28 katsmeow-afk do that
21:29 katsmeow-afk you may also need to add & or + or whowever py appends strings
21:29 atom1 i'll try it as is first
21:30 atom1 syntax error
21:30 katsmeow-afk right
21:30 atom1 let's log a line anyway
21:31 katsmeow-afk py has a out.append() , but that seems excessive to me
21:31 atom1 it didn't get logged
21:31 katsmeow-afk paste me the line
21:32 atom1 self.doLog(irc, channel, '<%s> %s\n', '<font color=orange>'nick'</font>', text)
21:33 katsmeow-afk how do you append strings in python?
21:33 atom1 beats me at this poing
21:33 atom1 t
21:34 katsmeow-afk great, add +
21:34 katsmeow-afk self.doLog(irc, channel, '<%s> %s\n', '<font color=orange>'+nick+'</font>', text)
21:34 atom1 yeah
21:35 katsmeow-afk assuming py allows imbedding suc thing, that should fix it
21:35 katsmeow-afk mirc uses & or && , Eu uses &
21:35 atom1 yeah it didn't error that time
21:35 katsmeow-afk test
21:35 atom1 let's see the log now
21:36 atom1 21:25:57 <!--test--><<font color=orange>atom1</font>> yeah it didn't error that time
21:36 atom1 21:26:02 <!--test--><<font color=orange>katsmeow-afk</font>> test
21:36 atom1 21:26:05 <!--test--><<font color=orange>atom1</font>> let's see the log now
21:36 katsmeow-afk get rid of that test line, i thought you commented that out
21:36 atom1 :)
21:36 atom1 gone
21:37 katsmeow-afk change line to:
21:37 katsmeow-afk self.doLog(irc, channel, '%s %s\n', '<font color=orange>'+nick+'</font>', text)
21:38 katsmeow-afk test2
21:38 katsmeow-afk this is a test
21:38 katsmeow-afk are we testing yet?
21:38 atom1 i gotta start it over
21:38 katsmeow-afk o
21:38 katsmeow-afk this is a test
21:38 atom1 i hope it compiles by seeing a new file stamp
21:39 atom1 21:29:09 <font color=orange>katsmeow-afk</font> this is a test
21:39 katsmeow-afk ok, do you want < > around nick?
21:39 atom1 most of them have it so i'd say so
21:39 katsmeow-afk change line to:
21:39 katsmeow-afk self.doLog(irc, channel, '%s %s\n', '<font color=orange><'+nick+'></font>', text)
21:40 katsmeow-afk incidently, the reason the change at line 177 did not add the \n is because it's added in each event, you see it there : self.doLog(irc, channel, '%s %s\n <<===
21:41 atom1 test
21:41 katsmeow-afk anyhow, the same difefrence for nick, same for channel, same for text
21:41 atom1 well flush the log dammit
21:42 atom1 it's not logging
21:42 katsmeow-afk you'll need to change the html for the timestamp in the
21:42 katsmeow-afk def timestamp(self, log):
21:42 atom1 there must be an error
21:42 katsmeow-afk paste me the line
21:43 atom1 nevermind
21:43 atom1 my bad
21:43 katsmeow-afk k
21:43 atom1 testing
21:44 atom1 1:34:12 <font color=orange><atom1></font> testing
21:44 katsmeow-afk k, you know how to cvhnage the rest?
21:44 atom1 i'll work on it
21:44 atom1 thanks
21:44 atom1 another day..
21:44 katsmeow-afk <curtsey>
21:44 atom1 umm
21:45 katsmeow-afk hmm?
21:45 atom1 where would i add the html_header var?
21:45 atom1 from the other file
21:45 katsmeow-afk when you first srat a new log file
21:45 katsmeow-afk start
21:45 atom1 wanna help me find that?
21:46 atom1 about line 149
21:46 atom1 ?
21:46 katsmeow-afk no
21:46 katsmeow-afk first "define" the html template at line 93
21:47 katsmeow-afk in logbot
21:47 Tom_L right
21:48 Tom_L should that be inside the class declaration?
21:48 atom1 class ChannelLogger(callbacks.Plugin):
21:48 atom1 noIgnore = True
21:48 atom1 right below that?
21:48 katsmeow-afk also in logbot.py , where it says # Create the channel path if necessary
21:48 katsmeow-afk afk, ggp
21:48 atom1 that's all taken care of i think
21:50 katsmeow-afk bak
21:51 katsmeow-afk it is, but below that is
21:51 katsmeow-afk # Create the log date index if it doesnt exist
21:51 katsmeow-afk and that's where they
21:51 katsmeow-afk write_string(log_path, html_header.replace("%title%", "%s | Logs for %s" % (channel, date)))
21:51 atom1 umm, i'm not sure what that's for
21:52 atom1 what is that writing to?
21:52 katsmeow-afk log_path
21:52 katsmeow-afk log_path was defined as
21:52 katsmeow-afk log_path = "logs/%s/%s.html" % (channel, date)
21:52 atom1 in which file?
21:53 katsmeow-afk logbot.py
21:53 atom1 oh, all the file stuff is taken care of in this one
21:53 katsmeow-afk umm, they why did you ask me how to write out the html header?
21:54 atom1 in 'getlogdir'
21:54 atom1 just that variable
21:54 atom1 so brousers know it's html?
21:54 katsmeow-afk then it's NOT taken care of in that one
21:54 atom1 right after the file is created, i was gonna write that var to the file
21:55 katsmeow-afk ok, please do so
21:55 atom1 but i'm not sure exactly where to put it
21:55 atom1 i think in 'getlog'
21:55 atom1 right before 'return log'
21:56 atom1 about line 150
21:57 katsmeow-afk if you do it there, i think you'll write a header each time you call it, on each event
21:57 katsmeow-afk getLog is called every time doLog is called
21:57 atom1 mmm
21:58 atom1 i need a place where it's only called once
21:58 atom1 where does it roll over at midnight?
21:58 atom1 there's code for that
21:59 atom1 i need to call it a night here
22:00 atom1 i think that may be around line 127 where it 'checklognames'
22:00 atom1 but i'm not sure
22:00 atom1 anyway.. i'm gonna quit for tonight
22:00 katsmeow-afk nope
22:00 atom1 progress has been made.
22:01 katsmeow-afk noting in there about writing a new file
22:01 katsmeow-afk lemme warn you on this
22:01 katsmeow-afk you still here?
22:01 atom1 somewhere there it compares a datestamp
22:01 atom1 yes
22:01 katsmeow-afk because html is executeable in a browser,
22:01 katsmeow-afk it's possible someone can say something to cause js or java or activex etc to delete c:/
22:02 atom1 yeah i suppose
22:02 katsmeow-afk no suppose, it can happen
22:02 atom1 i meant i agree
22:02 katsmeow-afk you'll want to DEhtml-ize the text someone says
22:03 katsmeow-afk save all < > as &gth; and %lthn; html code, which afaik, will not make executeable html
22:03 Tom_itx still here...
22:04 katsmeow-afk &gt; , &lt;
22:04 katsmeow-afk for
22:04 katsmeow-afk > , <
22:04 Tom_itx i'll be lucky to get this to work at all
22:05 katsmeow-afk you should be able to, so far you're doing very basic stuff, i didn't even need to know python to help you
22:05 Tom_itx :)
22:05 Tom_itx i get lost searching for stuff sometimes
22:06 tsmeow-afk
22:06 Tom_itx see if you can find a place to put that html_header code
22:06 Tom_itx i'm gonna sleep on it
22:06 katsmeow-afk ok, if you'll bring in a bucket of water to flush my toilet
22:06 Tom_itx i feel like i'm holding a bucket of water :)
22:07 katsmeow-afk i haveto choose helping you more while you sleep, or doing such things irl
22:07 Tom_itx irl takes presidence
22:07 katsmeow-afk k
22:07 Tom_itx but feel free to override that
22:08 katsmeow-afk i'll be doing thigs irl
22:08 katsmeow-afk praps i should get outa here before rue kicks me