Tuesday, 2009-06-09

*** tpb has joined #tp00:00
*** ChanServ sets mode: +o tpb00:00
chereztansell: GroupProxy doesn't seem to be working.00:00
tanselloh?00:00
tansellin what way?00:00
cherezIt's failing on an empty list.00:01
tansellcherez, it seems like an empty list would be wrong for a standard group00:01
cherezThis is for ListStructure.00:02
tansellgot the error?00:02
cherezValueError: Value item was not the correct size (was 0 must be 2)00:03
cherezWait, not that one.00:04
cherezIndexError: pop from empty list00:04
tansell_laptopI need more then that :)00:04
cherezI'll grab a pastebin, then.00:05
tansell_laptopyes00:06
chereztansell_laptop: http://pastebin.com/m7334845300:06
tpbTitle: Python pastebin - collaborative debugging tool (at pastebin.com)00:06
tansell_laptopokay I see the problem00:08
tansell_laptopit assumes a non-empty list00:08
tansell_laptopcherez, well that error message should probably be better00:11
tansell_laptopdef __set__(self, obj, value):00:12
tansell_laptopself.check(value, False)00:12
tansell_laptopvalue = list(value)00:12
tansell_laptopfor structure in self.structures:00:12
tansell_laptopstructure.__set__(obj, value.pop(0))00:12
cherezcls.l = [['abc', '\x00']] fails as well.00:14
tansell_laptopself.structures is longer then ['abc', '\x00']?00:14
cherezself.structures?00:16
cherezself.structures should be [StringStructure, CharacterStructure]00:16
tansell_laptopthe structures in the group00:16
tansell_laptopactually00:16
tansell_laptopit should be00:16
tansell_laptopcls.l = ['abc', '\x00']00:17
tansell_laptopnot the double list00:17
cherezBut the double list is what list.check takes.00:17
cherezAnd what xstruct expects.00:17
tansell_laptopcherez, yes - they are different00:21
tansell_laptopGroup expects a single list00:22
tansell_laptopList expects a double list00:22
cherezBut this is for List.00:22
tansell_laptop(it's a list of group)00:22
cherezThis is ListStructure that's failing, though.00:23
tansell_laptopyeah00:26
CIA-46alanp tpserver-cpp-mtsec * rf6103be48e22 / (8 files in 2 dirs): Added initial XML import, I am having some problems when a player joins with WX client. The problem seems to be in tpguile when setting property values. I will investigate further.00:26
* alanp sigh00:27
cherezSo ListStructure's __set__ method takes different objects from its check method?00:27
llnzbbl00:32
*** llnz has quit IRC00:33
tansell_laptopcherez, not quite00:37
tansell_laptopcherez, I think you need a proxy object for the list stuff00:37
cherezThought so.00:37
cherezWell, I better go code that.00:38
tansell_laptopcherez, because it's a list of groups00:38
cherezRight.00:38
tansell_laptopIE you want to be able to do00:38
tansell_laptopA.mylist[0].name, A.mylist[0].description00:39
tansell_laptopwhere as00:39
tansell_laptopa group works like00:39
tansell_laptopA.mylist.name00:39
tansell_laptopA.mylist.description00:39
tansell_laptopcherez, hrm00:40
tansell_laptopjust looking at your commits00:40
tansell_laptopyou have not set your email address00:40
tansell_laptopgit config --global user.email <your email address>00:41
tansell_laptopall your commits are currently showing at00:41
tansell_laptopcherez@localhost.(none)00:41
tansell_laptopwhich is bad00:41
cherezOh, yikes.00:41
cherezAlright, I fixed that.00:41
tansell_laptopcherez, as well - what did you do with the old tests that use to be in Structures.py?00:42
tansell_laptopas I notice that you are missing some tests which where in them00:43
tansell_laptopsuch as00:43
tansell_laptop# Check the length00:43
tansell_laptopassert StringObject.s.length(str.s) == 800:43
tansell_laptop# Check that the default value is empty00:43
tansell_laptoptry:00:43
tansell_laptopstr.s00:43
tansell_laptopassert False00:43
tansell_laptopexcept AttributeError, e:00:43
tansell_laptoppass00:43
cherezI'm integrating those into the test suite.00:45
cherezFirst I need to figure out how to do this ListProxy.00:45
tansell_laptopyou probably want to inherit from list00:59
chereztansell_laptop: What do we require of structure names?01:02
tansell_laptopwhat do you mean?01:02
cherezIf an object contains Structures with the same name it's possible for there to be conflicts.01:03
cherezShould we do anything to avoid that or just let them suffer for their sins?01:07
tansell_laptopcherez, well... up to you01:09
tansell_laptopI think you should probably check when creating a group01:09
tansell_laptopbut remeber that01:10
tansell_laptopa.l.p is different from a.c.p01:10
cherezCheck that there are no duplicate names?01:13
cherezWould that also mean looking through subgroups?01:13
tansell_laptopso you should only check the duplicate names inside a group01:14
tansell_laptopno01:14
tansell_laptopjust one level01:14
cherezThat seems kind of arbitrary, but alright.01:15
tansell_laptopcherez, well if you think about01:15
tansell_laptopif a group can only contain unique names01:15
tansell_laptopthen a group of groups can only contain unique names01:15
tansell_laptop(using the full qualified name)01:16
cherezThe full qualified names of the subgroups are naive of any parent.01:17
cherezSo a.g.g.s shares its full qualified name with a.g.s.01:18
*** reac has quit IRC01:22
cherezmithro: Mind if I try to reimplement the way structures bind to objects so they don't touch the original object?01:33
tansell_laptopcherez, that is not true01:34
tansell_laptopcherez, and you can't actually to that01:34
cherezEmpirical evidence says it is true....01:35
tansell_laptopthen something is wrong01:35
tansell_laptopbecause g has a name01:35
tansell_laptopso a.g.s != a.g.g.s01:35
tansell_laptop(unless of course you assign them the same thing)01:35
tansell_laptopthe code might be wrong01:35
tansell_laptopa.g.g.s == a.__get__('g').__get__('g').__set__('s')01:37
tansell_laptopwhile01:37
tansell_laptopa.g.s == a.__get__('g').__set__('s')01:37
cherezActually, a.g.g has no s....01:38
cherezHow did that happen?01:38
tansell_laptophow are you testing?01:39
cherezLet me pastebin it.01:41
chereztansell_laptop: http://pastebin.com/m53b38afd01:42
tpbTitle: Python pastebin - collaborative debugging tool (at pastebin.com)01:42
tansellcherez, so I'm guessing thatis in the group proxy01:47
tansellfor i, structure in enumerate(self.group.structures):01:51
tansellif structure.name == "__%s_%s" % (self.group.name, name):01:51
tansellreturn self[i]01:51
tansellraise AttributeError("No such attribute %s" % name)01:51
tansellthat is the code that is dieing01:51
cherezRight.01:51
tanselloh I see the problem01:53
cherezOh?01:53
tanselllook at the __init__ for the Group01:53
tansellit does the rewrite of the substructure names01:53
cherezRight.01:54
tansellso think about how the Group initialisation works01:55
cherezOh!01:56
tansellso there are a number of good and bad ways to solve this problem :P01:57
cherezNo kidding.01:57
cherezBest one coming to mind is a rename method.01:58
Greywhindhey tansell01:58
cherezNot perfect, but it should get the job done.01:59
tansellcherez, well I would do a @property on the name value01:59
tansellwhich basically manipulates all it's children when it's name changes01:59
cherezRight.01:59
tansellit is kinda dangerous however01:59
cherezIf a structure ends up its own child?02:00
Greywhindtansell: i figured out why the order panel wasn't immediately putting in the defaults02:00
Greywhindtansell: in StateTracker, whenever a CacheDirty event occurred, it would ignore it unless it was a full cache update or it was for the oid currently selected02:01
Greywhindbut order queues were a different ID02:02
Greywhindtansell: can you think of any reason why we would need to ignore events for other IDs, or can i just remove that check?02:02
tansellyeah, because they may come in after the order queue has changed02:03
tansellcherez, hrm?02:03
tansellcherez, no if you change if after you have set some properties02:03
tansellthere will be a bunch of orphaned stuff on the object02:03
cherezMmm, right.02:04
Greywhindtansell: but, i mean, why is it bad to process updates from other objects than the one we're selecting? it does go to the event's object, not the selected object, like it should02:04
cherezNever touching the parent object is sounding better all the time. :P02:06
Greywhindthe code i'm looking at is line 216 of StateTracker, def OnCacheUpdate(self, evt):02:06
tansellcherez, but you have to touch the parent object02:07
tansellas the Structures are part of the *class* definition02:07
tansellso any value you store on the Structure is global for all instances of the class02:08
tansellit's the distinction I was talking about above02:08
tansellthe distinction is subtle and will bite you if you don't understand it02:10
cherezMmm.02:10
tansellGreywhind, let me look at the code02:10
Greywhindtansell: ok, thanks02:10
cherezWell, making name a property should fix most everything.02:11
cherezGod help us if any structures have an underscore in the name.02:11
tansellcherez, why?02:12
tansellit'll be confusing, but still work02:12
tansellbut then, nobody should ever been looking at the actual values02:12
tansellGreywhind, so you still need the check there02:13
Greywhindtansell: hm. i'll need to figure out a way to check if it's the order queue instead.02:13
cherezIf we have a structure with a name like "set__", it's bad news. Less dumb uses of underscore could still make objects share names.02:14
tansellhow?02:15
tanselloh I see02:15
tansellGreywhind, yeah - you will have to do a little bit of footwork02:15
tansellbasically02:15
chereztansell: I doubt it will come up, but it does violate transparency.02:16
Greywhindno problem. it shouldn't be that hard02:16
Greywhindwhat will be hard is the switch to multiple order queues02:16
tansellcherez, transparency?02:16
tansellGreywhind, not really02:17
cherezNot needing to know anything about how libtpproto2-py works to use it.02:17
tansellTrackerOrderObject becomes TrackerOrder02:17
tansellcherez, I guess if you use a single _ it can't class with any of the __ names02:18
tansellGreywhind, and then things might need to inherit from both TrackerOrder and TrackerObject02:18
Greywhindtansell: well, i need to basically make something to copy the entire order panel for each order queue, put them into notebook tabs, and then update the proper tabs02:19
Greywhindfor the switch to multiple queues i mean02:19
tansellNope02:20
Greywhindbut for this change, i should be able to just check if the update is for either the object or for one of its order queues, don't i?02:20
tansellGreywhind, you just change the orderqueue id you are tracking02:20
tansellGreywhind, I would split the two concepts02:20
Greywhindtansell: hmm... good idea.02:21
tansellyou can be tracking an Object and/or an OrderQueue02:21
tansellobviously it makes little sense to track an OrderQueue for an object which doesn't exist02:21
Greywhindbut if you're tracking an object, shouldn't you also want to receive updates to its order queue?02:21
tansellGreywhind, possibly, possibly not02:22
tansellyou might also only want to check one or multiple order queues02:24
Greywhindok. i'll think about it.02:25
Greywhindtansell: since there's already a TrackerObject and a TrackerObjectOrder, shouldn't that already be what we need? just use TrackerObject if they don't care about the order, use both if they care about both02:31
tansellGreywhind, well the two are not necessarily logically connected anymore02:32
tansellOrder queue's can exist without object now02:33
Greywhindoh, really?02:33
Greywhindi thought they were all tied to objects02:33
Greywhindsometimes i wonder wtf newbies are thinking02:37
Greywhind -    5   Queue                              On02:37
Greywhindsorry, mischan02:37
tansellGreywhind, they are kinda tied to objects02:40
*** greenlion has joined #tp02:41
tansellbut there is no longer any reason they should be02:41
tansellso the OrderPanel should become nested02:42
tansellthe top level cares about object selection02:42
tansellthe next level cares only about order queues02:42
cherezThis name thing is way nastier than it should be.02:43
cherezThere!03:03
cherezNearly suffocated, but nested groups work now.03:03
*** nash_ has quit IRC03:27
*** llnz has joined #tp03:39
*** drukenFrog has quit IRC03:45
*** llnz2 has joined #tp03:51
*** llnz has quit IRC03:52
*** llnz2 is now known as llnz03:52
*** llnz has quit IRC04:02
*** llnz has joined #tp04:03
*** llnz2 has joined #tp04:15
*** llnz has quit IRC04:15
*** llnz2 is now known as llnz04:15
CIA-46llnz tpserver-cpp-battlexml * rce59b32c82a2 /modules/games/risk/risk.cpp:04:27
CIA-46Fixed no universe bug when map import fails in risk.04:27
CIA-46Thanks Ric Cook.04:27
CIA-46llnz tpserver-cpp * r515f3ad61406 /tpserver/ (5 files in 2 dirs):04:30
CIA-46Added tinyxml to core tpserver-cpp.04:30
CIA-46Slightly modified version to tinyxml.04:30
CIA-46llnz tpserver-cpp * r0e98aca42424 /modules/games/risk/ (9 files): Removed risk tinyxml, use tpserver-cpp version.04:30
CIA-46llnz tpserver-cpp * rce59b32c82a2 /modules/games/risk/risk.cpp:04:30
CIA-46Fixed no universe bug when map import fails in risk.04:30
CIA-46Thanks Ric Cook.04:30
CIA-46llnz tpserver-cpp * rba946f3725a4 / (15 files in 3 dirs): Merge branch 'battlexml'04:30
*** Greywhind has quit IRC04:49
*** llnz2 has joined #tp04:53
*** llnz has quit IRC04:53
*** llnz2 is now known as llnz04:53
*** JLafont_ has joined #tp06:03
*** JLafont has quit IRC06:03
*** JLafont has joined #tp06:08
*** llnz2 has joined #tp06:10
*** llnz has quit IRC06:13
*** llnz2 is now known as llnz06:13
*** mithro_ has joined #tp06:15
*** mithro_ has quit IRC06:16
*** tansell_laptop has quit IRC06:19
*** JLafont has quit IRC06:20
*** tansell_laptop has joined #tp06:35
*** llnz has quit IRC06:43
*** jmtan has quit IRC07:10
*** zzorn has quit IRC07:49
*** epyon has joined #tp08:00
*** zzorn has joined #tp08:18
*** alanp_ has joined #tp08:38
*** mithro has quit IRC08:49
*** bddebian has joined #tp09:45
bddebianHi09:47
*** Noughmad has joined #tp09:51
*** Noughmad has quit IRC09:59
*** Noughmad has joined #tp09:59
*** verhoevenv has joined #tp10:24
*** alanp_ has quit IRC11:32
*** peres has joined #tp12:27
*** Greywhind has joined #tp12:59
*** peres has quit IRC13:35
*** alanp_ has joined #tp13:52
*** Noughmad has quit IRC14:08
*** alanp_ has quit IRC14:59
*** alanp_ has joined #tp15:23
*** alanp has quit IRC15:39
*** llnz has joined #tp16:06
*** bddebian has quit IRC16:39
llnzmhilmi: it's odd that it would hang (stop responding) in that place17:56
llnzcan you provide some more details? paste into a pastebin if you need to17:56
mhilmiokay I have a debug output17:57
mhilmiIt seems it breakdowns at the connect(TPSocket* nsock) function17:57
mhilmiDo you think connecting to an http server would avoid the TPSocket connect function?18:01
mhilmiI'm trying to connect to the demo1.thousandparsec.net server as guest/guest18:01
mhilmipastebin.com/m623aacb318:03
mhilminot much info..18:04
*** greenlion has quit IRC18:04
llnzsegfault? interesting18:08
llnzmhilmi: have you set an event loop?18:09
mhilmiI only created a GameLayer object, setClientString, SetLogger, but I didn't set an EventLoop18:12
llnzyou need to set an event loop, it will need to a subclass that connects to the correct qt event loop methods18:13
mhilmiI'll thought I could do it after connection18:13
mhilmiI'll try that18:13
llnznope, needs to be created and set before "using" the library, part of the set up (like setClientString, setlogger, etc)18:14
mhilmiI see it in the doxygen now, "Must be set before connecting to a server." doh18:15
llnzi should add a check for an event loop before allowing the connection (and logging the error if not set)18:21
JLP_ahoy everyone18:31
*** JLP_ is now known as JLP18:32
llnzhi JLP18:32
llnzmhilmi: i guess i need to update the main page of the doxygen to make that clearer too18:32
*** nash has joined #tp18:47
*** jnengland77 has joined #tp18:50
*** jnengland77 has quit IRC18:50
tansell_laptopmorning19:30
cherezMorning.19:50
tansell_laptopcherez, how does it go?19:51
chereztansell_laptop: New stuff for code review when you have time. http://codereview.mithis.com/100419:51
tpbTitle: Issue 1004: Added unit tests for structures. - Code Review (at codereview.mithis.com)19:51
totetansell_laptop: hi, when i use the login method on the Connection object from libtpproto, why can i enter any user and pass and still get logged in?19:52
cherezI nearly went mad figuring out the namespace logistics.19:52
tansell_laptopnamespace logistics?19:52
tansell_laptoptote, your doing something wrong?19:52
totetansell_laptop: if failed(connection.login(username, password)):19:53
tansell_laptopwhy are you using libtpproto-py rather then libtpclient-py19:53
chereztansell_laptop: Making all the names of group members work out right.19:54
tansell_laptopcherez, ahh19:54
llnztote: the demo servers have "auto add players' turned on, and creates an account for every new username19:55
totetansell_laptop: im doing the connect as daneel-ai does it19:55
llnztry the same username with a different password19:55
totellnz: ahh, ok19:55
toteyep, using same username with different pass makes it fail :)19:56
tansell_laptopcherez, can you split this patch into two?20:00
cherezI think I can?20:01
cherezHow should it be split?20:03
tansell_laptopcherez, it would be good if you could put the simple testing for Char/String20:04
tansell_laptopand the Group stuff20:06
CIA-46joelboh tpclient-pyweb * r8702738b7fb8 / (4 files in 3 dirs):20:09
CIA-46Backend: Added login capabilities.20:09
CIA-46Frontend: Added a port input field. Added better error handling code.20:09
CIA-46joelboh tpclient-pyweb * r3999a9497828 /app/middleman.py: Cleaned up middleman module20:13
*** verhoevenv has quit IRC20:38
tansellcherez, almost ready for our meeting?20:52
chereztansell: Writing blog updates right now.20:52
cherezShould I be expecting to work on modules besides parser in the next week?20:53
tansellat your current progress rate it seems unlikely20:56
*** mithro has joined #tp20:58
*** peres has joined #tp21:08
cherezmithro: Ping?21:17
*** verhoevenv has joined #tp21:27
tansellhrm21:39
tansellcherez, sorry about that got distracted by a work colleague21:39
cherezNo worries.21:40
tansellcherez, so you should be aiming for a coverage of at least 90 if not closer to 95->98%21:41
Greywhindtansell: so... i'm adding a wxChoice to PanelOrder for selecting which queue to look at21:42
tansell(for the currently tested xstruct and structure file)21:42
tansellGreywhind, sounds like a good idea, did you get the other problems fixed?21:42
Greywhindtansell: but when i put it in, no matter what i set it to do (grow, not grow, etc), the list of orders takes up less than half the panel where it before took up the whole thing21:42
Greywhindtansell: yeah, i think so21:43
tansellGreywhind, did you add it in as a flexgrid?21:43
tansellset the bottom row to auto-expand21:43
Greywhindi separated the Object and Order selectors, but kept the ObjectOrder one for other classes like the Starmap to use21:43
Greywhindso only the PanelOrder uses the separated Object and Order selection21:44
tansellGreywhind, the ObjectOrder one is going to be a bit more complicated as you have to watch multiple order queues21:44
Greywhindtansell: i'll have to watch multiple order queues at once? can't i just update it whenever i switch to a new queue?21:44
tansellGreywhind, possibly, lets not worry about it for now21:46
Greywhindok21:46
Greywhindanyway, back to the panel21:46
Greywhindi added it first by itself inside the flexgridsizer that also holds the master21:47
Greywhindi also tried putting it inside a panel and another flexgridsizer21:47
Greywhindthen when that didn't work, i moved it down into the master21:47
tansellso you need21:48
tansella top level flexigridsizer21:48
Greywhindright21:48
tansellwith a single column and two rows21:48
Greywhindright21:48
tansellthe second row (which is row 1 - indexed from zero) should be set to "auto-expand"21:50
tansellcolumn 0 should be set to auto-expand21:50
tansellGreywhind, a good way to test things are working is to set the background colors to something like Red21:51
CIA-46joelboh tpclient-pyweb * ra88042b75745 / (22 files in 7 dirs):21:51
CIA-46Renamed app to backend and www to frontend. Added beaker and simplejson21:51
CIA-46to requirements.py21:51
Greywhindtansell: i tried the background color trick21:52
Greywhindthe background was mostly that of the blank panel21:52
Greywhindnot any control at all21:52
tansellGreywhind, screenshot?21:53
Greywhindi'll take one real quick21:53
Greywhindhttp://yfrog.com/0ubrokenexpandp21:56
tpbTitle: Yfrog - brokenexpand.png (at yfrog.com)21:56
Greywhindthe blue is the "Master" wxPanel21:56
Greywhindalso, whenever i set growablerows or growablecolumns, then save, then re-select that sizer, they're back to empty21:57
tansellGreywhind, you are modifying it in the xrced right?21:58
Greywhindyes21:58
tansellso does it work when you preview in the xrced?21:59
Greywhindwell, it shows up a smaller size, and it doesn't resize22:05
Greywhindbut other than that, it works22:05
tansellso it looks like you have two problems22:05
tansell1) the sizer is not adjusting correctly22:06
tansell2) objects are not expanding to fill the boxs22:06
tansellyou need to set the wx.EXPAND property on items22:06
tanselland set the proportion to 122:06
Greywhindtansell: why would it be removing the growable rows though?22:06
tansellremoving?22:07
tansellfix the expand problem first and it'll be easier to see what is going on with the sizer22:07
Greywhindwhenever i add growable rows to the flexgridsizer, they're no longer there when i go back to it22:07
tansellhow are you adding growable rows?22:09
Greywhindthrough xrced's selection box22:09
*** verhoevenv has quit IRC22:10
tansellyou just enter a number in it22:10
Greywhindyeah, i just did that finally, and it worked22:10
Greywhindi wonder why the selection wasn't working22:10
tansellit's borked22:11
tansell(in the tpclient-pywx version of xrced)22:11
Greywhindah22:11
Greywhindok22:11
tansellI assuming you are using our ./xrced rather then the one which comes with the package22:13
Greywhindi... think so.22:14
tanselllunch time here22:24
tansellGreywhind, did you get the expanding working?22:24
tansellremeber to set the wx.EXPAND property and proportion stuff22:24
tansellbe back in an hour22:24
*** Erroneous has quit IRC22:27
*** bddebian has joined #tp22:57
tansellback23:14
tansellGreywhind, anyluck?23:15
tansellcherez, just reading your latest post about how structures work23:25
cherezYeah?23:25
*** alanp__ has joined #tp23:25
tansellcherez, I think you need to add some stuff about the distinction between the Structures been class/instance members23:25
cherezRight, since that's why they can't just store their members inside themselves.23:26
tansellyeah23:28
tansellalso - there is something you should know about __getattr__23:28
tansellit only gets called if the attribute is not found on the object23:28
cherezMm, bad example then.23:29
tansellcherez, bad example?23:29
tansellthe reason __getattr__ works on the GroupProxy is because it never actually contains any properties23:30
cherezI used it as an example toward the end for why underscores in names is a problem.23:30
tansellwell, actually that example still holds23:30
tansellas it'll basically overwrite a function with something like an integer23:31
tansellthe following is also wrong23:31
Greywhindtansell: the expanding seems to work23:31
tansellIt's also important to use the child's original name or g.g.s's name will be "s", then prepend "g_" for "g_s", then prepend "g_g_" for "g_g_g_s".23:32
tansellwhat should happen when the name changes, it should strip off the old prefix and add the new prefix23:32
tansellso the result should be __g_g_s right?23:32
tansellGreywhind, so is the growing now working right?23:33
Greywhindtansell: seems so23:33
tansellGreywhind, great!23:34
tansellcherez, I'll be right back23:34
cherezAlright.23:34
Greywhindtansell: now i just have to start changing things to work with multiple queues23:35
*** alanp_ has quit IRC23:41
Greywhindtansell: ok, so now i'm running up against the problem of testing23:42

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