IRC log of #zope3-dev for Monday, 2007-08-13

yielderi have a folder with 10000 objects. Any hints on how to effectively get a list of the 10 newest objects in this folder?00:06
yielderhmm, I guess i could index them and query a catalog instead of doing stuff with myfolder.items()..00:09
*** tarek_ has quit IRC00:20
*** srichter has quit IRC00:37
*** edgordon_ has joined #zope3-dev00:37
*** b52laptop has quit IRC00:40
*** b52laptop has joined #zope3-dev00:40
*** jsadjohnson has quit IRC00:52
*** norro has quit IRC00:54
ccombyielder, you could maintain a utility which remembers the 10 newest object, and which is updated by a subscriber when an object is added.  → no query, no list parsing01:04
*** natea|away has joined #zope3-dev01:04
yielderccomb: ah, cool :)01:07
*** natea has quit IRC01:11
*** rocky|away has quit IRC01:14
*** timte has quit IRC01:18
*** harobed has quit IRC01:18
*** Ariel_Calzada has quit IRC01:22
*** b0b0tiken has joined #zope3-dev01:23
*** b0b0tiken has quit IRC01:30
*** srichter has joined #zope3-dev01:30
*** dunny has joined #zope3-dev01:35
*** greenman_ has joined #zope3-dev02:08
*** redir has joined #zope3-dev02:13
*** redir has quit IRC02:15
*** povbot has joined #zope3-dev02:21
*** greenman has quit IRC02:21
*** Jell-O-Fishi has joined #zope3-dev02:28
*** greenman has joined #zope3-dev02:31
*** zez_zez has joined #zope3-dev02:35
*** redir has joined #zope3-dev02:38
*** redir has quit IRC02:43
*** greenman_ has quit IRC02:47
*** greenman_ has joined #zope3-dev03:04
*** greenman has quit IRC03:12
*** Ariel_Calzada has joined #zope3-dev03:13
*** b52laptop has quit IRC03:31
*** sm has quit IRC03:40
*** natea|away_ has joined #zope3-dev03:41
*** natea|away has quit IRC03:48
*** jsadjohnson has joined #zope3-dev04:05
*** greenman has joined #zope3-dev04:06
*** zez has joined #zope3-dev04:20
*** natea|away has joined #zope3-dev04:22
*** greenman_ has quit IRC04:23
*** zez has quit IRC04:25
*** redir has joined #zope3-dev04:28
*** natea|away_ has quit IRC04:31
*** zez_zez has quit IRC04:33
*** redir has quit IRC04:49
*** tjs has joined #zope3-dev04:53
tjsis this the complaints dept. ? :/04:53
tjswhy does ILocation use __name__04:54
tjswhen __name__ on a class actually means something else04:54
*** run|home has joined #zope3-dev05:20
*** ChanServ sets mode: +o srichter05:27
*** kleist has joined #zope3-dev05:34
*** jsadjohnson has quit IRC05:38
*** natea|away_ has joined #zope3-dev05:39
*** natea|away has quit IRC05:46
*** natea|away has joined #zope3-dev05:58
*** natea|away_ has quit IRC06:06
*** redir has joined #zope3-dev06:10
*** philiKON_ has joined #zope3-dev06:26
*** tjs has left #zope3-dev06:34
*** philiKON has quit IRC06:42
*** nitromaster has quit IRC07:01
*** redir has quit IRC07:14
*** natea|away_ has joined #zope3-dev07:36
*** salfield has quit IRC07:40
*** natea|away has quit IRC07:42
*** pcardune has quit IRC07:52
*** Jell-O-Fishi has quit IRC07:56
*** chacha_chaudhry has joined #zope3-dev08:10
*** natea|away has joined #zope3-dev08:13
*** redir has joined #zope3-dev08:18
*** natea|away_ has quit IRC08:20
*** cursor has joined #zope3-dev08:36
*** zagy has joined #zope3-dev08:38
*** sorin_ has joined #zope3-dev08:38
*** sorin_ is now known as sorindregan08:39
*** redir has quit IRC08:45
*** jodok has quit IRC08:46
*** d2m has joined #zope3-dev08:50
*** yvl has joined #zope3-dev09:11
*** dunny has quit IRC09:22
*** zagy has quit IRC09:22
*** zagy has joined #zope3-dev09:22
*** markusleist has joined #zope3-dev09:24
*** pbugni has quit IRC09:33
*** romanofski has joined #zope3-dev09:40
romanofskimoin :)09:50
*** tjs has joined #zope3-dev10:00
tjshaving an issue with some tests, I create a mockIntIds object and register it with provideUtility, then stuff in some testing objects10:00
tjsthen use unprovideUtility in the tearDown10:01
tjsbut it seems like the first one I setup gets used for all the tests10:01
*** regebro has joined #zope3-dev10:18
*** dobee_ has joined #zope3-dev10:19
*** timte has joined #zope3-dev10:29
*** naro has joined #zope3-dev10:33
*** tarek has joined #zope3-dev11:00
*** jodok has joined #zope3-dev11:09
*** cursor_ has joined #zope3-dev11:19
*** junkafarian has joined #zope3-dev11:20
*** cursor has quit IRC11:21
*** jfroche has quit IRC11:24
*** jfroche has joined #zope3-dev11:27
*** ignas has joined #zope3-dev11:49
*** greenman has quit IRC11:49
*** ferrafox has joined #zope3-dev11:50
*** baijum has joined #zope3-dev11:53
*** cursor has joined #zope3-dev11:55
*** cursor_ has quit IRC11:55
*** richardkan has joined #zope3-dev12:07
*** baijum has quit IRC12:09
*** baijum has joined #zope3-dev12:09
*** tarek has quit IRC12:10
*** tarek has joined #zope3-dev12:26
*** b52laptop has joined #zope3-dev12:36
*** MJ has joined #zope3-dev12:38
*** goschtl has joined #zope3-dev12:56
goschtlHi is it possible to integrate this library in z3?
*** deo has joined #zope3-dev12:57
*** greenman has joined #zope3-dev13:00
*** jodok has quit IRC13:02
*** jodok has joined #zope3-dev13:07
*** mgedmin has joined #zope3-dev13:12
*** harobed has joined #zope3-dev14:03
*** Newfie2007 has joined #zope3-dev14:22
*** harobed has quit IRC14:33
*** ferrafox_ has joined #zope3-dev14:40
*** stub has joined #zope3-dev14:42
*** ferrafox has quit IRC14:42
*** projekt01 has joined #zope3-dev14:48
*** chacha_chaudhry has quit IRC14:52
*** ferrafox_ is now known as ferrafox15:03
*** rocky has joined #zope3-dev15:03
*** chacha_chaudhry has joined #zope3-dev15:07
*** chacha_chaudhry has quit IRC15:12
*** greenman has quit IRC15:17
*** ghendi has joined #zope3-dev15:19
*** dobee_ has quit IRC15:25
*** stub has quit IRC15:26
*** dobee_ has joined #zope3-dev15:28
*** MJ has quit IRC15:29
*** MJ has joined #zope3-dev15:30
*** MJ is now known as MJ|lunch15:31
*** dobee_ has left #zope3-dev15:36
*** dobee_ has joined #zope3-dev15:36
*** jsadjohnson has joined #zope3-dev15:57
*** jukart has joined #zope3-dev15:58
*** dobee_ has quit IRC15:58
*** niemeyer has joined #zope3-dev15:59
*** dobee has joined #zope3-dev16:00
*** cursor has quit IRC16:00
*** benji_ has joined #zope3-dev16:03
*** Ariel_Calzada has quit IRC16:04
*** redir has joined #zope3-dev16:08
*** jodok has quit IRC16:08
d2mto add in zcml an interface to a class (like implements(Interface) does in source) i really need to have installed ?16:08
*** MJ|lunch is now known as MJ16:10
*** MJ has quit IRC16:10
*** J1m has joined #zope3-dev16:11
*** jodok has joined #zope3-dev16:11
*** tarek has quit IRC16:15
*** afd_ has joined #zope3-dev16:21
*** rcrafton has joined #zope3-dev16:23
*** tarek has joined #zope3-dev16:29
*** pcardune has joined #zope3-dev16:32
*** natea|away_ has joined #zope3-dev16:33
*** yvl has quit IRC16:37
*** baijum has quit IRC16:39
*** MJ has joined #zope3-dev16:45
*** natea|away has quit IRC16:48
*** natea|away has joined #zope3-dev16:52
*** jsadjohnson has quit IRC17:01
*** natea|away_ has quit IRC17:07
*** ignas_ has joined #zope3-dev17:08
*** ignas__ has joined #zope3-dev17:09
*** ignas has quit IRC17:10
*** natea|away has quit IRC17:15
*** ignas__ is now known as ignas17:15
*** Aiste has joined #zope3-dev17:20
*** ignas_ has quit IRC17:34
*** sorindregan has quit IRC17:38
*** edgordon_ has quit IRC17:41
*** ignas has quit IRC18:07
*** edgordon has joined #zope3-dev18:07
*** natea|away has joined #zope3-dev18:13
*** natea|away has quit IRC18:14
*** jhauser has joined #zope3-dev18:16
*** dobee has quit IRC18:18
*** netshade has joined #zope3-dev18:21
*** pcardune has quit IRC18:30
*** norro has joined #zope3-dev18:34
*** goschtl has quit IRC18:36
*** ghendi has quit IRC18:37
*** alecm has joined #zope3-dev18:46
*** dobee has joined #zope3-dev18:49
*** timte has quit IRC18:56
*** whit has joined #zope3-dev18:57
*** netshade has quit IRC19:01
*** mgedmin has quit IRC19:02
*** jukart has quit IRC19:05
*** mgedmin has joined #zope3-dev19:09
*** nerdalert has joined #zope3-dev19:15
*** cursor has joined #zope3-dev19:16
*** gumpa has joined #zope3-dev19:18
*** ksmith99 has joined #zope3-dev19:20
*** MJ is now known as MJ|dinner19:21
*** projekt01 has quit IRC19:22
*** lisppaste6 has quit IRC19:34
*** jukart has joined #zope3-dev19:36
*** dobee has quit IRC19:43
*** jodok has quit IRC19:43
wiggyhow do you register a subscription adapter in zcml?19:53
*** sm has joined #zope3-dev19:53
*** pcardune has joined #zope3-dev19:53
*** jukart has quit IRC19:54
*** alecm_ has joined #zope3-dev19:56
*** ferrafox has quit IRC19:57
*** pbugni has joined #zope3-dev19:57
*** alecm has quit IRC20:00
*** RaFromBRC has joined #zope3-dev20:08
*** romanofski has quit IRC20:16
*** whit has quit IRC20:18
*** jodok has joined #zope3-dev20:19
*** whit has joined #zope3-dev20:20
*** dobee has joined #zope3-dev20:21
*** richardkan has quit IRC20:22
*** junkafarian has quit IRC20:23
*** jukart has joined #zope3-dev20:23
*** MJ|dinner is now known as MJ20:23
MJwiggy: see the WDL configure.zcml?20:24
*** kleist has quit IRC20:26
wiggyMJ: should work from what I can see20:27
wiggybut it doesn't20:27
wiggyif I call provideSubscriptionAdapter(CommunityPurge) by hand it works fine though20:28
wiggyso I know the actual adapter is correct20:28
MJa subscriber get's notified by being called20:28
MJso what are you trying to achieve with an adapter instead?20:29
MJ<subscriber factory=""> registers a factory; it'll be called to generate the actual subscriber.20:29
*** pcardune has quit IRC20:29
wiggyI know, that's perfectly fine for me20:29
wiggythe zope.component README has a similar example20:29
MJso how doesn't it work?20:30
MJwhat goes wrong?20:30
wiggyzope.component.subscibres([object], IUrlPurge) returns []20:30
wiggyminus several typos20:30
mgedminhave you checked that your zcml is being processed (by, e.g., introducing syntax errors in it)?20:31
MJfirst of all, CommunityPurge is not a factory20:31
wiggymgedmin: yes20:31
MJso use the handler="" directive instead20:32
mgedmina class is a factory20:32
wiggyin fact if I use handler="" zope explodes when parsing the zcml20:32
MJmgedmin: so where is the __call__ on that class then to handle the event?20:32
MJa subscriber is a callable that will handle the event20:33
wiggyMJ: the type has a __call__ which creates the instance20:33
MJI am not sure what this should do.20:33
MJthere is no IBaseContent event either..20:33
wiggywhy is that relevant20:34
MJso, on a IBaseContent event, you create a CommunityPurge instance20:34
wiggyI'm explicitly calling component.subscribers by hand20:34
wiggythere are no events at all here20:34
wiggyevents happen to use the same subscription adapters20:34
MJyou are using the event/subscription machinery for something else.20:34
MJwhat's the usecase you are trying to solve then?20:34
wiggyI'm not using the event machinery at all20:34
wiggyI'm using subscription adapters20:35
MJthis is beginning to dawn on me :)20:35
*** whit has quit IRC20:35
wiggyextending the relative and absolute URLs for PURGE expressions generated by CacheSetup is the use case20:35
mgedmincould this be a permission problem of some kind?20:35
wiggyno, it's a zcml thing20:35
* mgedmin has no idea and is just scrapping the bottom of the debugging idea barrel20:35
wiggycalling component.provideSubscriptionAdapter(factory=CommunityPurge) works great20:36
wiggywhich tells me that the factory itself works fine20:36
wiggyit just isn't registered properly20:36
mgedminI just looked at the implementation of the zcml 'subscriber' directive, and the implementation of provideSubscriptionAdapter, and I see no differences20:36
mgedminboth call registerSubscriptionAdapter on the global registry20:36
mgedminmaybe you have two different interfaces named IBaseContent?20:36
mgedminwhat if you omitted the for="" from the <subscriber> ?20:37
wiggystill doesn't work (tried that before I added it)20:37
MJwiggy: I strongly suspect that <subscriber> is not what you are looking for..20:37
wiggyMJ: then tell me what it is I'm looking for :)20:37
wiggyMJ: see
MJmy suspicion appears to be wrong20:40
MJprovideSubscriptionAdapter calls .subscribe, as does the subscriber directive handler.20:40
* mgedmin blames the aura of zope 220:40
* MJ forgot about subscription adapters20:41
wiggythey're not used very often, but they are really useful20:41
wiggywhere's the kind for <subscriber> ?20:42
*** whit has joined #zope3-dev20:43
wiggyah, there20:43
*** pcardune has joined #zope3-dev20:44
MJwiggy: did you try and drop the for argument?20:44
MJyou don't provide it when calling provideSubscriptionAdapter20:44
MJand what happens?20:44
wiggydoesn't work20:44
MJleave out for, but do include provides20:45
MJskip the last sentence..20:46
*** MacYET has joined #zope3-dev20:46
*** jsadjohnson has joined #zope3-dev20:46
MJokay, from what I can make out of the directive handler (, just stating20:47
wiggyputting a pdb in subscriber() there shows that provides=None20:48
MJ<subscriber handler=".purge.CommunityPurge"> should Just Work.20:48
MJput a pdb in provideSubscriptionAdapter and see what arguments get passed when it is called when the directive is processed.20:49
MJit's all a bit indirect.20:49
*** deo has quit IRC20:49
wiggyfor=None for both handler and factory20:49
wiggysorry, provides=None20:49
MJhandler == factory, as far as the directive is concerned..20:50
wiggyseems it doesn't have code to figure out provides, unlike other zcml directives20:50
wiggyat least the version in zope 2.9 doesn't20:51
MJno, it counts on provideSubcriptionAdapter to figure that out.20:51
MJwhen you call provideSubscriptionAdapter directly, you didn't specify provides either..20:51
wiggyhowever, specifying for= in the zcml fixes things20:52
MJso put a pdb.set_trace in provideSubscriptionAdapter20:52
MJwithout for= should be fine..20:53
wiggywhere is that?20:53
wiggyoh, there20:53
MJthe directive doesn't call that directly...20:53
* wiggy going to punt on this for now20:54
wiggydeadlines and so :("20:54
MJit calls .purge.CommunityPurge20:54
MJerm, wrong copy buffer20:54
wiggyand zope 2.9 is ancient enough that it doesn't warrant too much work20:54
MJit calls getGlobalSiteManager().subscribe20:54
*** b52laptop has quit IRC20:55
MJyou need to compare calls20:55
MJsee what gets passed when you call provideSubscriptionAdapter20:56
MJand what gets passed when using the subscriber directive.20:56
MJand make them match up ;)20:57
MJwiggy: bingo20:58
MJwiggy: you *need* to specify provides when using <subscriber>20:58
MacYETdoes any know what """ /opt/zope/2.10.4/lib/python/zope/configuration/ UserWarning: You did not specify an i18n translation domain for the 'title' field in /Users/ajung_data/sandboxes/plone3.0/Products/SmartPrintNG/configure.zcml""" means?20:58
wiggyis there a rationale for that?20:58
wiggyMacYET: add i18n_domain="plone" or so to configure.zcml's <configure> root element20:58
wiggyMacYET: the translation machinery uses that to translate the profile title & description20:59
MJprovideSubscriptionAdapter figures that out for you20:59
MJbut the subscriber directive handler does not.20:59
MJbecause the subscriber directive is aimed at event subscribers20:59
wiggyMJ: that feels a bit weird20:59
MJwiggy: that's because you are using the subscriber directive for a different use-case, I'd say.21:00
*** deo has joined #zope3-dev21:01
MJwiggy: so, replace the for="" line with a provides="IPurgeUrls" line..21:01
MJthe for="" part the handler will figure out itself.21:01
*** dobee has quit IRC21:01
*** rlo has joined #zope3-dev21:02
MJprovides="IBaseContent" actually21:02
wiggyMacYET: since it is i18n_domain instead of i18n:domain you don't need to define xmlns:i18n21:03
MacYET+i know :)21:03
MacYETdon#t read my checkins :)21:04
philiKON_MacYET kann nix21:04
MJwiggy: yes, on rereading the source, I am convinced that <subscriber provides="Products.Archetypes.interfaces.IBaseContent" handler=".purge.CommunityPurge" /> will work.21:04
MacYETphiliKON_: *slap*21:04
MJwiggy: which also clears my confusion about your use of that interface in the 'for' attribute.21:04
* philiKON_ rubs cheek21:04
wiggyMJ: as I said 13 minutes ago that works fine indeed :)21:06
MJwiggy: and now you know why too! :)21:06
MJfor lists implemented interfaces of the adapter21:06
MJprovides lists adapted interfaces..21:06
MJOMG Hedningarna is cool music21:09
* MJ loves living in Scandinavia :)21:09
MJsorry, resume your regularly scheduled tech subjects..21:09
*** naro has quit IRC21:10
*** jukart has quit IRC21:11
*** naro has joined #zope3-dev21:13
*** redir has quit IRC21:17
*** naro has left #zope3-dev21:19
*** fcorrea has joined #zope3-dev21:19
*** deo has quit IRC21:25
*** pbugni has quit IRC21:27
*** deo has joined #zope3-dev21:28
*** mgedmin has quit IRC21:36
*** edgordon has quit IRC21:37
*** oferw has joined #zope3-dev21:39
*** whit has quit IRC21:49
*** rlo has quit IRC21:52
*** Newfie2007 has quit IRC21:53
*** edgordon has joined #zope3-dev21:53
*** redir has joined #zope3-dev21:56
*** jhauser has quit IRC21:58
*** cursor has quit IRC22:00
*** oferw has quit IRC22:02
*** whit has joined #zope3-dev22:04
*** rlo has joined #zope3-dev22:05
*** greenman has joined #zope3-dev22:06
*** redir has quit IRC22:14
*** whit has quit IRC22:16
*** danfairs has joined #zope3-dev22:25
danfairsHi - I'm having a problem installing grok in a workingenv using python 2.4.4. Output:
danfairsIt's a fresh workingenv (actually the first time I've used it). Aside from that, I'm following the instructions on
danfairsAny hints?22:29
*** netshade has joined #zope3-dev22:29
*** marianom has joined #zope3-dev22:31
*** MacYET has left #zope3-dev22:31
*** ktwilight has joined #zope3-dev22:32
ccombHi,  I want the user to be able to choose among a list of named adapters.22:39
ccombhow can I retrieve the list of names for these adapters ?22:39
ccombI don't want to retrieve the actual adaters with getAdapters , but just their names22:40
ccombShould I register them as factory utilities and get the list with getUtilitiesFor ?22:41
ccombIs there a way to register an adapter once so that it appears both as an adapter and as an utility ?22:41
danfairsaha, there's a #grok, I shall ask there...22:42
ccombreally, grok?22:42
benji_ccomb: I like the getUtilitiesFor approach22:42
*** benji_ is now known as benji22:43
ccombbenji: so I must dual-register?22:43
benjiheh; that doesn't work in IRC so well22:43
benjiccomb: if it's registered as a utility, why would it need to be an adapter too?22:44
ccombgood question22:44
ccombYou're right, I will use them just as utilities, anyway I'm unable to use the syntax shortcut IAdapter(obj), because I must explicitly choose one22:45
danfairsccomb: yes, grok ;) Been meaning to try it for ages...22:46
ccombAnd I'm storing the setting in an attribute22:46
ccombI have so many things to try,   grok,  z3c.form, hurry.workflow, etc...22:47
ccombI would like each days to last 48h22:47
*** ktwilight_ has quit IRC22:47
*** jsadjohnson has quit IRC22:49
*** d2m has quit IRC22:50
benjiccomb: sleep is the enemy ;)22:51
ccomblack of sleep is even worse22:52
ccombbecause it make bugs spawn in my brain22:52
*** pbugni has joined #zope3-dev22:59
*** jfroche has quit IRC23:02
*** jsadjohnson has joined #zope3-dev23:11
*** MJ|nickcollision has joined #zope3-dev23:15
*** MJ has quit IRC23:16
*** MJ|nickcollision is now known as MJ23:16
*** MJ has quit IRC23:18
*** junkafarian has joined #zope3-dev23:21
junkafarianhey can any one tell me why this isnt working....23:22
junkafarianive got a master template with:23:23
junkafarian<html xmlns:metal="" metal:define-macro="letscreateart">23:23
junkafarianthen another template in the same folder with:23:23
junkafarian<html xmlns:metal="" metal:use-macro="">23:23
junkafarians/ sorry that last one was meant to include /letscreateart23:25
junkafarianthe error its giving is:23:27
junkafarianPTRuntimeError: ['Compilation failed', 'zope.tal.taldefs.TALError: Invalid variable name "letscreateart" in expression u\'\', at line 1, column 1']23:27 ?23:33
junkafarianwiggy: ^23:34
wiggywhy the .pt ?23:35
junkafarianits the name of the template file23:35
*** rlo has quit IRC23:35
junkafarianfelt it was the best naming convention23:35
wiggyTAL expressions do not use filenames but traversal23:35
*** redir has joined #zope3-dev23:35
junkafarianwhat would be the correct traversal string?23:36
junkafarianits in the same folder23:36
junkafariantheres and contact.html23:36
junkafarianuse-macro is in contact.html23:36
junkafarianshould i paste it on lisp?23:37
junkafarianwiggy: ^23:38
wiggytry master/macros/letscreateart23:38
junkafarianthe example on the zope wiki calls container/master.html/macros/hello23:40
junkafarianhowever that returns a KeyError for 'container'23:41
benjijunkafarian: that looks like a Zope 2 example23:41
junkafarianbenji: is there zope3 example syntax somewhere?23:42
* junkafarian is new to metal23:42
*** timte has joined #zope3-dev23:44
benjiI don't know of an example off-hand of defining macros in one template and accessing them in another23:45
junkafarianwiggy: ?23:47
junkafarianbenji: eg is on
wiggythe z3 syntax is the same23:48
junkafarianwiggy: should it start with container/23:49
wiggyif you want to start traversing from the current container that sounds like a good strategy23:50
benjiIIRC, you can just define a <browser:page for="*" name="my_macros" template=""/> and then do use-macro="context/@@my_macros/bar"23:51
wiggy@@my_macros/macros/bar I suspect23:51
benjicould be; I may not RC <wink>23:51
*** rocky is now known as rocky|away23:55
junkafarianerrors with: TraversalError: (< object at 0x40ff9bec>, 'master')23:55
junkafarianTraversalError: (< from /home/junkafarian/public_www/letscreateart/lib/python/letscreateart/ object at 0x4155b94c>, 'macros')23:56
junkafarianor with @@my_macros/macros/letscreateart23:57
junkafarianPTRuntimeError: ['Compilation failed', 'zope.tal.taldefs.TALError: Invalid variable name "mast" in expression u\'@@master/macros/mast\', at line 1, column 1']23:58

Generated by 2.15.1 by Marius Gedminas - find it at!