*** jelkner_ has joined #schooltool | 00:11 | |
*** jelkner has quit IRC | 00:11 | |
*** jelkner_ is now known as jelkner | 00:12 | |
*** jelkner has quit IRC | 00:17 | |
*** replaceafill has quit IRC | 01:01 | |
*** alga has joined #SchoolTool | 01:02 | |
*** fsufitch has left #schooltool | 01:16 | |
*** jstraw has joined #schooltool | 01:17 | |
*** fsufitch has joined #schooltool | 01:25 | |
*** fsufitch has left #schooltool | 01:25 | |
*** fsufitch has joined #schooltool | 01:25 | |
*** alga has quit IRC | 04:23 | |
*** th1a has quit IRC | 04:46 | |
*** fsufitch has quit IRC | 04:56 | |
*** fsufitch has joined #schooltool | 04:57 | |
*** wbrady has joined #schooltool | 06:41 | |
*** wbrady_ has joined #schooltool | 06:41 | |
*** wbrady has quit IRC | 06:41 | |
*** wbrady has joined #schooltool | 06:41 | |
*** wbrady has quit IRC | 07:19 | |
*** alga has joined #SchoolTool | 13:39 | |
*** ignas has joined #schooltool | 13:47 | |
*** jstraw has quit IRC | 14:47 | |
*** th1a has joined #schooltool | 15:26 | |
*** jstraw has joined #schooltool | 15:36 | |
*** balor has quit IRC | 15:52 | |
*** replaceafill has joined #schooltool | 17:06 | |
*** mgedmin has joined #schooltool | 17:31 | |
ignas | replaceafill: hi | 17:37 |
---|---|---|
replaceafill | hey ignas | 17:38 |
replaceafill | is the approach ok? | 17:39 |
replaceafill | i changed the AdapterTraverserPlugin(...) call to the adapter's __init__ method | 17:39 |
ignas | looking for a better solution ;) | 17:40 |
replaceafill | :) | 17:41 |
ignas | would using | 17:41 |
ignas | @grokcore.adapter() | 17:41 |
ignas | @grokcore.implementer() | 17:41 |
ignas | and AdapterTraverserPlugin(IFoo, 'foo') | 17:41 |
ignas | work? | 17:41 |
replaceafill | :O | 17:41 |
ignas | hmm, not really, as there is no name... | 17:42 |
ignas | give me a second | 17:42 |
* ignas goes over to #grok | 17:42 | |
replaceafill | :D | 17:42 |
* replaceafill replaceafill does too | 17:42 | |
replaceafill | ignas, the grokcore.component.name directive has class scope :( | 17:44 |
ignas | looking at code | 17:45 |
replaceafill | we would need some decorator | 17:46 |
ignas | i think something like | 17:48 |
ignas | class FooTraverser(grokcore.MultiAdapter, AdapterTraverserPluginTemplate): | 17:48 |
ignas | @property | 17:48 |
ignas | def adapterName(self): return grokcore.something.get().name | 17:48 |
ignas | interface = IFoo | 17:48 |
ignas | with all the grokcore.implements and adapts and name things in the class as it were | 17:49 |
replaceafill | AdapterTraversPluginTemplate??!? | 17:49 |
replaceafill | :O | 17:49 |
ignas | AdapterTraverserPlugin is a function | 17:49 |
replaceafill | yes | 17:49 |
ignas | that creates a new class | 17:49 |
* mgedmin wants an AdapterTraverserPluginFactoryFactory | 17:49 | |
ignas | that is a subclass of AdapterTraversalPluginTemplate | 17:50 |
replaceafill | i didnt understand the type(...) call :( | 17:50 |
ignas | with some attributes set | 17:50 |
replaceafill | i see | 17:50 |
replaceafill | should i concern about "future" traverser plugins now? | 17:50 |
ignas | replaceafill: it sets traversal name, adapter name and interface | 17:51 |
replaceafill | i mean, to provide something more general | 17:51 |
ignas | nope, not yet | 17:51 |
replaceafill | ok, right now just schooltool.contact | 17:51 |
ignas | any generic code should be in schooltool.traversal anyway | 17:51 |
ignas | yeah | 17:51 |
replaceafill | ok, will work on this new approach then, thanks ignas | 17:52 |
ignas | it should at least remove the duplication of the publishTraverse and _traverse | 17:53 |
replaceafill | ignas, ping | 18:46 |
ignas | replaceafill: pong | 18:51 |
replaceafill | should the traversalName and the adapterName in the template be the same? | 18:51 |
replaceafill | the metadirective does this: | 18:52 |
replaceafill | def AdapterTraverserPlugin(traversalName, interface, adapterName='') | 18:52 |
replaceafill | oh sorry | 18:52 |
replaceafill | the metadirective: | 18:52 |
replaceafill | factory = AdapterTraverserPlugin(name, adapter) | 18:52 |
replaceafill | handle_adapter(...., name=name) | 18:52 |
replaceafill | so factory is actually a template, right? | 18:53 |
replaceafill | next that template is registered under the same name | 18:53 |
ignas | i think yes | 18:54 |
ignas | if i understand you correctly | 18:54 |
ignas | as for the first question - yes they should be the same | 18:54 |
replaceafill | if i subclass the template i dont do factory(self.context, self.request) | 18:54 |
replaceafill | i'm getting " NotFound: Object: <schooltool.contact.browser.contact.ContactContainerTraverserPlugin object at 0xb51bc2c>, name: u'index.html'" | 18:55 |
replaceafill | because the lookup in traverser/traverser.py/AdapterTraverserPluginTemplate/_traverse doesnt find the adapter | 18:56 |
replaceafill | if i provide an empty name for the adapterName attribute it works :S | 18:56 |
ignas | do you provide interface? | 18:56 |
replaceafill | yes | 18:56 |
replaceafill | interface = IContactContainer | 18:56 |
ignas | lisppaste5: url | 18:57 |
lisppaste5 | To use the lisppaste bot, visit http://paste.lisp.org/new/schooltool and enter your paste. | 18:57 |
ignas | post the code | 18:57 |
lisppaste5 | replaceafill pasted "traverser" at http://paste.lisp.org/display/76090 | 18:57 |
ignas | put pdb in the def publishTraverse(self, request, name): | 18:59 |
ignas | of NameTraverserPlugin | 18:59 |
replaceafill | if the adapterName property returns "" it works | 18:59 |
replaceafill | i put it in template._traverse | 19:00 |
replaceafill | is that ok? | 19:00 |
ignas | yeah, good enough | 19:00 |
replaceafill | and i see that | 19:00 |
ignas | and see what are the self.context | 19:00 |
ignas | self.adapterName | 19:00 |
ignas | and self.interface | 19:00 |
replaceafill | they are all good | 19:00 |
replaceafill | the problem is the adapter lookup | 19:00 |
replaceafill | it seems like the grok adapter is not registered under that name | 19:00 |
replaceafill | if i lookup using a empty name it works | 19:01 |
ignas | ahhhh | 19:01 |
replaceafill | so, i wanted to understand the implications of leaving adapterName empty | 19:01 |
ignas | yes! don't set it | 19:01 |
ignas | it's not grok | 19:01 |
ignas | it's my bad | 19:01 |
ignas | there are 2 names | 19:02 |
ignas | 1 name is for the traversal lookup | 19:02 |
replaceafill | :O | 19:02 |
ignas | as in - I am traversing into ISchoolToolApplication "contacts" | 19:02 |
replaceafill | can i leave it blank? | 19:02 |
ignas | that's the traversal name and the registration interface + name | 19:02 |
ignas | no, just remove it, it's blank by default | 19:02 |
ignas | and the other part is | 19:02 |
replaceafill | yes | 19:02 |
ignas | "traversing into ISchoolTool application "contacts" " means that i should adapt Application to IContacts + adapterNAme | 19:03 |
ignas | and well - you don't need a name to adapt application to IContacts | 19:03 |
ignas | so yeah - my mistake | 19:03 |
ignas | you only need to set traversalName | 19:03 |
*** jstraw has quit IRC | 19:11 | |
*** jstraw1 has joined #schooltool | 19:11 | |
*** jstraw1 has quit IRC | 19:20 | |
*** replaceafill has quit IRC | 19:20 | |
ignas | th1a: ayt? | 19:49 |
*** ignas has quit IRC | 20:00 | |
*** alga has quit IRC | 21:04 | |
*** jstraw has joined #schooltool | 21:10 | |
*** jstraw1 has joined #schooltool | 21:13 | |
*** jstraw has quit IRC | 21:13 | |
*** mgedmin has quit IRC | 21:19 | |
*** jstraw has joined #schooltool | 21:25 | |
*** jstraw1 has quit IRC | 21:25 | |
*** jelkner has joined #schooltool | 21:31 | |
*** replaceafill has joined #schooltool | 21:32 | |
*** jelkner has quit IRC | 21:37 | |
*** alga has joined #SchoolTool | 22:27 | |
*** jstraw has quit IRC | 22:28 | |
*** jstraw has joined #schooltool | 22:29 | |
*** jstraw has quit IRC | 22:38 | |
*** jstraw has joined #schooltool | 22:39 | |
*** jstraw1 has joined #schooltool | 23:10 | |
*** jstraw has quit IRC | 23:10 | |
*** jstraw has joined #schooltool | 23:51 | |
*** jstraw has quit IRC | 23:53 | |
*** jstraw has joined #schooltool | 23:53 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!