*** tpb has joined #tp | 00:00 | |
*** ChanServ sets mode: +o tpb | 00:00 | |
mithro | heyo people | 01:56 |
---|---|---|
Landon | heyo | 01:57 |
*** DTRemenak has joined #tp | 01:58 | |
mithro | so Landon where are you at? | 02:02 |
Greywhind | hey mithro - glad you're here. i've been stuck all day. | 02:03 |
Landon | about the same codewise, advancing thoughtwise, I've been extremely busy with moving and unpacking, but thats done this weekend | 02:03 |
mithro | we are a two weeks in | 02:04 |
mithro | while thoughtwise is great, we can't really judge thoughtwise | 02:04 |
Landon | yeah, I realize that, I'll try to get some code in soon | 02:06 |
Landon | I 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 events | 02:06 |
mithro | two weeks equals ~= 1/6th of your time | 02:07 |
mithro | Greywhind: ping? | 02:11 |
Greywhind | mithro: pong | 02:12 |
Greywhind | mithro: first, did you ever get to look at: http://codereview.mithis.com/2007/show | 02:12 |
tpb | Title: Issue 2007: Added media support to the Systems-level overlay on the Starmap. - Code Review (at codereview.mithis.com) | 02:12 |
mithro | LGTM | 02:21 |
Greywhind | ok, cool | 02:21 |
Greywhind | mithro: 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 |
Greywhind | i'll then extend it to work with multiple ones | 02:22 |
mithro | Greywhind: makes sense | 02:22 |
Greywhind | mithro: so the problem is, i can't seem to figure out equivalent code for some things | 02:23 |
mithro | like? | 02:23 |
Greywhind | i 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 |
Greywhind | args = [0, self.oid, -1, type, 0, []] | 02:23 |
Greywhind | for name, type in orderdesc.names: | 02:23 |
Greywhind | args += defaults[type] | 02:23 |
Greywhind | err, sorry. the old code was | 02:24 |
Greywhind | args = [0, self.oid, -1, type, 0, []] | 02:24 |
Greywhind | for name, type in self.applications.cache.orders[self.oid]: | 02:24 |
Greywhind | args += defaults[type] | 02:24 |
Greywhind | wait. no, never mind. | 02:24 |
Greywhind | the first one was right. | 02:24 |
Greywhind | orderdesc = objects.OrderDescs()[type] | 02:25 |
mithro | Greywhind: it was very similar to the current structure | 02:27 |
mithro | basically orderdesc.name contains a list of argument names and their type | 02:28 |
Greywhind | well, apparently the .names no longer exists. has it just been renamed to .name? | 02:28 |
mithro | names would be equivalent of properties | 02:29 |
Greywhind | hm | 02:29 |
mithro | oh wait | 02:29 |
mithro | no sorry it would be the equivalent of arguments | 02:30 |
Greywhind | arguments? ok, i'll try taht | 02:30 |
Greywhind | *that | 02:30 |
mithro | * a list of | 02:30 |
mithro | * a String, argument name | 02:30 |
mithro | * a UInt32, argument type | 02:30 |
mithro | * a String, description | 02:30 |
Greywhind | so i can ignore the description? | 02:30 |
mithro | yeah | 02:31 |
Greywhind | ok | 02:31 |
Greywhind | let me try that | 02:31 |
Greywhind | tansell: yep, that seems to have worked. thanks - i was totally lost. | 02:32 |
Greywhind | i was thinking arguments was probably an internal thing, for netlib use or something | 02:32 |
Greywhind | kept trying to deal with the properties | 02:33 |
mithro | you could actually use properties | 02:36 |
mithro | the information is almost the same | 02:37 |
Greywhind | well, i was confused by the properties because they don't seem to be structured like the object ones | 02:37 |
Greywhind | for instance, they don't seem to set attributes on the orderdesc | 02:37 |
mithro | Greywhind: what do you mean? | 02:38 |
Greywhind | if 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 |
mithro | ObjectDesc has a very similar structure to OrderDesc | 02:38 |
mithro | getattr(objectdesc, "ship") would not have worked either | 02:39 |
mithro | getattr(object, "ship") does | 02:39 |
mithro | so does | 02:39 |
mithro | getattr(order, "ship") | 02:39 |
Greywhind | ah. i see. | 02:39 |
Greywhind | so how do the properties work on descs? | 02:39 |
mithro | the descs are just a container which tells you about the properties | 02:40 |
mithro | they say that "this object/order type has these properties" | 02:40 |
Greywhind | ok | 02:41 |
Greywhind | so here we're constructing a new order with those attributes/properties | 02:41 |
Greywhind | taken from the list on the orderdesc | 02:41 |
mithro | yeah | 02:42 |
Greywhind | ok | 02:42 |
Greywhind | thanks | 02:42 |
mithro | we never have to construct new objects | 02:42 |
Greywhind | right | 02:42 |
Greywhind | mithro: ping? | 03:02 |
mithro | Greywhind: pong | 03:02 |
Greywhind | mithro: i just realized i was wrong earlier - it didn't actually fix it: | 03:02 |
Greywhind | AttributeError: type object 'DynamicOrder' has no attribute 'arguments' | 03:02 |
Greywhind | for name, type, description in orderdesc.arguments: | 03:03 |
mithro | umm a DynamicOrder != OrderDesc | 03:04 |
mithro | (an OrderDesc creates a DynamicOrder) | 03:04 |
Greywhind | orderdesc = objects.OrderDescs()[type] | 03:04 |
Greywhind | it should be an OrderDesc | 03:04 |
Greywhind | shouldn't it? | 03:05 |
Landon | mithro: I'll try to get some work in tomorrow, I have specific fixes and additions in mind | 03:06 |
Landon | where does the "base" python library for battlexml live | 03:06 |
Landon | ? | 03:06 |
Landon | in the battleviewer repo? | 03:07 |
mithro | Landon: what do you mean "base" ? | 03:07 |
Landon | gah, figment of my imagination I guess | 03:08 |
Landon | I thought I saw it in with the 2d battleviewer as well as the 3d clients code | 03:08 |
Landon | thought it might be elsewhere too | 03:08 |
mithro | there might be some code shared or something | 03:09 |
mithro | it might be worth creating such a library | 03:09 |
mithro | but I don't think any such thing exists yet | 03:09 |
Landon | yeah, I'll try to get the battleviewer repo cleaned up as well so it has common utilities like that | 03:09 |
Landon | hm, 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 repo | 03:11 |
Landon | is there a clean way to handle that? | 03:11 |
mithro | Landon: not sure | 03:12 |
Landon | ok, I'll continue as is for now | 03:13 |
Greywhind | mithro: any ideas, or should i just deal with it tomorrow? | 03:14 |
mithro | Greywhind: yes | 03:14 |
mithro | use the cache | 03:14 |
mithro | cache.orderdesc[type] | 03:15 |
mithro | or you could use the DynamicOrder.properties to get similar information | 03:15 |
Greywhind | ok. thanks. | 03:15 |
Greywhind | let me try the first one | 03:15 |
mithro | for name, type, desc in self.arguments: | 03:16 |
mithro | property = OrderParamsMapping[type](name=name, desc=desc) | 03:16 |
mithro | DynamicOrder.properties.append(property) | 03:16 |
mithro | setattr(DynamicOrder, name, property) | 03:16 |
mithro | as you can see DynamicOrder.properties is created from OrderDesc.arguments | 03:17 |
Greywhind | mithro: the cache doesn't seem to have a .orderdesc, .orderdescs, or .order_descs | 03:18 |
*** greenlion has joined #tp | 03:19 | |
mithro | hrm looks like you are right | 03:19 |
mithro | Greywhind: are you looking at the code | 03:21 |
mithro | line 476 in panelOrder.py | 03:21 |
Greywhind | 385 | 03:22 |
Greywhind | although it may not be exactly the same number | 03:22 |
Greywhind | it's in OnOrderNew() | 03:22 |
mithro | so just loop over the properties | 03:24 |
Greywhind | what do i take from each one? | 03:25 |
Greywhind | and how far down into the nested properties do i need to go? | 03:25 |
mithro | use the properties type to figure out what to use as defaults | 03:25 |
mithro | Greywhind: single layer | 03:25 |
mithro | Greywhind: orderdesc's don't have groups | 03:25 |
Greywhind | what do you mean by "use the properties type to figure out what to use as defaults"? | 03:26 |
Greywhind | can i just pass the type? | 03:26 |
Greywhind | like it does now? | 03:26 |
mithro | do you understand what this code is doing? | 03:27 |
Greywhind | i'm not sure i do, entirely | 03:27 |
mithro | it's basically trying to come up with a set of default values to give to the creation of an Order | 03:27 |
mithro | so it looks over the properties an order has, and figures provides some defaults | 03:28 |
Greywhind | also, defaults[type] doesn't seem to work anymore - defaults doesn't exist | 03:28 |
mithro | so have you fixed the BuildPanel function? | 03:28 |
Greywhind | no, i don't think i have | 03:29 |
Greywhind | it has the same kind of orderdesc.names stuff | 03:29 |
mithro | go to the BuildPanel function | 03:29 |
Greywhind | ok | 03:30 |
mithro | for name, subtype in orderdesc.names: | 03:31 |
mithro | if subtype == constants.ARG_ABS_COORD: | 03:31 |
mithro | .. | 03:31 |
mithro | becomes | 03:31 |
mithro | for property in orderdesc.properties: | 03:31 |
mithro | if isinstance(propery, parameters.OrderParamAbsSpaceCoords): | 03:31 |
mithro | .. | 03:31 |
Greywhind | ok | 03:31 |
mithro | that make sense? | 03:31 |
Greywhind | yeah | 03:31 |
mithro | so thats the same basic transformation you need everywhere | 03:32 |
mithro | you'll need to replace defaults with either a new dictionary or a if/elif chain | 03:33 |
mithro | I think a if/elif chain might make more sense | 03:34 |
Greywhind | ok. i think i'm starting to see what you mean. | 03:34 |
mithro | as some defaults could use hints about the current object | 03:34 |
Greywhind | i'm not sure what was in the original "defaults" though | 03:34 |
mithro | (IE the default for OrderParamAbsSpaceCoords could be the current object's position) | 03:34 |
Greywhind | what kinds of values does it have for the keys? | 03:34 |
mithro | Greywhind: look at the old code | 03:34 |
Greywhind | ok, will do | 03:35 |
mithro | it's like in the first 20 lines of panelOrder.py | 03:36 |
Greywhind | thanks for the help - i'll work on this tomorrow, and probably then ask you more silly questions | 03:36 |
*** Greywhind has quit IRC | 04:11 | |
*** greenlion has quit IRC | 06:59 | |
*** tansell_laptop has joined #tp | 08:10 | |
*** verhoevenv has joined #tp | 10:11 | |
*** peres has quit IRC | 10:35 | |
*** peres has joined #tp | 10:37 | |
ezod | mithro: i'm having a look (finally) at doing the launcher stuff properly in libtpclient-py | 10:38 |
ezod | pexpect might do everything we need for that | 10:38 |
*** verhoevenv has quit IRC | 10:38 | |
ezod | the .kill() method looks inadequate, but i'm investigating that | 10:39 |
ezod | on the other hand, the onready stuff in launcher is probably good enough | 10:41 |
ezod | apparently pexpect isn't available at all natively on windows, fail | 10:56 |
*** peres has left #tp | 11:37 | |
*** Greywhind has joined #tp | 11:58 | |
tansell_laptop | morning Greywhind | 12:22 |
Greywhind | tansell_laptop: morning | 12:28 |
* tansell_laptop should probably be in bed | 12:29 | |
Greywhind | yeah, i was wondering why you were still awake :P | 12:35 |
tansell_laptop | Greywhind, need any help before I actually go to bed? | 13:13 |
Greywhind | tansell_laptop: i haven't started yet today - i'll ask you later | 13:14 |
tansell_laptop | okay | 13:16 |
tansell_laptop | see ya then | 13:16 |
Greywhind | cya | 13:16 |
*** greenlion has joined #tp | 13:52 | |
*** JLP_ has quit IRC | 14:38 | |
*** JLP has joined #tp | 14:38 | |
*** JLP_ has joined #tp | 14:43 | |
*** JLP has quit IRC | 14:43 | |
*** greenlion has quit IRC | 16:26 | |
*** alanp has quit IRC | 18:25 | |
*** zzorn has quit IRC | 18:25 | |
*** gau_veldt has quit IRC | 18:25 | |
*** alanp has joined #tp | 18:26 | |
*** zzorn has joined #tp | 18:26 | |
*** gau_veldt has joined #tp | 18:26 | |
*** peres has joined #tp | 20:52 | |
tansell_laptop | morning people | 21:27 |
Greywhind | tansell_laptop: morning | 21:27 |
tansell_laptop | Greywhind, any luck with the order stuff? | 21:29 |
Greywhind | tansell_laptop: mixed | 21:29 |
Greywhind | i have some things to ask you about | 21:29 |
Greywhind | hope you don't mind too much :-/ | 21:29 |
tansell_laptop | shoot | 21:32 |
Greywhind | let me paste this error | 21:33 |
Greywhind | tansell_laptop: http://pastebin.com/d4f8d6532 | 21:33 |
tpb | Title: pastebin - collaborative debugging tool (at pastebin.com) | 21:33 |
Greywhind | not sure what's causing this | 21:33 |
tansell_laptop | Greywhind, your not giving the order the correct arguments | 21:35 |
Greywhind | hm. here's what i'm giving it: | 21:35 |
Greywhind | [0, 11, -1, 2, 0, [], [[], []], [0, '']] | 21:35 |
Greywhind | this is a "Create ship" order | 21:36 |
tansell_laptop | Greywhind, have a look at the code in libtpproto-py/tp/netlib/objects/OrderDesc.py | 21:38 |
Greywhind | tansell_laptop: i've been looking at it... anything specific? | 21:38 |
tansell_laptop | oh | 21:40 |
tansell_laptop | actually it's unrelated | 21:40 |
tansell_laptop | Greywhind, can you try adding an order using tpclient-pywx with tp03 | 21:43 |
tansell_laptop | and then try downloading the universe with tp04and see what happens | 21:43 |
Greywhind | tansell_laptop: the same thing | 21:43 |
tansell_laptop | same thing in what way | 21:48 |
tansell_laptop | you get the error now when connecting? | 21:49 |
Greywhind | yes | 21:49 |
Greywhind | the error i got when adding using tp04 also would continue when connecting until the next turn started | 21:49 |
tansell_laptop | so the error is caused when trying to de-serialise the order frames | 21:51 |
tansell_laptop | hence the error in __process__ | 21:52 |
Greywhind | ok. any idea how to fix it? | 21:52 |
tansell_laptop | Greywhind, so the problem is that the unpacking is producing the wrong output expected by the __init__ method | 21:55 |
Greywhind | so i should change it to match the __init__ argument list? it seems quite different at the moment... | 21:56 |
tansell_laptop | for property, arg in zip(self.properties, args): | 21:57 |
tansell_laptop | print property, arg, self.__class__.__dict__[property.name] | 21:57 |
tansell_laptop | self.length += property.length(arg) | 21:57 |
tansell_laptop | setattr(self, property.name, arg) | 21:57 |
tansell_laptop | it's that bit which is not working as expected | 21:58 |
tansell_laptop | by the presence of a print statement - my guess is that I was working on it some time ago | 21:59 |
Greywhind | tansell_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_laptop | just trying to reproduce the problem here | 22:19 |
tansell_laptop | I get a different error | 22:20 |
tansell_laptop | File "libtpproto-py/tp/netlib/common.py", line 263, in _processFrame | 22: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_laptop | TypeError: __init__() takes exactly 17 arguments (9 given) | 22:21 |
Greywhind | <OrderParamList 0x9f76e6c ships> | 22:22 |
Greywhind | Name: ships | 22:22 |
Greywhind | Attr: [possibleselections([ISI]): [], selection([II]): []] | 22:22 |
Greywhind | <OrderParamString 0x9f76f6c name> | 22:22 |
Greywhind | Name: name | 22:22 |
Greywhind | Attr: [maxlength(I): 0, string(S): ''] | 22:22 |
Greywhind | <OrderParamString 0x9f76f6c name> | 22:22 |
Greywhind | Name: name | 22:22 |
Greywhind | Attr: Traceback (most recent call last): | 22:22 |
tansell_laptop | oh wait | 22:23 |
tansell_laptop | oh I found the error | 22: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 |
Greywhind | i was thinking it might be that earlier, actually | 22:28 |
Greywhind | tansell_laptop: yep, that seems to have fixed that problem | 22:32 |
Greywhind | now it's got a different error that i'm looking into | 22:32 |
Greywhind | tansell_laptop: have to go eat, be back soon | 22:34 |
tansell_laptop | okay | 22:35 |
CIA-46 | tansell libtpproto-py-tp04 * ra00eaab8d36e /tp/netlib/objects/OrderDesc.py: Small fix an small copy from ObjectDesc error. | 22:37 |
tansell_laptop | opps | 22:51 |
CIA-46 | mithro libtpproto-py-tp04 * ra27bfee5de2c /tp/netlib/objects/OrderDesc.py: Small fix an small copy from ObjectDesc error. | 22:59 |
Greywhind | tansell_laptop: ping? | 23:19 |
mithro | Greywhind: pongh | 23:20 |
Greywhind | mithro: 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 |
Greywhind | mithro: http://pastebin.com/d30704908 | 23:21 |
tpb | Title: pastebin - collaborative debugging tool (at pastebin.com) | 23:21 |
mithro | Greywhind: hrm | 23:23 |
cherez | mithro: http://codereview.mithis.com/2008/show | 23:28 |
tpb | Title: Issue 2008: Switched unit tests to use the unittest module. - Code Review (at codereview.mithis.com) | 23:28 |
mithro | cherez: LGTM - but I think the tests should be in a "tests" directory | 23:30 |
cherez | mithro: What would I have to do to make module importing work then? | 23:32 |
mithro | touch __init__.y | 23:32 |
mithro | s/y/py/ | 23:32 |
cherez | I mean if they're in a test directory then libtpproto2-py will no longer be on their path. | 23:33 |
mithro | cherez: sys.path.insert("..") | 23:34 |
cherez | Thought so. | 23:35 |
cherez | I guess that's the cleanest way. | 23:35 |
*** sladegen has quit IRC | 23:36 | |
*** sladegen has joined #tp | 23:36 | |
cherez | Well 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/!