/srv/irclogs.ubuntu.com/2009/10/24/#launchpad-dev.txt

al-maisanhello leonardr, are you around and could you please help me with a LP API change?00:33
wgrantIs this the SP.branches dict?00:34
wgrantI think that will be difficult or impossible; I don't know of any existing exported dicts that contain other entries.00:34
al-maisanwgrant: an attempt, yes.00:34
al-maisanhttp://pastebin.ubuntu.com/300148/00:34
al-maisanthis is the error I get during testing: http://pastebin.ubuntu.com/300150/00:35
wgrantThat's what I expected.00:36
al-maisanhrm00:37
wgrantlazr.restful doesn't treat dicts specially.00:37
wgrantNormally when it sees an enum in a field it will stringify it, and only then hand it off to be JSON-encoded.00:37
al-maisanwgrant: aha00:37
wgrantAnd I'm not sure if launchpadlib is set up to handle dict specifications in WADL.00:38
leonardral-maisan: i'm not really around but i can try to answer your question00:38
leonardrunless wgrant already has00:39
al-maisanleonardr: thanks -- please see http://pastebin.ubuntu.com/300148/00:39
leonardryes, i odn't think you'll have much luck exporting a dict00:39
leonardryou can publish a named operation that returns a dict00:39
wgrantThere are existing named ops that return dicts.00:39
wgrantRight.00:39
al-maisanOK00:39
wgrantBut I guess launchpadlib won't interpret any entry links inside them.00:39
leonardrno, you'll just have a dict of strings to strings00:40
al-maisanI'll go down the named operation route then00:40
wgrantSo I guess just export a named op that takes a pocket.00:40
leonardral-maisan: you should be able to write a serializer00:40
leonardrfor dicts00:40
al-maisanleonardr: aha00:40
wgrantleonardr: But won't that require client changes?00:40
leonardrlook in lazr.restful for other examples00:40
al-maisanOK00:40
leonardri don't think so. i think the client will see .foo as a dict00:41
leonardrthere might be problems changing the dict and sending it back00:41
wgrantI mean, lazr.restful will serialise it and stop crashing, but the client will still just see strings.00:41
al-maisanleonardr: changing the dict and sending it back is not an issue here..00:42
leonardrwgrant: yes, the client will still see strings, but it's better than creating a named operation that will have the same problem00:42
leonardral-maisan: look in lazr/restful/marshallers.py00:43
al-maisanleonardr: thanks for the pointer00:43
leonardri guess i should leave so people don't think i'm still around00:43
leonardrgood night00:43
al-maisanGood night00:43
wgrantI see a slight ordering issue here.00:45
al-maisanaha00:46
al-maisanwgrant: what do you mean?00:47
wgrantal-maisan: Well, US people vanishing while you are still here. I make it early morning for you.00:48
al-maisanwgrant: yeah ;)00:48
mzzso still prodding my bug 456764: after teaching lazr.restful about timedeltas my trivial patch (adding two exported() calls) runs, I see the attributes show up in the apidoc (after I forced a regen of the wadl file), but I don't see them through launchpadlib.00:48
mupBug #456764: please expose builder queue state through the api <api> <ppa> <Soyuz:Triaged> <https://launchpad.net/bugs/456764>00:48
* al-maisan falls off the chair :P00:48
mzzI'm not sure if this is because I need to patch more of launchpad, the objects I'm accessing through launchpadlib don't actually have that attribute, or I need to regen some other file than the wadl00:49
wgrantmzz: You've restarted your launchpadlib app?00:49
mzzmy launchpadlib app is a script, so yes00:49
wgrant(you need to re-create the Launchpad object)00:49
mzzlet me pastebin some stuff00:49
wgrantmzz: what if you browse the object in a browser? (add '/api/beta' to the front of the path to the object)00:49
mzzah, estimated_build_duration does show up there but is None00:52
mzzhuh, but buildduration shows up and isn't None00:52
wgrantThat's what I would expect.00:52
wgrantThey should be mutually exclusive.00:52
wgrantShouldn't they?00:52
* wgrant checks the code.00:53
mzznot what I meant00:53
mzzI mean my launchpadlib script isn't seeing record.buildduration on https://api.launchpad.dev/beta/ubuntu/+source/pmount/0.1-1/+build/19 but my browser does see it on https://api.launchpad.dev/api/beta/ubuntu/+source/pmount/0.1-1/+build/1900:53
mzzI think I'm missing a step or using a wrong url somewhere on the launchpadlib end then?00:54
wgrantYou removed and regenerated the *dev* WADL?00:54
wgrantThere are two different WADL documents.00:54
mzzah, let's see00:54
mzzI removed wadl-development.xml, not wadl-testrunner.xml. After doing that and restarting launchpad my attribute showed up in launchpad.dev/+apidoc, which I figured was a good sign00:55
mzzdo I need to do anything on the launchpadlib end?00:55
mzzI'm not running launchpadlib on the same host as launchpad00:56
wgrantwadl-development.xml should be the right one.00:56
wgrantHmmm.00:56
wgrantYou don't have a launchpadlib cache set up, do you?00:56
wgrantThe etag of the object will not have changed, so a cache could break things.00:56
mzzI do! that's probably it, killing...00:56
mzz(and logging back in... is there a switch on launchpad to turn off access control if you're in a hurry? :)00:57
wgrantNot without hacking launchpadlib and wadllib and lazr.restfulclient to use the browser webservice, and that makes leonardr angry.00:58
wgrantBut remember that you can save credentials.00:58
mzzthat did it! thanks00:58
wgrantExcellent.00:58
mzz(my script is using Launchpad.login_with(scriptname, service_root=...) to get a launchpad object, which apparently automatically caches not just credentials but also the wadl)00:59
mzz(I'm not even sure that's the right thing to call, it just looked like the easiest thing to call)00:59
wgrantI normally use Launchpad.get_token_and_login, but I am probably behind the times.01:00
mzzwell, that was pretty easy (after I'd found out I needed to remove the wadl by hand, but I guess that makes sense since detecting it's gone stale is painful)01:01
mzz(I mean the wadl on the server end)01:01
mzznow I just need to figure out how to test this stuff, and see if I can expose a bit of information about the queue too.01:02
=== lionel_ is now known as lionel
=== abentley1 is now known as abentley
=== abentley1 is now known as abentley
=== abentley1 is now known as abentley
=== henninge_ is now known as henninge

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!