/srv/irclogs.ubuntu.com/2018/07/02/#launchpad.txt

=== Ionic is now known as Guest28488
=== ePierre__ is now known as ePierre
=== Guest28488 is now known as Ionic
handsome_fengHi, could someone here handle my request? Thanks! https://answers.launchpad.net/launchpad/+question/67054003:13
wgranthandsome_feng: Done.03:48
handsome_fengwgrant: Thank you very much!03:49
=== mIk3_09 is now known as mIk3_08
Laneywhat's the right invocation to change the owner of a git_repository from the API?14:44
LaneyI tried setting 'owner' and calling lp_save() on all the things but it didn't get updated14:45
cjwatsonThat ought to work.  Do you have a transcript?14:47
LaneyI'll run it again.14:48
cjwatsonYou should just need to call lp_save on the repository14:48
Laneyhttps://paste.ubuntu.com/p/m4ZGPBFjNC/14:49
cjwatsongits[0].lp_refresh()14:51
cjwatsonWait, what is gits in this case?14:52
cjwatsonCan I have a more complete transcript? :P14:52
cjwatsonI bet gits is a collection14:52
LaneyIt is, it's from getBranches() or something14:52
cjwatsonListify it first, or assign gits[0] to a variable14:53
cjwatsonOtherwise the __getitem__ inside gits[0] does a separate fetch from the webservice each time and so forgets your changes14:53
cjwatsonBit of a gotcha with collections14:53
LaneyAhh, this is a peculiarity with LP programming that I'm not aware of14:53
LaneyThat works, thanks!14:53
cjwatsonnp, it's not at all obvious when you haven't encountered it before14:54
LaneyOh, but I've got to fix the subscribers too14:54
cjwatsonYou can call methods without this trick - it's only property assignments that are problematic14:55
cjwatsonThough it may be a good idea anyway to avoid excessive webservice calls14:55
cjwatsonhttps://help.launchpad.net/API/launchpadlib#Three_things_to_make_your_client_faster has a little trick to see what webservice calls are happening14:56
LaneyThat'll be useful, cheers15:00
LaneyGood semantic use of HTTP error codes (409 in this case)15:01
cjwatsonYeah, the LP webservice is sort of what you get if you go all-out on REST design and kinda forget the performance bit15:02

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