Saturday, 2009-06-06

*** tpb has joined #tp00:00
*** ChanServ sets mode: +o tpb00:00
mithroheyo people01:56
Landonheyo01:57
*** DTRemenak has joined #tp01:58
mithroso Landon where are you at?02:02
Greywhindhey mithro - glad you're here. i've been stuck all day.02:03
Landonabout the same codewise, advancing thoughtwise, I've been extremely busy with moving and unpacking, but thats done this weekend02:03
mithrowe are a two weeks in02:04
mithrowhile thoughtwise is great, we can't really judge thoughtwise02:04
Landonyeah, I realize that, I'll try to get some code in soon02:06
LandonI got off to a bit of a false start last night when for some reason I was thinking I wopuld need timers to drive the events02:06
mithrotwo weeks equals ~= 1/6th of your time02:07
mithroGreywhind: ping?02:11
Greywhindmithro: pong02:12
Greywhindmithro: first, did you ever get to look at: http://codereview.mithis.com/2007/show02:12
tpbTitle: Issue 2007: Added media support to the Systems-level overlay on the Starmap. - Code Review (at codereview.mithis.com)02:12
mithroLGTM02:21
Greywhindok, cool02:21
Greywhindmithro: second problem. I decided to start my work on the Orders panel simply by making it work with at least one order queue.02:22
Greywhindi'll then extend it to work with multiple ones02:22
mithroGreywhind: makes sense02:22
Greywhindmithro: so the problem is, i can't seem to figure out equivalent code for some things02:23
mithrolike?02:23
Greywhindi don't know exactly what the old structure was, so it's hard to figure out what's changed. here's the main one i've had trouble with:02:23
Greywhindargs = [0, self.oid, -1, type, 0, []]02:23
Greywhindfor name, type in orderdesc.names:02:23
Greywhindargs += defaults[type]02:23
Greywhinderr, sorry. the old code was02:24
Greywhindargs = [0, self.oid, -1, type, 0, []]02:24
Greywhindfor name, type in self.applications.cache.orders[self.oid]:02:24
Greywhindargs += defaults[type]02:24
Greywhindwait. no, never mind.02:24
Greywhindthe first one was right.02:24
Greywhindorderdesc = objects.OrderDescs()[type]02:25
mithroGreywhind: it was very similar to the current structure02:27
mithrobasically orderdesc.name contains a list of argument names and their type02:28
Greywhindwell, apparently the .names no longer exists. has it just been renamed to .name?02:28
mithronames would be equivalent of properties02:29
Greywhindhm02:29
mithrooh wait02:29
mithrono sorry it would be the equivalent of arguments02:30
Greywhindarguments? ok, i'll try taht02:30
Greywhind*that02:30
mithro* a list of02:30
mithro* a String, argument name02:30
mithro* a UInt32, argument type02:30
mithro* a String, description02:30
Greywhindso i can ignore the description?02:30
mithroyeah02:31
Greywhindok02:31
Greywhindlet me try that02:31
Greywhindtansell: yep, that seems to have worked. thanks - i was totally lost.02:32
Greywhindi was thinking arguments was probably an internal thing, for netlib use or something02:32
Greywhindkept trying to deal with the properties02:33
mithroyou could actually use properties02:36
mithrothe information is almost the same02:37
Greywhindwell, i was confused by the properties because they don't seem to be structured like the object ones02:37
Greywhindfor instance, they don't seem to set attributes on the orderdesc02:37
mithroGreywhind: what do you mean?02:38
Greywhindif i recall correctly, getattr(orderdesc, "ship") wouldn't work, for instance, if ship was one of the properties. i might have just been doing it wrong, i suppose.02:38
mithroObjectDesc has a very similar structure to OrderDesc02:38
mithrogetattr(objectdesc, "ship") would not have worked either02:39
mithrogetattr(object, "ship") does02:39
mithroso does02:39
mithrogetattr(order, "ship")02:39
Greywhindah. i see.02:39
Greywhindso how do the properties work on descs?02:39
mithrothe descs are just a container which tells you about the properties02:40
mithrothey say that "this object/order type has these properties"02:40
Greywhindok02:41
Greywhindso here we're constructing a new order with those attributes/properties02:41
Greywhindtaken from the list on the orderdesc02:41
mithroyeah02:42
Greywhindok02:42
Greywhindthanks02:42
mithrowe never have to construct new objects02:42
Greywhindright02:42
Greywhindmithro: ping?03:02
mithroGreywhind: pong03:02
Greywhindmithro: i just realized i was wrong earlier - it didn't actually fix it:03:02
GreywhindAttributeError: type object 'DynamicOrder' has no attribute 'arguments'03:02
Greywhind   for name, type, description in orderdesc.arguments:03:03
mithroumm a DynamicOrder != OrderDesc03:04
mithro(an OrderDesc creates a DynamicOrder)03:04
Greywhindorderdesc = objects.OrderDescs()[type]03:04
Greywhindit should be an OrderDesc03:04
Greywhindshouldn't it?03:05
Landonmithro: I'll try to get some work in tomorrow, I have specific fixes and additions in mind03:06
Landonwhere does the "base" python library for battlexml live03:06
Landon?03:06
Landonin the battleviewer repo?03:07
mithroLandon: what do you mean "base" ?03:07
Landongah, figment of my imagination I guess03:08
LandonI thought I saw it in with the 2d battleviewer as well as the 3d clients code03:08
Landonthought it might be elsewhere too03:08
mithrothere might be some code shared or something03:09
mithroit might be worth creating such a library03:09
mithrobut I don't think any such thing exists yet03:09
Landonyeah, I'll try to get the battleviewer repo cleaned up as well so it has common utilities like that03:09
Landonhm, also, right now I'm working on it in the 3d client repo, not the battleviewer repo. this seems kind of awkward if it's to be able to be run as a standalone utility as well, but it depends on some of the files in the 3d client repo03:11
Landonis there a clean way to handle that?03:11
mithroLandon: not sure03:12
Landonok, I'll continue as is for now03:13
Greywhindmithro: any ideas, or should i just deal with it tomorrow?03:14
mithroGreywhind: yes03:14
mithrouse the cache03:14
mithrocache.orderdesc[type]03:15
mithroor you could use the DynamicOrder.properties to get similar information03:15
Greywhindok. thanks.03:15
Greywhindlet me try the first one03:15
mithrofor name, type, desc in self.arguments:03:16
mithroproperty = OrderParamsMapping[type](name=name, desc=desc)03:16
mithroDynamicOrder.properties.append(property)03:16
mithrosetattr(DynamicOrder, name, property)03:16
mithroas you can see DynamicOrder.properties is created from OrderDesc.arguments03:17
Greywhindmithro: the cache doesn't seem to have a .orderdesc, .orderdescs, or .order_descs03:18
*** greenlion has joined #tp03:19
mithrohrm looks like you are right03:19
mithroGreywhind: are you looking at the code03:21
mithroline 476 in panelOrder.py03:21
Greywhind38503:22
Greywhindalthough it may not be exactly the same number03:22
Greywhindit's in OnOrderNew()03:22
mithroso just loop over the properties03:24
Greywhindwhat do i take from each one?03:25
Greywhindand how far down into the nested properties do i need to go?03:25
mithrouse the properties type to figure out what to use as defaults03:25
mithroGreywhind: single layer03:25
mithroGreywhind: orderdesc's don't have groups03:25
Greywhindwhat do you mean by "use the properties type to figure out what to use as defaults"?03:26
Greywhindcan i just pass the type?03:26
Greywhindlike it does now?03:26
mithrodo you understand what this code is doing?03:27
Greywhindi'm not sure i do, entirely03:27
mithroit's basically trying to come up with a set of default values to give to the creation of an Order03:27
mithroso it looks over the properties an order has, and figures provides some defaults03:28
Greywhindalso, defaults[type] doesn't seem to work anymore - defaults doesn't exist03:28
mithroso have you fixed the BuildPanel function?03:28
Greywhindno, i don't think i have03:29
Greywhindit has the same kind of orderdesc.names stuff03:29
mithrogo to the BuildPanel function03:29
Greywhindok03:30
mithrofor name, subtype in orderdesc.names:03:31
mithroif subtype == constants.ARG_ABS_COORD:03:31
mithro..03:31
mithrobecomes03:31
mithrofor property in orderdesc.properties:03:31
mithroif isinstance(propery, parameters.OrderParamAbsSpaceCoords):03:31
mithro..03:31
Greywhindok03:31
mithrothat make sense?03:31
Greywhindyeah03:31
mithroso thats the same basic transformation you need everywhere03:32
mithroyou'll need to replace defaults with either a new dictionary or a if/elif chain03:33
mithroI think a if/elif chain might make more sense03:34
Greywhindok. i think i'm starting to see what you mean.03:34
mithroas some defaults could use hints about the current object03:34
Greywhindi'm not sure what was in the original "defaults" though03:34
mithro(IE the default for OrderParamAbsSpaceCoords could be the current object's position)03:34
Greywhindwhat kinds of values does it have for the keys?03:34
mithroGreywhind: look at the old code03:34
Greywhindok, will do03:35
mithroit's like in the first 20 lines of panelOrder.py03:36
Greywhindthanks for the help - i'll work on this tomorrow, and probably then ask you more silly questions03:36
*** Greywhind has quit IRC04:11
*** greenlion has quit IRC06:59
*** tansell_laptop has joined #tp08:10
*** verhoevenv has joined #tp10:11
*** peres has quit IRC10:35
*** peres has joined #tp10:37
ezodmithro: i'm having a look (finally) at doing the launcher stuff properly in libtpclient-py10:38
ezodpexpect might do everything we need for that10:38
*** verhoevenv has quit IRC10:38
ezodthe .kill() method looks inadequate, but i'm investigating that10:39
ezodon the other hand, the onready stuff in launcher is probably good enough10:41
ezodapparently pexpect isn't available at all natively on windows, fail10:56
*** peres has left #tp11:37
*** Greywhind has joined #tp11:58
tansell_laptopmorning Greywhind12:22
Greywhindtansell_laptop: morning12:28
* tansell_laptop should probably be in bed12:29
Greywhindyeah, i was wondering why you were still awake :P12:35
tansell_laptopGreywhind, need any help before I actually go to bed?13:13
Greywhindtansell_laptop: i haven't started yet today - i'll ask you later13:14
tansell_laptopokay13:16
tansell_laptopsee ya then13:16
Greywhindcya13:16
*** greenlion has joined #tp13:52
*** JLP_ has quit IRC14:38
*** JLP has joined #tp14:38
*** JLP_ has joined #tp14:43
*** JLP has quit IRC14:43
*** greenlion has quit IRC16:26
*** alanp has quit IRC18:25
*** zzorn has quit IRC18:25
*** gau_veldt has quit IRC18:25
*** alanp has joined #tp18:26
*** zzorn has joined #tp18:26
*** gau_veldt has joined #tp18:26
*** peres has joined #tp20:52
tansell_laptopmorning people21:27
Greywhindtansell_laptop: morning21:27
tansell_laptopGreywhind, any luck with the order stuff?21:29
Greywhindtansell_laptop: mixed21:29
Greywhindi have some things to ask you about21:29
Greywhindhope you don't mind too much :-/21:29
tansell_laptopshoot21:32
Greywhindlet me paste this error21:33
Greywhindtansell_laptop: http://pastebin.com/d4f8d653221:33
tpbTitle: pastebin - collaborative debugging tool (at pastebin.com)21:33
Greywhindnot sure what's causing this21:33
tansell_laptopGreywhind, your not giving the order the correct arguments21:35
Greywhindhm. here's what i'm giving it:21:35
Greywhind[0, 11, -1, 2, 0, [], [[], []], [0, '']]21:35
Greywhindthis is a "Create ship" order21:36
tansell_laptopGreywhind, have a look at the code in libtpproto-py/tp/netlib/objects/OrderDesc.py21:38
Greywhindtansell_laptop: i've been looking at it... anything specific?21:38
tansell_laptopoh21:40
tansell_laptopactually it's unrelated21:40
tansell_laptopGreywhind, can you try adding an order using tpclient-pywx with tp0321:43
tansell_laptopand then try downloading the universe with tp04and see what happens21:43
Greywhindtansell_laptop: the same thing21:43
tansell_laptopsame thing in what way21:48
tansell_laptopyou get the error now when connecting?21:49
Greywhindyes21:49
Greywhindthe error i got when adding using tp04 also would continue when connecting until the next turn started21:49
tansell_laptopso the error is caused when trying to de-serialise the order frames21:51
tansell_laptophence the error in __process__21:52
Greywhindok. any idea how to fix it?21:52
tansell_laptopGreywhind, so the problem is that the unpacking is producing the wrong output expected by the __init__ method21:55
Greywhindso i should change it to match the __init__ argument list? it seems quite different at the moment...21:56
tansell_laptopfor property, arg in zip(self.properties, args):21:57
tansell_laptopprint property, arg, self.__class__.__dict__[property.name]21:57
tansell_laptopself.length += property.length(arg)21:57
tansell_laptopsetattr(self, property.name, arg)21:57
tansell_laptopit's that bit which is not working as expected21:58
tansell_laptopby the presence of a print statement - my guess is that I was working on it some time ago21:59
Greywhindtansell_laptop: it seems like maybe... the code in Structures where the error is is getting called twice for a "name" property, the second time it's failing?22:18
tansell_laptopjust trying to reproduce the problem here22:19
tansell_laptopI get a different error22:20
tansell_laptop  File "libtpproto-py/tp/netlib/common.py", line 263, in _processFrame22:21
tansell_laptop    p.__process__(p._data)22:21
tansell_laptop  File "libtpproto-py/tp/netlib/objects/Description.py", line 25, in __process__22:21
tansell_laptop    self.__class__.__process__(self, leftover, **kw)22:21
tansell_laptop  File "libtpproto-py/tp/netlib/objects/Description.py", line 22, in __process__22:21
tansell_laptop    self.__init__(self.sequence, *args, **kw)22:21
tansell_laptopTypeError: __init__() takes exactly 17 arguments (9 given)22:21
Greywhind<OrderParamList 0x9f76e6c ships>22:22
GreywhindName:  ships22:22
GreywhindAttr:  [possibleselections([ISI]): [], selection([II]): []]22:22
Greywhind<OrderParamString 0x9f76f6c name>22:22
GreywhindName:  name22:22
GreywhindAttr:  [maxlength(I): 0, string(S): '']22:22
Greywhind<OrderParamString 0x9f76f6c name>22:22
GreywhindName:  name22:22
GreywhindAttr: Traceback (most recent call last):22:22
tansell_laptopoh wait22:23
tansell_laptopoh I found the error22:24
tansell_laptop              args = [self.id, self.subtype, self.name, self.desc, self.parent, self.contains, self.modify_time]22:28
tansell_laptop+               args = [self.id, self.slot, self.subtype, self.turns, self.resources]22:28
Greywhindi was thinking it might be that earlier, actually22:28
Greywhindtansell_laptop: yep, that seems to have fixed that problem22:32
Greywhindnow it's got a different error that i'm looking into22:32
Greywhindtansell_laptop: have to go eat, be back soon22:34
tansell_laptopokay22:35
CIA-46tansell libtpproto-py-tp04 * ra00eaab8d36e /tp/netlib/objects/OrderDesc.py: Small fix an small copy from ObjectDesc error.22:37
tansell_laptopopps22:51
CIA-46mithro libtpproto-py-tp04 * ra27bfee5de2c /tp/netlib/objects/OrderDesc.py: Small fix an small copy from ObjectDesc error.22:59
Greywhindtansell_laptop: ping?23:19
mithroGreywhind: pongh23:20
Greywhindmithro: now the error is being added, and if i reconnect, i see it's there. however, i'm getting this immediately after it's added:23:21
Greywhindmithro: http://pastebin.com/d3070490823:21
tpbTitle: pastebin - collaborative debugging tool (at pastebin.com)23:21
mithroGreywhind: hrm23:23
cherezmithro: http://codereview.mithis.com/2008/show23:28
tpbTitle: Issue 2008: Switched unit tests to use the unittest module. - Code Review (at codereview.mithis.com)23:28
mithrocherez: LGTM - but I think the tests should be in a "tests" directory23:30
cherezmithro: What would I have to do to make module importing work then?23:32
mithrotouch __init__.y23:32
mithros/y/py/23:32
cherezI mean if they're in a test directory then libtpproto2-py will no longer be on their path.23:33
mithrocherez: sys.path.insert("..")23:34
cherezThought so.23:35
cherezI guess that's the cleanest way.23:35
*** sladegen has quit IRC23:36
*** sladegen has joined #tp23:36
cherezWell then, I'll push that.23:46

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