Friday, 2010-08-20

*** tpb has joined #tp00:00
*** ChanServ sets mode: +o tpb00:00
*** jnengland77 has quit IRC00:11
*** epyon-sakura has joined #tp00:16
*** epyon-sakura has quit IRC00:35
tansellStupidIncarnate, ping?00:53
StupidIncarnateya?00:54
StupidIncarnatetansell: pong00:54
tansellstudent survey00:54
StupidIncarnatewhat about it?00:54
StupidIncarnatetansell: is that a reminder, or did my submission not go through?01:01
tanselloh wait, it's because you don't have a mid-term survey01:02
StupidIncarnatetansell: So all good then?01:05
tansellyes01:06
StupidIncarnatewhat's left, just submitting the code?01:06
tansellI believe so01:13
*** mithro has joined #tp01:35
ezodmithro: ping02:09
*** epyon-sakura has joined #tp02:09
ezodglew: ok everything looks good02:22
ezodi think i will go over your client-side code more intensely sometime in the near future, it would be great if you could help :)02:23
glewezod: ok, great, I'll stick and you can always contact me by email too, but I'll try to be on irc too02:23
ezodcool02:23
ezodthere's a few things that need doing still on the client side, and a few things i personally think should be changed/improved02:24
ezodonce we get past that, it would be awesome if you could stick around and work on scenarios and campaigns :)02:24
glewezod: i'd like to try to work some more on scenarios and campaigns, I tried editing a savefile again, but i think with recent changes to things, they didn't work out so well02:33
glewso i'd like to work on them with more time02:33
*** StupidIncarnate has quit IRC02:40
tansellezod, pong?03:08
*** StupidIncarnate has joined #tp03:14
*** epyon-sakura has quit IRC03:42
*** glew has quit IRC03:53
*** epyon-sakura has joined #tp04:13
*** epyon-sakura has quit IRC04:19
*** epyon-sakura has joined #tp04:24
llnzbbl04:32
*** llnz has quit IRC04:32
*** epyon-sakura has quit IRC05:25
*** Linkadmin has quit IRC05:54
*** alanp has quit IRC05:54
*** Linkadmin has joined #tp05:54
*** alanp has joined #tp05:55
*** cahirwpz has joined #tp06:31
*** bisc has joined #tp06:43
bisctansell: ping06:45
tansellbisc, pong07:21
tansellbisc, don't forget to submit your student eval07:21
bisctansell: submitted it yesterday. Wanted to remind you about your eval :)07:23
tansellyeah, all done07:23
tansellcahirwpz, ping?07:23
cahirwpztansell, pong07:23
*** llnz has joined #tp07:24
cahirwpztansell, I'm just writing the evaluation07:24
tansellokay great07:24
bisctansell: about information panel -- my version looks like this http://ruchkin.files.wordpress.com/2010/08/info-panel-new.png07:26
tpb<http://ln-s.net/7V3v> (at ruchkin.files.wordpress.com)07:26
tansellbisc, looks good07:27
biscI've closed orders frame so that whole information panel is seen07:27
tansellyeah, I see07:28
bisctansell: in this version, wrapping is applied when labels are changed. I tried implementing wrapping labels on resize of panel, but there's one problem. When I catch EVT_SIZE and do nothing, the panel doesn't resize and becomes broken07:28
tansellbisc, oh?07:29
bisctansell: do you know how to make a wxwindow handle EVT_SIZE even after I catch it? evt.ResumePropagation doesn't help07:29
tansellit should already work in theory07:29
bisctansell: strange, but it isn't resized and repainted. Like I deleted EVT_SIZE standard handler.07:30
tansellbisc, your not getting an exception or something?07:31
bisctansell: no. Maybe I'm affected with imperfect FoldPanelBar implementation...07:32
bisctansell: anyway, this is about doing something with EVT_SIZE. We postpone it and stay with what I have now. Please see code of last patch here http://codereview.mithis.com/5900107:33
tpbTitle: Issue 59001: Information panel: improving buttons. - Code Review (at codereview.mithis.com)07:33
biscWe can postpone it *07:33
bisctansell: I had to delete SetVirtualSize call in panelnformation constructor because FoldPanelBar.GetPanelsLength gives unreasonable results the -- something like (1,0)07:37
biscthere *07:37
tansellcahirwpz, so where are we at?07:39
bisctansell: I dunno where this number 350 comes from :) I've never done any changes to velocity. Possibly, I messed up git. Will correct it now.07:41
tansellokay07:47
cahirwpztansell, I removed logctx stuff yesterday07:48
cahirwpzand finally fixed tests07:48
tanselllet me have a look07:48
tansellcahirwpz, the tests still don't look much like tests07:53
cahirwpzumm... what do you mean ?07:54
bisctansell: have a look at the latest patch http://codereview.mithis.com/5900108:00
tpbTitle: Issue 59001: Information panel: improving buttons. - Code Review (at codereview.mithis.com)08:00
tanselldoes this look like a test to you? http://pastebin.com/iJpv9sP608:01
tpbTitle: Python | class GetExistingCategory( Get - Anonymous - iJpv9sP6 - Pastebin.com (at pastebin.com)08:01
cahirwpztansell, yes... a test without boiler plate code, the common code was extracted and moved to the set of classes from which the test is derived08:03
cahirwpztansell, isn't that a common practice to put boiler plate code into a class, parametrize it, and inherit from that class?08:03
tansellcahirwpz, yes - but you have totally hidden it08:04
cahirwpzI hid the code that repeats08:07
cahirwpztansell, so how in your opinion this code should look like ?08:07
tansellsee the examples in http://docs.python.org/library/unittest.html08:08
tpbTitle: 25.3. unittest — Unit testing framework Python v2.7 documentation (at docs.python.org)08:08
*** bisc has quit IRC08:10
tansellclass TestSequenceFunctions(unittest.TestCase):08:11
tansell    def test_shuffle(self):08:11
tansell        self.assertEqual(self.seq, range(10))08:11
cahirwpzif it was so easy I'd put many test into a single class ;-)08:11
tansellsomething like that08:11
cahirwpzthe problem is that in most cases tests are not a code that executes sequentially08:12
cahirwpzgenerators give an illusion of sequential execution08:12
tansellcahirwpz, sure they are - you do X then you check Y08:13
cahirwpzdid you read TestSession class ?08:13
cahirwpzhttp://github.com/cahirwpz/tpserver-py/blob/gsoc2010/tests/common.py08:15
tpb<http://ln-s.net/7V4e> (at github.com)08:15
cahirwpzTestSession class enables you to write test cases in form of a generator08:16
tansellwhy do you want to do that?08:16
cahirwpzinstance of this class should not be used to establish connection more than once08:18
cahirwpzevery test case is derived from this class08:18
cahirwpz(excluding those in tests.testcases.action)08:19
tansellcahirwpz, I don't understand this sentence "instance of this class should not be used to establish connection more than once"08:20
cahirwpzok, every test case does a few steps inside runTest method08:21
cahirwpzit's not explicit because things are done behind curtains - in twisted.reactor08:21
tansellFor the test you want to do the following things08:22
tansella) connect to the server08:22
tansellb) possible log in08:22
tansellc) send a request08:22
tanselld) check the response08:22
cahirwpzreactor is asked to establish a connection and is given a class (exactly the test case class) to handle the connection08:23
cahirwpztansell, I agree, these are steps that are performed, but asynchrony make it harder to see it in the code08:24
cahirwpzyou can not just receive a packet08:24
cahirwpzTestSession is called, when a packed is received by a reactor08:24
tansellcahirwpz, it's really simple08:25
tansellsendPacket(a)08:25
tansellwhile not a = recvPacket(): pass08:25
tansellcheck(a)08:25
cahirwpz...08:25
cahirwpzyou cannot do recvPacket08:25
cahirwpzif you don't understand it you should carefully read Twisted introduction08:26
tansellsure you can08:26
cahirwpzyou can, but not in Twisted08:27
tansellhttp://pastebin.com/yGNwxw3U08:28
tpbTitle: Python | class MyReactor(twisted.reac - Anonymous - yGNwxw3U - Pastebin.com (at pastebin.com)08:28
tansellsimple08:29
cahirwpzI don't believe it has any chance to work08:30
cahirwpzhttp://twistedmatrix.com/documents/current/core/howto/clients.html08:30
tpb<http://ln-s.net/76E4> (at twistedmatrix.com)08:30
tansellcahirwpz, did you look at my pastebin?08:32
cahirwpzyes08:32
tansellnothing in that documentation seems to indicate what I just suggested won't work08:33
cahirwpztwisted.reactor does not call recvPacket method08:33
tansellwhy not - it's just a method08:34
cahirwpzwell... it's not written to call it08:35
cahirwpzit can only call methods of IProtocol interface08:35
tansellso replace recvPacket with recvData08:36
cahirwpzprovided that ITransport was created as a call to reactor.connectTCP08:36
cahirwpzyou have to feed reactor with a class of interface IProtocol08:36
tanselltake a look at 'Simple, single-use clients'08:37
cahirwpzto cooperate with twisted.reactor properly you need to create at least two classes one derived from ClientFactory, the second from Protocol08:38
cahirwpzthe chapter you gave is the worst twisted usage I've ever seen ;-)08:39
cahirwpzhttp://github.com/cahirwpz/tpserver-py/blob/gsoc2010/tp/server/protocol.py08:40
tpb<http://ln-s.net/7V4w> (at github.com)08:40
cahirwpznote that sendPacket is not a method of IProtocol interface08:40
cahirwpzit's just a helper function to wrap access to self.transport08:40
tansellhttp://pastebin.com/frLYncjn08:41
tpbTitle: Python | from twisted.internet import r - Anonymous - frLYncjn - Pastebin.com (at pastebin.com)08:41
tansellI have to go now08:43
cahirwpzreactor.runOnce does not exists08:43
cahirwpzand there's no similar method08:43
tansellI don't know what it's called - but it must exist otherwise twisted can't intergrate with other systems which have a mainLoop08:44
cahirwpzyou just run it forever08:44
cahirwpztansell, you're correct08:44
cahirwpztwisted implements it's own mainLoop08:44
tansellworse comes to worse just dump it into a thread08:45
cahirwpzhowever it can reuse mainLoop mechanisms from qt, wx, etc...08:45
cahirwpztansell, look... following patterns from logging module is the standard way you use to implement logging in python application, the same with unittest for testing08:47
cahirwpzwhy you want to make Twisted use other way it was meant to use ?08:47
tansellbecause your current way makes the tests unreadable08:49
tansellit appears that there is a08:50
tansellreactor.doIteration()08:50
tanselland a reactor.runUntilCurrent08:51
cahirwpzthat's not the way you use reactor08:51
cahirwpzthe methods you mentioned are low-level mechanism that shouldn't be used by application code08:51
cahirwpzI cannot do anything about asynchronous code being less comprehensive08:52
tansellcahirwpz, tests need to be comprehensible otherwise they are useless08:54
cahirwpztansell, that's why I implemented test scenarios using generators that offer simplified illusion of a synchronous code08:55
cahirwpzhttp://github.com/cahirwpz/tpserver-py/blob/gsoc2010/tests/testcases/basic.py08:56
tpb<http://ln-s.net/7V5C> (at github.com)08:56
cahirwpzthat'd be a better example:08:57
cahirwpzhttp://github.com/cahirwpz/tpserver-py/blob/gsoc2010/tests/testcases/protocol.py08:57
tpb<http://ln-s.net/7V5D> (at github.com)08:57
cahirwpzif not the TestSession class you would have to deal with asynchronous code08:58
cahirwpzbut TestSession class has its own limitations - its instance cannot be used with more than one connection08:59
* llnz wanders off08:59
llnzlater all08:59
*** llnz has quit IRC08:59
cahirwpzeach time you make a connection you need to create its instance08:59
tansellhow about http://pastebin.com/tRLcSPJK09:02
tpbTitle: Python | class SameSequenceInHeader( Te - Anonymous - tRLcSPJK - Pastebin.com (at pastebin.com)09:02
cahirwpzas long as there's only one "test.*" method in a class it would work09:04
tansellcahirwpz, thats getting closer - I'm still not happy but it's a step in the right direction09:05
tansellanyway I have to go now09:07
tansell(well I had to go 30 minutes ago)09:07
cahirwpztansell, did you complete the evaluation ?09:08
tansellyes09:08
cahirwpzgreat :)09:08
tansellgone.09:09
*** mithro has quit IRC09:12
cahirwpzbye09:12
*** StrangerDanger has quit IRC10:05
*** StrangerDanger has joined #tp10:06
*** epyon-sakura has joined #tp11:55
*** epyon-sakura has quit IRC12:25
*** Greywhind has quit IRC12:26
*** Greywhind has joined #tp13:08
*** StupidIncarnate has quit IRC13:19
CIA-27Krystian Bacławski gsoc2010 * rc5ab3c6 / (17 files in 2 dirs): Major tests refactoring. - http://bit.ly/9mVlpT13:53
tpbTitle: Commit c5ab3c6534a895a40ddf95503ff003c664eebead to cahirwpz's tpserver-py - GitHub (at bit.ly)13:53
CIA-27Krystian Bacławski gsoc2010 * r723d55d / (8 files in 2 dirs): Introduced GetItemWithIDSlot test template. - http://bit.ly/bjcF6a15:14
tpbTitle: Commit 723d55df3eaf6aa4a7d61776bb6ab20746079a45 to cahirwpz's tpserver-py - GitHub (at bit.ly)15:14
*** StupidIncarnate has joined #tp16:10
*** StupidIncarnate has quit IRC16:11
*** glew has joined #tp16:49
*** StrangerDanger has quit IRC16:56
*** StrangerDanger has joined #tp16:56
*** glew has quit IRC17:11
*** glew has joined #tp17:15
*** cahirwpz has quit IRC18:06
*** Greywhind has quit IRC21:01
*** Greywhind has joined #tp21:39
*** jnengland77 has joined #tp23:31
*** konr has joined #tp23:39
konrOut of curiosity: do you think that it's interesting to create an Emacs client of TP? Would that be a likely candidate for GSoC 2011?23:40
konrI've been wanting to participate on the project for quite a while, but never had an idea as sexy as this :D23:41
*** epyon-sakura has joined #tp23:59

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!