/srv/irclogs.ubuntu.com/2010/07/09/#launchpad-dev.txt

lifelessgary-afk: ok, so I've submitted upstream, but upstream zope.app.publication looks to be in the middle of a refactoring00:56
lifelessso 2) - can do00:57
lifelessmtaylor: please comment on HUDSON-522301:11
lifelessbah echannel01:11
maxbHmm. I wonder if I should nudge people away from importing multiple separate projects within the namespace of a single Launchpad project, when reviewing vcs-imports.02:11
wgrantmaxb: That certainly sounds like a good idea.02:21
lifelessalso towards using one project for one codebase02:21
lifeless(see python-email6)02:21
lifelessthe most visible change with the new job for me: a whole new class of spam.02:23
wgrantlifeless: Does bugmail make up most of it?02:24
lifelessnone of it02:24
lifeless'enterprise architecture seminar' etc02:24
wgrantOh dear.02:25
lifelesstell me something02:26
lifelessif we *deleted* the entire build scoring stuff02:26
lifelessand just said 'distro first, ppa builds second, recipes third, rebuild-tests fourth'02:26
wgrantIt would work fine, yes.02:26
lifelessdo you think people would be happier or sadder ?02:26
lifelessok02:27
lifelessclearly I need to ask actual distro folk02:27
lifeless:P02:27
wgrantWell.02:27
wgrantIn the current model it would work fine.02:27
wgrantBut soon it won't.02:27
wgrantWhen we destroy the virt/non-virt distinction.02:27
lifelessI don't see why that would invalidate it02:27
lifelesstell me more!02:27
wgrantWe probably don't want the first autosync run to drown out PPA builds for days.02:27
wgrantNor do we want mass give-backs to do so.02:28
lifelesswhat if we said02:28
lifelessrather than strictly ordered02:28
lifeless10 distro to 2 ppa02:28
lifeless10 ppa to 2 recipes02:28
lifeless10 recipes to 2 rebuild tests02:28
lifelessor something like that02:29
wgrantPossibly.02:29
wgrantI also think we should look at existing scheduling theory and see how things are meant to be done. We can do better than a CPU scheduler, since we have job time estimations.02:29
lifelesswell02:30
lifelessright now I'd settle for 'real simple and understandable'02:30
wgrantWe need to draw out various use cases like those I've just outlined.02:31
wgrantAnd work out what will work.02:31
wgrantSince the current one probably doesn't work.02:31
wgrantAlthough it's not quite clear, given how crap buildd-manager is at the moment.02:31
lifelessI would like something with the following characteristics:02:32
lifeless - does not do O(anything) work after accepting a task02:32
lifeless - supports some form of 'make this thing happen sooner pretty please' (but does not need to support 'make thing happen later')02:33
wgrantWe definitely need a 'rush build' button, yes.02:35
lifelessmost of the queuing system out there are not terribly keen on lots-of-fiddle : they want simple reliable robust02:36
mtaylorlifeless: is there any good way to bribe a losa?03:54
lifelessyes03:54
mtaylorsweet! what is it?03:54
lifelesswrite a patch to launchpad that makes their lives easier.03:54
mtaylorgah03:54
mtaylorthat will take longer than just waiting03:54
lifelesswhat are you waiting for03:55
mtaylorsome renames03:55
lifelessdetails03:55
lifelessbranches or projects03:55
lifelesspeople or teams03:55
lifelessplanets or governments03:55
mtaylora project, and two teams03:55
mtaylorthey've all got approved questions03:55
lifelessdid you make a question03:55
mtaylorI did03:56
lifelesslinky linky03:56
mtaylorhttps://answers.edge.launchpad.net/launchpad-registry/+question/11685603:56
mtaylorhttps://answers.edge.launchpad.net/launchpad-registry/+question/11684903:56
mtaylorhttps://answers.edge.launchpad.net/launchpad-registry/+question/11684603:57
spmmtaylor: fwiw, cake works. as do any sweet baked substances.05:16
mtaylorspm: I'll mail cake right away05:18
mtaylorspm: does the cake need to taste good? or is it enough that it is simply cake?05:19
spmthe former is preferred, but the latter is, tbh, good enough05:19
spmmtaylor: blarg. first hurdle of sorts. swift-team "This team cannot be renamed because it is private." <== I believe via the DB will work, but there may be funkies. be. ware.05:26
mtaylorspm: lovely05:27
mtaylorspm: I like causing trouble!05:27
spm./forcenickchange mtaylor Trouble (note capital T)05:28
=== mtaylor is now known as Trouble
Troubleoh. this nick is registered...05:29
=== Trouble is now known as mtaylor
spmhahaha05:30
mtaylorspm: I found many things that don't like being done with private teams05:31
mtaylorspm: and private projects05:31
spmyeah. because they're the exception and not the rule; they tend to hit funky edge cases as it were05:31
spmmtaylor: so the first two should be done05:32
mtaylorspm: you are so getting a cake05:33
spmheh05:33
* mtaylor goes to look up cake import laws for australia05:33
spmthey're probably horrible. even carrying in mentos and the like, need to be declared.05:34
spmmtaylor: that's the lot, and answers updated accordingly. woo.05:37
* StevenK has declared food and medication every time he's re-entered Australia. Fun. Except not.05:37
spmI believe we now have to declare porn too. Tho I felt let down at not having that option to fill in, on the last trip.05:39
StevenKI've not yet seen that question05:39
mtaylorspm: sweet. thanks!05:40
mtaylorspm: oh - hey - you know those weird edge-cases you were mentioning05:40
mtaylorspm: check out https://edge.launchpad.net/swift05:40
mtaylorspm: all looks good except for "swift-files trunk series is the current focus of development"05:40
spmorsum05:40
mtaylorand yup. ... swift-files also mentioned on https://edge.launchpad.net/swift/trunk05:41
mtaylorme finds bugs! :)05:41
spmAhhh. Display Name: swift-files <== for the project05:41
mtaylorah. weird. ok cool!05:42
* mtaylor didn't find bugs after all05:42
spm1 form edit later, that looks better!05:42
mtaylorw00t!05:42
spmheh; I dunno; that I didn't see that as needing to be fixed when doing the change...05:43
mtaylorI think it was my sillyness that I had the display name be the same05:44
spm:-)05:44
mtaylorspm: you're going to shoot me... but I just noticed one more team/user thing, you know, because I'm stoopid05:45
mtaylorspm: should I file new question?05:45
spmnah is cool. which one?05:45
mtaylorhttps://edge.launchpad.net/~nova05:45
mtaylorspm: 0 karma user ... ~nova-team wants to be called ~nova in my boss's perfect world05:45
spmdarn bosses05:45
mtaylortell me about it05:46
mtaylorI would have preferred ~nova-devel and ~swift-devel myself05:46
spmhrm. that may still be in use by a wiki user05:48
spmnope. false alarm.05:49
spmhttps://edge.launchpad.net/~nova-es now05:50
spmmtaylor: and done05:51
mtaylorspm: I think you get two cakes now05:52
spm\o/05:52
mtaylorof course, aussie import quarentine means they'll likely be 6 months old by the time they get to you ... but you'll be sure they do not have rabies!05:52
spmhahaha05:53
* spm recalls an amusing little take with quarantine and ship ballast water forms filled/filed via email and clasing with the tax office dropping a million or so emails in our queues of a friday afternoon. For some reason ships are a tad unreasonable to slowing down because a mail funnel is overwhelmed.05:55
mtaylorhahahahaha06:02
lifelessspm: hey question06:57
spmyo06:57
lifelessspm: is it possible to get something that would let me read most/all of dev.launchpad.net on the plane to prague ?06:57
spmwget?06:58
* lifeless claps slowly06:58
lifelessor are you serious ?06:58
spmheh, was a serious suggestion. use it to recursively get the site down to 3-5 levels06:58
spmfwiw, I've used wget as a not as quick, yet dirty and working method to mirror a certain chunk of a Federal health & Ageing Departments website for DR purposes.06:59
lifelessoh yay naffed css on it07:00
spmwhich was .. fun. domino would have two 'names' that are different in it's namespace, yet identical on a mirror disk: blah/stuff/morestuff and blah/stuff being a file07:00
spm -k? from memory?07:00
lifeless-m ?07:01
lifelessnope, needs more, its root-parenting them07:01
spmpossibly. the option that says 'get all this stuff'07:01
spmextra stuff07:01
lifelessnah 404's07:02
lifeless-k is convert links07:02
spmah yes. you will want that then.07:03
lifelessexcept its failing07:03
lifelessoh yay also the follow to action=xxx is terrible07:03
spmlifeless: wget -T 10 -o $ROOTDIR/../mirror.log -nv -rkEp -l 6 -nH07:04
spmis an extract of the cmd used per that mentioned above07:04
spmistr the -l 6 is "levels, 6 deep", which is oft trial and errorish07:05
lifelessalso07:06
lifelesswth is that wiki on https?07:06
lifelessis public07:06
spmgood question. no idea. hadn't noticed that before.07:08
lifelessgrrrr07:13
adeuringgood morning07:30
=== almaisan-away is now known as al-maisan
=== adeuring1 is now known as adeuring
wgrantbigjools: Morning.09:45
bigjoolswgrant: hi09:59
wgrantbigjools: So... the PPA log parser should work now, although I'm not sure if the production configs have the limit set.10:01
bigjoolswgrant: nearly, I'll sort the rest today10:02
wgrantbigjools: Thanks!10:03
wgrantWhat happens if I create a PPA named 'meta'? Does the world explode?10:17
wgrant(since USER/meta seems to be used for metadata from other PPAs now)10:18
jmlwgrant, asking is for minions10:18
jmlwgrant, evil overlords do science!10:18
lifelesswgrant: you've done enough tests of these things in prod.10:21
lifelesswgrant: why start asking questions now ?10:21
wgrantlifeless: Huh?10:25
bigjoolswgrant: I expect it will be fine right up until the point someone deletes the package with the meta data10:27
lifelesswgrant: I mean, give it a shot.10:28
lifelesswgrant: play around like you normally do :)10:28
wgrantbigjools: Well, or the 'meta' PPA becomes private.10:28
bigjoolswgrant: it should co-exist fine with a PPA of that name10:28
wgrantlifeless: I don't play around and try to break production, except for U1, and that's because I have no other option :P10:28
=== noodles785 is now known as noodles775
jmlI wonder how hard it would be to change zope.testrunner so that it can do its own layer composition10:50
jmlso that instead of layer = LaunchpadFunctionalLayer, we could say layer = (DatabaseLayer, FunctionalLayer)10:54
jmlor what have you10:54
lifelessfairly straight forward10:56
lifelessalso should be fairly easy to make a testresources thing to process layers10:56
lifelessfwiw10:57
jmlI've thought about that10:57
jmla) I'm not 100% sure what that would mean10:57
jmlb) I don't know how to handle the "doesn't support tearDown" problem10:57
lifelessfix the root cause?10:57
lifelesswhat layers do we have that don't support tearDown ?10:57
lifeless[and how can we find that out]10:59
jmllifeless, http://paste.ubuntu.com/461047/10:59
lifelessnone of those sound like they should be hard to fix.10:59
lifeless*sound*10:59
jml(I told you all that subunit was worth it!)11:00
lifelessI don't quite get the context on your last ;)11:02
wgrantThe main issue is tearing down the CA, right?11:02
lifelesswgrant: there are 5 layers that don't support teardown11:02
lifelesswgrant: so there are, in theory, 5 issues, no ?11:02
wgrantNo.11:02
wgrantThose four are probably all CA-related.11:02
wgrantThe last, I'm not sure.11:02
wgrantRemember that the layers are composed.11:03
lifelessjml: ah, I see, you queried subunit for the answer11:03
jmlwgrant, CA?11:03
wgrantjml: Component Architecture.11:03
wgrantOur lovely, lovely global state.11:03
jmlright. specifically all of the registering done by zcml.11:04
wgrantRight.11:04
jmllifeless, how else would you find out? :)11:05
jmlundoing that is probably not all that hard.11:07
wgrantIt'd also be really nice if it didn't take lots of seconds to do in the first place.11:09
jmlwgrant, yeah, it would.11:18
jmlwgrant, did you know that when processing zcml, all of the registered utility classes are constructed?11:18
wgrantjml: ..... seriously?11:18
jmlwgrant, yeh.11:18
wgrantI... thought that getUtility would do that on the first call.11:18
jmlwgrant, it's caused the occasional weird import problem11:18
jmlwgrant, as did I11:19
lifelessso11:19
lifelessthis sounds simple11:19
lifelessdoes anyone feel like shaving it ?11:19
lifelessI promise a review if they do.11:19
jmlheh heh11:19
mwhudsoni knew that, because one of the utilities classes overrides $GNUPGHOME to something stupid in its constructor11:19
mwhudsonhttps://bugs.edge.launchpad.net/launchpad-foundations/+bug/22758611:20
jmllifeless, I'm already nested a couple deep. gimme a few minutes11:20
_mup_Bug #227586: setting up the component architecture overwrites $GNUPGHOME <tech-debt> <Launchpad Foundations:Triaged> <https://launchpad.net/bugs/227586>11:20
lifelesstest isolation, thats always a good idea.11:20
mwhudsonthe problems that causes aren't (just) in tests11:21
lifelesssure11:23
lifelessI have a nasty suspicion its my fault11:25
lifelessanyhow11:25
lifelessmoving right along...11:25
jmlhas db-stable been merged back into devel yet?11:25
jmlI guess I can find out myself11:25
wgrantYes.11:27
wgrantA couple of days ago.11:27
wgrantIt broke, but it's fixed now.11:27
jmlwgrant, thanks.11:27
jmlhttps://code.edge.launchpad.net/~jml/launchpad/remove-product-branch-portlet/+merge/2953211:29
wgrantjml: Oooh deleting sample data?11:32
jmlwgrant, yeah, just the branch sample data11:33
jmlwgrant, http://paste.ubuntu.com/461059/11:33
jmlI'll push my branch up too11:34
wgrantjml: ... dragons?11:34
jmlwgrant, as in "here be dragons"11:34
wgrantAh.11:35
jmlall of the pagetest/windmill stuff probably isn't intrinsically harder than the others11:35
jmlbut I'm afraid, and the list is long enough that I need to break it up in order to approach it anyway11:35
jmllifeless, could you please add an approved vote too? it makes ec2 land easier to use.11:36
lifelessgrr11:36
lifelessby which I mean11:36
lifelessyes of course11:36
bigjoolsAAAAAAAARRRRRRRRRRRRGGGGGGGGGGGGGGGGGG11:37
jmllifeless, thanks.11:38
jmlbigjools, you seem vexed.11:38
bigjoolsyes11:38
jmlwgrant, lp:~jml/launchpad/no-branch-sample-data if you want to follow along.11:39
wgrantjml: s/branch-//11:39
jmlwgrant, well, that's the goal :)11:40
jmlwgrant, but one step at a time.11:40
wgrantSoyuz will be... fun.11:40
wgrantAlthough Code has done well with the factory for Soyuz stuff.11:40
bigjoolswhere fun == pain hereto untold11:40
bigjoolsthe old soyuz tests suck beyond belief11:41
wgrantUm, yes.11:41
wgrantI beliiiieve they're the worst in the tree.11:41
bigjoolswhy does uncommenting the code here make this return an extra row in the results? http://pastebin.ubuntu.com/461061/11:43
bigjoolsextra_exprs is not even used in the query yet :/11:43
lifelessjml: https://bugs.edge.launchpad.net/launchpad-code/+bug/60353211:45
_mup_Bug #603532: make a simple 'approve' on a merge cast an approve vote <Launchpad Bazaar Integration:New> <https://launchpad.net/bugs/603532>11:45
jmllifeless, thanks.11:45
wgrantlifeless: Shouldn't that be handled by automatically setting the MP status when the right votes are present?11:45
jmlwgrant, ideally, it would work both ways11:46
lifelesswgrant: thats a different story, and also nice to have.11:46
lifelesswgrant: one could write a scanner to scan for mp's that have individual votes which add to 'approved' and do it per-project11:47
lifelessI'd like to make that efficient,.11:47
lifelesse.g. event driven yada yada.11:47
bigjoolsPsychic Octopus has spoken11:47
jmlbigjools, there's not enough information there for me to even make a guess.11:47
bigjoolsjml: well, now it works.... I'm at the stage where I don't care why it wasn't working11:48
jmlok.11:48
bigjoolssorry for the noise11:48
lifelessno worries11:52
jmlI just had an idea I should have had two years ago11:53
* jml enhappenates11:53
lifelessand whats that?11:58
jmlHush. I'm creating.12:00
deryckMorning, all.12:05
lifelesshai12:05
jmlderyck, hello12:06
jmllifeless, http://pastebin.ubuntu.com/461067/ -- that's what.12:08
wgrantjml: Randomness in tests: Australia says 'no'.12:08
jmlyeah, I was uncertain about that bit.12:08
jmlthe other option (which I've used directly in other tests) is teamowner12:09
wgrantAlthough I guess it could weed out issues... it could also make everything damn confusing.12:09
jmlerratic tests are bad.12:09
jmlwgrant, of course, the whole point is that the manner in which one gets an arbitrary team member is completed separated from one's need for it12:10
wgrantjml: Right.12:11
jml    # David Allouche is a member of the vcs-imports team.12:11
jml    login('david.allouche@canonical.com')12:11
jml^^^ that's the sort of code I want to replace.12:11
wgrantRight.12:11
wgrantCould just choose the first member or something like that.12:12
lifelessno12:12
wgrantOwner sounds dangerous.12:12
lifelesswhat does participation= in login do ?12:12
jmllifeless, I don't know.12:12
jmlthere's no docs on it either.12:12
lifelessheh12:12
jmllifeless, what question is "no" an answer to?12:12
lifelessso this looks good.12:12
lifelessbut it could do with tests12:13
lifelessno -> wgrants 'take first' - taking the first will bite, eventually.12:13
jmlwgrant, I don't know how deterministic choosing the first member is.12:13
lifelessit will also tend to be the owner.12:13
lifelessgiven that its currently rather difficult to make an owner outside the team, at least fo rusers of lp.12:13
jmllifeless, I couldn't find any tests for the existing stuff...12:13
lifelessjml: would you like a hand putting some smoke tests for this together ?12:14
jmlI'm also not sure about passing the celeb name as the interface.12:14
jmlbut if it's a choice between login_as(getUtility(ILaunchpadCelebrities).vcs_imports) and login_celebrity('vcs_imports'), I think I know what I'll choose.12:15
lifelessI'm not sure enough about celebs yet.12:15
jml(I wish Python had a separate literal for symbols)12:15
lifelessstring seems fine.12:15
jmlhmm.12:16
jmlnow I feel sad12:17
jmllifeless, yes.12:17
jmllifeless, all of this stuff boils down to setupInteraction12:18
jmlwhich lives in c.l.webapp.interaction12:18
lifelessjml: yes what ?12:18
jmland has tests here lib/canonical/launchpad/doc/webapp-authorization.txt12:18
jmllifeless, yes I would like a hand putting some smoke tests for this stuff togethre12:18
lifelessok12:18
jmllifeless, this yak shaving thing is exhausting.12:18
lifelessthe first times a doozy12:18
lifelessI'm logging tointo my lp dev environment12:19
jmlI need to make a list.12:19
lifelessoh wow12:21
lifelessso, your patch adds login_as, login_celebrity, login_team12:21
lifelesslogin_as needs two tests12:22
lifelessor perhaps four (check participation is passed down)12:22
lifelesscelebrity wants one happy path12:22
lifelessteam wants one, and get_arbitrary wants either a test or to be private.12:23
lifelessdoes that seem complete ?12:23
lifelessjml: can you push your patch, we can divide and conquer12:23
jmllifeless, sure, that seems good. let's make get_arbitrary_... private for now.12:24
jmlbzr+ssh://bazaar.launchpad.net/~jml/launchpad/more-login-helpers12:24
jmlhttp://paste.ubuntu.com/461073/12:24
jmllifeless, so now I've found get_current_principal, I think I'm actually ok with figuring out how to write these tests.12:26
lifelessok12:27
lifelessI like that you are yak shaving here.12:28
lifelessThe result should be really helpful to people!12:28
=== salgado-dr is now known as salgado
jmlwoot, down another level.12:58
lifeless\o/12:58
lifelesswant a review?12:58
jmlno, not yet, thanks. I'm one level deeper. I need to actually come back up before reviews make sense.13:00
lifelessoh13:00
lifelessI thought your stack was inverted based on your pastebin13:00
lifelessIts midnight; I shall sleep; then fly.13:01
jmluhh, no. the stack goes down.13:01
jmllifeless, sleep well.13:01
jmlhttps://code.edge.launchpad.net/~jml/launchpad/remove-get-current-principal/+merge/2954213:11
salgadojml, s/principle/principal  ;)13:19
jmlsalgado, where?13:19
salgadothe function's docstring13:19
jmlsalgado, thanks.13:19
=== Ursinha is now known as Ursinha-afk
=== gary-afk is now known as gary_poster
mwhudsonjml: wouldn't login_team work better by creating a person, adding them to the team and logging in as that person?14:37
=== Ursinha is now known as Guest32709
=== Ursinha-afk is now known as Ursinha-otm
=== Ursinha-otm is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
=== deryck is now known as deryck[lunch]
jmlmwhudson, good idea16:55
=== salgado is now known as salgado-lunch
=== deryck[lunch] is now known as deryck
jmlI've got a question. It might be a tough one.17:40
jmlwhat's the difference between being logged in as an anonymous user and not being logged in?17:40
bigjoolstest suite or API?17:45
jmlsince you asked, both :)17:49
jml(but test suite is my primary interest)17:49
mwhudsonjml: it has to do with whether the principal associated with the current interaction implements some interface i think18:18
jmlmwhudson, yeah, but what does that actually mean?18:18
jmlmwhudson, and why does it matter?18:18
mwhudsonjml: it means that some bits are different in ram somewhere18:18
mwhudsonjml: why does anything matter :)18:19
mwhudsonjml: you're not asking these questions in a way that's easy to answer :-)18:19
jmlwhy do we ever need to login(ANONYMOUS)?18:19
jmlwhy don't we model being "logged in as anonymous" as "not being logged in"18:19
mwhudsonoh sorry18:19
mwhudsoni misread18:19
mwhudsonif you're not logged in, there is no principal associated with the current interaction, or maybe there is no interaction18:20
jmlthere's no interaction, it seems.18:21
mwhudsonfor web-published stuff (like the api) logging in (possibly has anonymous) happens very very early18:21
jml*** AttributeError: AttributeError("'thread._local' object has no attribute 'interaction'",)18:21
mwhudsonin tests and scripts and so on ... err18:21
jmlI wonder what an interaction is.18:21
mwhudsonnot sure18:21
mwhudsonjml: it's a less specific word that request18:21
mwhudsonbut it basically fits the same hole in the puzzle18:22
jmlmwhudson, I thought participation was that.18:22
mwhudsonoh18:22
jmlI might be wrong.18:22
mwhudsonok, i don't remember what the difference between interaction and participation is then :-)18:22
jmlok.18:22
mwhudsoni think one might be a more specific version of the other though?18:22
jmlbenji, gary_poster: hello18:23
gary_posterjml hey18:23
mwhudsonoh no18:23
mwhudsonthe interaction can have a number of participations18:23
gary_posterinteractions have one or more partici...right18:23
jmlmwhudson, if I had to guess, I would say that a participation is the thing that bridges between a principal and an interaction18:23
gary_posterbut we never do that18:23
gary_posteryes18:23
jmlgary_poster, so what's an interaction?18:24
gary_posterjml, for our usage (and indeed standard usage) one request has one security interaction with the system (which is practically an instance of the security policy).  The interaction, for us, always has one participation, which is the user for that request.18:26
mwhudsongary_poster: but in principle answering a request could have multiple interactions?18:27
gary_poster(the multiple participation model exists to prevent privilege escalation in certain scenarios)18:27
jmlgary_poster, ok, that helps. some followup questions though...18:27
gary_postermwhudson in the abstract, yes18:27
jmlgary_poster, "practically"?18:27
gary_posterjml, um, replace with "in our implementation, and the standard implementations"?18:28
jmlgary_poster, thanks :)18:28
gary_posternp :-)18:28
jmlgary_poster, also, the participation is not the user for the request, at  least, not in our tests.18:28
* mwhudson runs18:28
jmlgary_poster, participation = LaunchpadTestRequest(18:28
jml            environ={'HTTP_HOST': allvhosts.configs['mainsite'].hostname,18:28
jml                     'SERVER_URL': allvhosts.configs['mainsite'].rooturl})18:28
gary_posteryes, the participation is a request in the implementation18:29
gary_posterfrom the security system's perspective, though, the request only has to implement a single interface18:29
jmlwhich is?18:29
gary_posterthat interface describes how to get the user from the participation18:29
gary_postereh, I'll look18:29
gary_posterit's in zope.security someplace18:30
jmlfrom zope.security.interfaces import IParticipation ?18:30
gary_postermust be it, yes18:30
jmlok. pieces are drifting into place.18:30
gary_posterand if you look at that interface, it only defines two bits18:31
gary_postera (back) reference to the interaction18:31
gary_posterand a principal18:31
jmlgary_poster, so the reason that we get errors like "'thread._local' object has no attribute 'interaction'" when we try to use getUtility without first "logging in" is...18:31
gary_posteran interaction has not been started18:31
=== salgado-lunch is now known as salgado
gary_posteras defined in zope.security.management I think; looking18:31
gary_posteryeah, newInteraction18:32
gary_poster(or perhaps something is being called with a security wrapper after the interaction has been ended)18:32
gary_posterin any case, there is no active security interaction18:32
jmlgary_poster, ok, thanks.18:33
gary_postersure18:33
jmlgary_poster, I think as a result of this conversation I am going to maybe write a longer module docstring in c.l.webapp.interaction18:33
gary_posterI'm going to run about now for travel prep and the like...18:33
gary_posterok I like improved docs18:33
gary_posterI'll look at that module for the heck of it...18:34
gary_posteryeah, doesn't say much18:34
gary_posterjml, anything else I can help with, or may I run?18:35
jmlgary_poster, nothing for now18:35
gary_posterok cool18:35
jmlgary_poster, I'll shelve my next request :)18:35
gary_poster...18:35
gary_posterok :-)18:35
gary_postersee you in Prague!18:35
=== gary_poster is now known as gary-afk
=== al-maisan is now known as almaisan-away
=== Ursinha-afk is now known as Ursinha
lifelessmorning19:50
=== Ursinha is now known as Ursinha-afk
lifelessgary-afk: when you get back, I've a small question about zcml and utility parameters / configuration of event driven things.20:03
gary-afkmorning lifeless.  ok, cool, what's up?  (fwiw, I'm mostly gone--travel prep, with occasional look-backs for pings like this)20:04
gary-afkneed to go in prob 520:04
lifelessSure20:04
lifelessso I have some itch scratching on the profile module thing20:05
lifelessI have two functions called at start and end of requests20:05
lifelessI want to decouple them from the oops system and the global config, for testing and reuse. So I plan to make a single object and have the functions just trampoline into it.20:06
lifelessA Utility would match our current idiom, or perhaps just a module private.20:06
lifelessAnyhow, I'd like to give the instance of this class a parameter that it can call to name-and-write-out a profile20:06
lifelessbecause that code isn't related *doing* profiling, its related to *how we glue it in*20:07
lifelessI could subclass and our zcml then specifies the subclass, but thats all kinds of wrong. So I was wondering if there is either a way to provide parameters in zcml configs, or a way to run some python code at the same point in startup that zcml parsing occurs.20:08
lifelessfin20:08
gary-afkreading and processing...20:08
lifelessoh, one other small thing is that I'd then like to turn this into a totally external module - put it in the zope project or some such; I need to talk to flacoste about the logistics there; for now I'll probably keep it in-tree but give it its own dir and setup.py and build an egg for buildout from that.20:11
gary-afkno there's not; however, that's mostly because you shouldn't need to.  (which isn't to say I haven't wanted to practically, but anyway...) you can have, for instance, a class that provides the functionality, and then have zcml register an instance of the class, set up in LP code, that actually has specified the location.20:11
gary-afkA similar pattern, more for adapters, is to register in zcml a function as a factory20:11
gary-afkand the function specifies custom local bits20:12
gary-afkcalling out to another function or class for the more general adapter bits20:12
lifelessthe former looks a better fit to me; are there examples of that ?20:12
lifeless'register an instance setup by LP code'20:12
gary-afkwell, there is in Zope code.  It's pretty easy; lemme get details for you20:13
lifelesssweet, thanks20:13
gary-afklifeless: btw, handy: http://apidoc.zope.org/++apidoc++/ .  zcml section is where I look bits up in sometimes.  salgado is making the other bits available for LP devs customized to LP (like browsing LP interfaces and classes with crossreferences and stuff)20:14
lifelessthanks20:15
gary-afklifeless: <utility component="my.package.my.module.instance" provides="the.interface" />20:16
lifelessis using a Utility as a singleton a common pattern ?20:16
gary-afkdefinitely20:16
lifelessok20:16
lifelessand where would one put the lp code to setup 'instance'20:16
gary-afkthe zcml: can be simplified20:16
lifeless(surely not module inline)20:16
gary-afkdepends on what you are doing20:16
gary-afkoh, yes.20:16
gary-afkif you want a factory then you can do a factory instead20:16
gary-afkbut yeah, looking for something in module20:17
lifelessok; so let me run this integrated thing past you once:20:17
gary-afk<utility factory="foo.factory" provides=""20:17
gary-afk />20:17
gary-afkI have to run now!20:17
gary-afksorry20:17
lifelessconfigured instance is a utility20:17
lifelessevent hooks use utility20:17
lifelessimplementation out of tree20:17
lifelessconfiguration in tree.20:17
lifelessgary-afk: thanks, you've been helpful.20:17
gary-afk+1, yes that's the intent20:17
lifelessI'll have some fine tuning to do in Prague20:18
lifelessthanks!20:18
=== salgado is now known as salgado-afk

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