*** foom has quit IRC | 00:30 | |
*** gintas has joined #zope3-dev | 00:30 | |
*** dlk has quit IRC | 01:04 | |
*** J1m has left #zope3-dev | 01:05 | |
*** gintas has quit IRC | 01:35 | |
Damascene | I see a queryview, but is there a way I can get a master list of views for a component? | 02:22 |
---|---|---|
Damascene | rather, all views for a content component? | 02:22 |
*** stub has joined #zope3-dev | 02:43 | |
*** hazmat has joined #zope3-dev | 02:52 | |
*** stub has quit IRC | 03:12 | |
*** BradB is now known as BradB|away | 03:21 | |
*** RaFromBRC has quit IRC | 03:43 | |
*** RaFromBRC has joined #zope3-dev | 03:43 | |
*** ChanServ sets mode: +o hazmat | 03:43 | |
*** `anthony has quit IRC | 03:53 | |
*** mooded has quit IRC | 03:54 | |
*** IZZ has joined #zope3-dev | 04:15 | |
*** IZZ has quit IRC | 04:20 | |
*** stub has joined #zope3-dev | 05:09 | |
*** tvon has joined #zope3-dev | 05:22 | |
*** `anthony has joined #zope3-dev | 05:31 | |
*** bskahan has joined #zope3-dev | 05:35 | |
*** bskahan has quit IRC | 05:40 | |
*** tvon has quit IRC | 06:25 | |
*** bskahan has joined #zope3-dev | 06:43 | |
*** RaFromBRC has quit IRC | 06:45 | |
*** hazmat has quit IRC | 06:58 | |
*** hazmat has joined #zope3-dev | 07:37 | |
*** BradB|away has quit IRC | 07:49 | |
*** bradb has joined #zope3-dev | 07:51 | |
*** __gotcha_ has joined #zope3-dev | 07:57 | |
*** __gotcha has quit IRC | 08:03 | |
*** sashav has quit IRC | 08:19 | |
*** d2m has joined #zope3-dev | 08:26 | |
*** hdima has joined #zope3-dev | 09:11 | |
*** dlk has joined #zope3-dev | 09:16 | |
*** adim has joined #zope3-dev | 09:17 | |
*** bskahan has quit IRC | 09:25 | |
*** `anthony has quit IRC | 09:42 | |
*** sashav has joined #zope3-dev | 09:48 | |
*** Theuni has joined #zope3-dev | 09:49 | |
*** `anthony has joined #zope3-dev | 10:01 | |
*** bskahan has joined #zope3-dev | 10:08 | |
*** mgedmin has joined #zope3-dev | 10:40 | |
*** vlado has joined #zope3-dev | 10:50 | |
*** MalcolmC has joined #zope3-dev | 11:02 | |
*** MalcolmC has quit IRC | 11:03 | |
*** MalcolmC has joined #zope3-dev | 11:14 | |
*** Theuni has quit IRC | 11:20 | |
*** jack-e|away is now known as jack-e | 11:24 | |
*** zagy has joined #zope3-dev | 11:33 | |
*** bskahan has quit IRC | 11:36 | |
*** `anthony has quit IRC | 11:39 | |
*** `anthony has joined #zope3-dev | 11:40 | |
*** bskahan has joined #zope3-dev | 11:41 | |
*** `anthony has quit IRC | 12:08 | |
*** Voblia has joined #zope3-dev | 12:08 | |
*** bskahan has quit IRC | 12:19 | |
*** hazmat has quit IRC | 12:20 | |
*** sashav_ has joined #zope3-dev | 12:59 | |
*** vlado has quit IRC | 13:14 | |
*** d2m has quit IRC | 13:14 | |
*** tav_ has quit IRC | 13:14 | |
*** vinsci has quit IRC | 13:14 | |
*** AJC has quit IRC | 13:14 | |
*** bradb has quit IRC | 13:14 | |
*** VladDrac has quit IRC | 13:14 | |
*** mgedmin has quit IRC | 13:14 | |
*** adim has quit IRC | 13:14 | |
*** mohsen-away has quit IRC | 13:14 | |
*** zagy has quit IRC | 13:14 | |
*** Voblia has quit IRC | 13:14 | |
*** MalcolmC has quit IRC | 13:14 | |
*** jack-e has quit IRC | 13:14 | |
*** sashav has quit IRC | 13:14 | |
*** hdima has quit IRC | 13:14 | |
*** __gotcha_ has quit IRC | 13:14 | |
*** stub has quit IRC | 13:14 | |
*** deo has quit IRC | 13:14 | |
*** Damascene has quit IRC | 13:14 | |
*** BjornT has quit IRC | 13:14 | |
*** rabidbt has quit IRC | 13:14 | |
*** Voblia has joined #zope3-dev | 13:20 | |
*** zagy has joined #zope3-dev | 13:20 | |
*** MalcolmC has joined #zope3-dev | 13:20 | |
*** vlado has joined #zope3-dev | 13:20 | |
*** mgedmin has joined #zope3-dev | 13:20 | |
*** sashav has joined #zope3-dev | 13:20 | |
*** adim has joined #zope3-dev | 13:20 | |
*** hdima has joined #zope3-dev | 13:20 | |
*** d2m has joined #zope3-dev | 13:20 | |
*** __gotcha_ has joined #zope3-dev | 13:20 | |
*** bradb has joined #zope3-dev | 13:20 | |
*** stub has joined #zope3-dev | 13:20 | |
*** deo has joined #zope3-dev | 13:20 | |
*** tav_ has joined #zope3-dev | 13:20 | |
*** Damascene has joined #zope3-dev | 13:20 | |
*** AJC has joined #zope3-dev | 13:20 | |
*** BjornT has joined #zope3-dev | 13:20 | |
*** vinsci has joined #zope3-dev | 13:20 | |
*** mohsen-away has joined #zope3-dev | 13:20 | |
*** jack-e has joined #zope3-dev | 13:20 | |
*** VladDrac has joined #zope3-dev | 13:20 | |
*** rabidbt has joined #zope3-dev | 13:20 | |
*** __gotcha_ is now known as __gotcha | 13:47 | |
*** adim has left #zope3-dev | 13:47 | |
*** stub has quit IRC | 13:55 | |
*** mooded has joined #zope3-dev | 14:00 | |
*** vlado has quit IRC | 14:01 | |
*** vlado_ has joined #zope3-dev | 14:01 | |
*** vlado_ has quit IRC | 14:19 | |
*** vlado_ has joined #zope3-dev | 14:19 | |
*** [nicknam] has joined #zope3-dev | 14:20 | |
Damascene | I looked in zapi, recursive greped for allview (case insensitive) and found nothing. Is there a way I can get all views for a component with zapi? | 14:33 |
*** [nicknam] has quit IRC | 15:27 | |
*** mooded has quit IRC | 15:29 | |
*** mooded has joined #zope3-dev | 15:46 | |
*** srichter has joined #zope3-dev | 15:58 | |
*** ChanServ sets mode: +o srichter | 15:58 | |
*** Voblia has quit IRC | 16:03 | |
*** BjornT has quit IRC | 16:05 | |
*** gintas has joined #zope3-dev | 16:09 | |
*** Voblia has joined #zope3-dev | 16:24 | |
*** foom has joined #zope3-dev | 16:44 | |
*** benji_york has joined #zope3-dev | 16:44 | |
*** sashav has quit IRC | 16:47 | |
*** Theuni has joined #zope3-dev | 16:51 | |
*** dlk has quit IRC | 17:15 | |
*** hdima has quit IRC | 17:27 | |
*** BjornT has joined #zope3-dev | 17:28 | |
*** hazmat has joined #zope3-dev | 17:29 | |
*** tav has joined #zope3-dev | 17:31 | |
*** AJC has quit IRC | 17:35 | |
*** J1m has joined #zope3-dev | 17:37 | |
*** tav_ has quit IRC | 17:39 | |
*** AJC has joined #zope3-dev | 17:44 | |
*** jack-e is now known as jack-e|away | 17:44 | |
*** Voblia has quit IRC | 17:50 | |
*** bskahan has joined #zope3-dev | 18:07 | |
*** MalcolmC has quit IRC | 18:13 | |
*** bskahan has quit IRC | 18:28 | |
*** faassen has joined #zope3-dev | 18:32 | |
*** zagy has quit IRC | 18:47 | |
*** bskahan has joined #zope3-dev | 18:51 | |
*** vlado_ has quit IRC | 19:18 | |
*** sashav has joined #zope3-dev | 19:27 | |
*** hazmat has quit IRC | 19:40 | |
*** zagy has joined #zope3-dev | 19:55 | |
*** `anthony has joined #zope3-dev | 20:05 | |
*** gintas has quit IRC | 20:11 | |
*** RaFromBRC has joined #zope3-dev | 20:17 | |
*** Theuni has quit IRC | 20:26 | |
*** bskahan has quit IRC | 20:28 | |
srichter | J1m: I hope you are not working on the deprecation module | 20:56 |
J1m | no | 20:57 |
srichter | good, I have a DeprecationProxy for any obejct done now | 20:57 |
J1m | cool | 20:57 |
srichter | I am working on some convenience functions now | 20:57 |
J1m | I wouldn't use this for anything but modules. | 20:57 |
*** bskahan has joined #zope3-dev | 21:01 | |
srichter | I want to use it for classes as well | 21:02 |
srichter | it is much easier this way than doing different things for attributes and methods | 21:03 |
J1m | That is way too risky IMO | 21:03 |
J1m | proxies suck. | 21:03 |
J1m | They are a necessary evol that we should use only when needed. | 21:04 |
J1m | would you proxy a class so that you got warnings when accessing methods through instances? | 21:04 |
srichter | yes | 21:04 |
J1m | Have you gotten this to work? | 21:05 |
J1m | I would expect it to require deep magic | 21:05 |
J1m | feels like meta classes. | 21:05 |
srichter | yes | 21:06 |
srichter | as far as I can tell it works | 21:06 |
J1m | That's way to heavy for deprecation | 21:06 |
srichter | oh, no I did not | 21:06 |
srichter | I did it wonr | 21:06 |
srichter | wrong | 21:06 |
srichter | sorry | 21:06 |
srichter | I put the proxy around the instance | 21:07 |
srichter | duh | 21:07 |
J1m | How do you know to put a proxy around an instance? | 21:07 |
J1m | what sort of instances are you using this for? | 21:07 |
srichter | but I had the other solution using descriptors work before | 21:07 |
srichter | oh, it was just a trivial test | 21:08 |
srichter | >>> my = MyComponent() | 21:08 |
srichter | >>> from zope.deprecation import deprecation | 21:08 |
srichter | >>> dep_my = deprecation.DeprecationProxy(my) | 21:08 |
srichter | >>> dep_my.deprecate('setX', 'setX() is no more.') | 21:08 |
srichter | >>> dep_my.setX(2) | 21:08 |
srichter | <string>:1: DeprecationWarning: setX() is no more. | 21:08 |
J1m | OK, but, in practice, what would you use this for? | 21:08 |
*** zmogelis__ has joined #zope3-dev | 21:09 | |
srichter | you don't; as I said, this is worng :-) | 21:09 |
srichter | wrong | 21:09 |
srichter | I will use descriptors and a simple function again | 21:09 |
J1m | k | 21:09 |
srichter | but it works all great for modules | 21:10 |
Damascene | sorry to interrupt, but is there a way to get then names of 'all views' for a content object? i checked the zapi... i found queryview, and getviews. | 21:10 |
srichter | Damascene: look at zapi some more; it uses some low-level APIs to get all the views | 21:11 |
J1m | getAdapters | 21:11 |
srichter | yeah, if you use the trunk :-) | 21:11 |
Damascene | i'm using the trunk! | 21:11 |
Damascene | wanted to try out that session stuff in another webapp heh. | 21:12 |
Damascene | J1m; oh yeah ugh. that makes sense since views are now adapters | 21:12 |
Damascene | rather, i searching via old code base... but using trunk as my test server. | 21:14 |
*** mohsen-away has quit IRC | 21:14 | |
Damascene | i just figured something ilke that would have been in there in the earlier code like getallutilities hehe. | 21:14 |
*** dice has joined #zope3-dev | 21:22 | |
*** hazmat has joined #zope3-dev | 21:22 | |
dice | free celeb porn http://www.pimpingame.com/refer.php?ref=45075 | 21:22 |
*** dice has quit IRC | 21:25 | |
srichter | J1m: ok, I have now a deprecate(names, message) function working that works inside modules and classes | 21:29 |
J1m | inside classes? | 21:30 |
srichter | >>> class MyComponent(object): | 21:31 |
srichter | ... foo = 1 | 21:31 |
srichter | ... deprecation.deprecate('foo', 'foo is no more.') | 21:31 |
srichter | ... | 21:31 |
srichter | ... bar = 2 | 21:31 |
srichter | ... | 21:31 |
srichter | ... def blah(self): | 21:31 |
srichter | ... return 3 | 21:31 |
srichter | ... deprecation.deprecate('blah', 'blah() is no more.') | 21:31 |
srichter | ... | 21:31 |
srichter | ... def splat(self): | 21:31 |
srichter | ... return 4 | 21:31 |
srichter | >>> my = MyComponent() | 21:31 |
srichter | >>> my.foo | 21:31 |
srichter | <string>:1: DeprecationWarning: foo is no more. | 21:31 |
srichter | 1 | 21:31 |
srichter | >>> my.bar | 21:31 |
srichter | 2 | 21:31 |
srichter | >>> my.blah() | 21:31 |
srichter | <string>:1: DeprecationWarning: blah() is no more. | 21:31 |
srichter | 3 | 21:31 |
srichter | >>> my.splat() | 21:32 |
srichter | 4 | 21:32 |
srichter | it uses descriptors for attributes and a simple wrapper function for methods | 21:32 |
J1m | I'd prefer: | 21:33 |
J1m | something like: | 21:33 |
J1m | def foo(...): | 21:33 |
J1m | ... | 21:33 |
*** gintas has joined #zope3-dev | 21:33 | |
J1m | foo = reprecated(foo, reason) | 21:33 |
J1m | which, in Python 2.4, becomes: | 21:33 |
J1m | @deprecated("Foo goes away in Zope 3.3. Use bar instead") | 21:34 |
povbot` | J1m: Error: "deprecated("Foo" is not a valid command. | 21:34 |
J1m | def foo(...): | 21:35 |
J1m | ... | 21:35 |
* J1m wonders is that came out | 21:35 | |
* J1m wonders if that came out | 21:35 | |
srichter | yeah, got it | 21:35 |
J1m | Attributes are tricky. | 21:35 |
srichter | that's fine too | 21:35 |
srichter | I can easily change that | 21:35 |
J1m | Do you look at the existing attr for a variable and decide what sort of descriptor to create? | 21:36 |
J1m | It seems a bit invasive to see 1 and change it to a data descriptor. | 21:36 |
srichter | well, right now I say: if you are not a function you are an attribute | 21:36 |
srichter | which might be a bit too simple | 21:37 |
J1m | This feels rather magic (and therefore brittle) | 21:37 |
J1m | Wouldn't it be safe to say that deprecated attrs will always be implemented with some sort of property? | 21:37 |
srichter | on the other hand the developer makes a conscious choice of using them | 21:37 |
J1m | Then: | 21:37 |
J1m | x = property(lambda self: self.y) | 21:38 |
J1m | x = deprecated(x, 'X foes away in Zope 3.3, use y instead') | 21:38 |
J1m | 21:38 | |
srichter | but sometimes there is not y | 21:39 |
srichter | I simply want to get rid of an attribute | 21:39 |
srichter | maybe the info went into another part of the framework | 21:39 |
J1m | right, but then, for backward compatibilty, you want to delegate to the new framework. | 21:40 |
J1m | The attribute must be getting used for something. | 21:40 |
J1m | Anyway, in a situation where there is no delegation, then: | 21:41 |
J1m | 21:41 | |
J1m | x = property(lambda self: 1) | 21:41 |
J1m | x = deprecated(x, 'X goes away in Zope 3.3. Stop using it!') | 21:41 |
J1m | Note that deprecated has to be clever enough to return the same kind of descriptor as the original. | 21:42 |
Damascene | i have a <page name="index.html" class=".view.CMSView" ... /> inside that, i made a method that does this. list = zapi.getAdapters([self.context], IIntCMS). but list appears to be empty? am i using it improperly? i want to get a list of all the other <page name="products.html"... > etc. i only have one content object, but many views to it. (because my content actually pulls from an SQL db). | 21:42 |
srichter | J1m: how can it do this? | 21:43 |
J1m | It has to use it's nose. | 21:43 |
J1m | Damascene, views adapt one or o=more objects *and* a request. | 21:43 |
J1m | Damascene, views adapt one or more objects *and* a request. | 21:43 |
J1m | srichter, there are theoretically 7 possibilities, perhaps less. | 21:44 |
srichter | what are they? | 21:44 |
J1m | Depending on whether the original has __get__, __set__, __delete__. | 21:45 |
srichter | oh, I see | 21:45 |
J1m | actually, I guess it could create an instance of a generic class with wrappers around the proginal methods as instance variables. | 21:46 |
srichter | I could pass these options to the constructor of the new property | 21:46 |
J1m | no, that probably doesn't work. | 21:46 |
J1m | Because these are slots. | 21:46 |
J1m | You will need some number of classes, depending on the allowable combinations. | 21:46 |
srichter | but I could do it all in one class | 21:47 |
srichter | like: | 21:47 |
srichter | class Property(object): | 21:48 |
srichter | def __init__(..., has_del=False): | 21:48 |
srichter | self.has_del = False | 21:48 |
srichter | self.has_del = has_del | 21:48 |
srichter | def __del__(self): | 21:48 |
srichter | if not self.has_del: AttributeError, ... | 21:49 |
J1m | 1. you misspelled __delete__ ;) | 21:50 |
srichter | or even better, could I not just override a properties methods? | 21:50 |
*** faassen has quit IRC | 21:50 | |
J1m | 2. This won't work because Python behaves differently depending on the presense or absense of slots. | 21:50 |
J1m | Having a __set__ method will cause it to be a data descr | 21:50 |
srichter | if hasattr(property, '__delete__'): property.__delete__ = dep_delete | 21:51 |
srichter | I see | 21:51 |
foom | i find that really confusing. :( | 21:51 |
J1m | foom, you find what confusing? | 21:51 |
Damascene | J1m: sorry, after much debilitation, i'm not sure how that helps me? from a view class specially made for some content class, i just want to find the list of all the other views declared in the zcml for the same interface as the context. i thought list = zapi.getAdapters([self.context], IIntCMS) woudl work since i thought self.context is the object itself i am trying to find the adapter for and IIntCMS is the name of the | 21:51 |
foom | J1m: the way so much depends on whether a descriptor has a __set__. | 21:52 |
* J1m shrugs | 21:53 | |
J1m | I data descrs and write descrs are different beasts | 21:53 |
J1m | dang | 21:53 |
J1m | I data descrs and read descrs are different beasts | 21:53 |
J1m | Complain to Guido ;) | 21:54 |
srichter | J1m: I think we do not have to support descriptors having __delete__ | 21:56 |
srichter | I cannot remember seeing this anywhere in the code | 21:56 |
J1m | Damascene, you want something like: zapi.getAdapters([self.context, self.request], IIntCMS) | 21:56 |
srichter | J1m: in fact, I think we only need to support __get__ and __get__/__set__ combinations | 21:57 |
J1m | srichter, not handling __delete__ is a bug waiting to happen. | 21:57 |
srichter | ok, so we need: g, gs, gsd | 21:58 |
srichter | are the others realistic? | 21:58 |
J1m | That may be. I don't know what permuations Python considers legal | 21:58 |
J1m | I don't know | 21:58 |
srichter | ok, I do those for now and call YAGNI | 21:59 |
srichter | J1m: someone had the same idea as me about the flags: http://users.rcn.com/python/download/Descriptor.htm | 22:05 |
srichter | under Properties | 22:06 |
*** RaFromBRC is now known as RaFromBRC|afk | 22:07 | |
J1m | I don't see what you're refering to | 22:07 |
srichter | his big property class | 22:07 |
J1m | You mean the attribute error bit? | 22:08 |
srichter | oh no, nevermind, it is not the same | 22:08 |
srichter | yeah | 22:08 |
J1m | He's emulating propery, which *always* creates a data descr. | 22:08 |
srichter | oh, I see | 22:08 |
srichter | J1m: another nice thing could be: deprected_property(getter, setter, deleter, message) | 22:14 |
J1m | too many ways to do things | 22:14 |
srichter | ok | 22:15 |
srichter | J1m: what is the best way to take a string containing source code and compile it to a module? | 22:16 |
J1m | why do you want to know? | 22:20 |
srichter | I want it for a test | 22:20 |
J1m | why not use a file? | 22:21 |
J1m | so it's a real module? | 22:21 |
srichter | because I started to dislike to depend on a file | 22:21 |
srichter | ok | 22:22 |
*** zagy has quit IRC | 22:22 | |
J1m | well, a module can be anything | 22:23 |
J1m | so I would use another object to test. | 22:23 |
srichter | Oh, ok, so I used a class before | 22:23 |
J1m | Or, you could use the new module to create a module and just stuff some things into it. | 22:24 |
J1m | You don't need to compile code. | 22:24 |
srichter | oh, yes | 22:25 |
srichter | I will do that | 22:25 |
srichter | well, I cannot do that since I want to check the correct functioning of "deprecated()", which uses frames | 22:25 |
srichter | I think I know what I do: I write the code in tests.py and put it also in the text file as reference | 22:26 |
*** foom has quit IRC | 22:32 | |
*** RaFromBRC|afk has quit IRC | 22:52 | |
*** zmogelis__ has quit IRC | 23:01 | |
*** zmogelis__ has joined #zope3-dev | 23:04 | |
*** mgedmin has quit IRC | 23:09 | |
srichter | J1m: do you think I need to provide BBB for the RegistrationStack code? | 23:10 |
J1m | you mean for the api? | 23:12 |
J1m | definately for the instances | 23:12 |
J1m | Probably not the api | 23:12 |
J1m | try not and see if we have a problem. | 23:13 |
*** tvon has joined #zope3-dev | 23:28 | |
srichter | J1m: ok | 23:29 |
srichter | J1m: I do not understand what you mean by API versus instances? | 23:30 |
J1m | what do you mean by "provide BBB for the RegistrationStack code"? | 23:30 |
srichter | well, when someone asks: registry.queryRegistrations() it used to return a registration stack | 23:32 |
srichter | do I still need to return a registration-stack compliant object? | 23:33 |
J1m | I don't think we need to support old apis | 23:33 |
J1m | No one writes registration objects anymore, except you of course. ;) | 23:33 |
J1m | But old service instances have to work. | 23:34 |
srichter | ok | 23:34 |
J1m | That, or you need to provide an upgrade script. | 23:34 |
J1m | Man you are doing a hard project. | 23:34 |
srichter | I am providing an upgrade script! | 23:34 |
srichter | no kidding | 23:35 |
J1m | I'm sooo glad you are doing it. | 23:35 |
J1m | I'm sooo glad I'm not. ;) | 23:35 |
srichter | mmhhh, I wish you would have done it ;-) | 23:35 |
J1m | I would have, eventually | 23:35 |
srichter | ok, so I think the better approach to this will be to run the tests of a couple of old packages that I have purposefully not converted and make them pass the tests | 23:36 |
srichter | this will guarantee so that the trunk will break people's projects, because I provide a minimum of compatibility | 23:37 |
srichter | this puts the pressure on the application writers to test their code with the trunk | 23:37 |
J1m | You mean, you want to *not* break code of people working on the trunk, right? | 23:38 |
srichter | right | 23:38 |
srichter | but I know I will, if I only fix broken code in the trunk | 23:38 |
srichter | because I do not have a large enough sample of 3rd party code here | 23:39 |
*** jan_s has joined #zope3-dev | 23:39 | |
srichter | we will fix everything that is being reported before the release of course | 23:39 |
J1m | yup | 23:40 |
srichter | ok, that's what I am going to do then; my head was about to explode | 23:40 |
J1m | I can imagine | 23:41 |
srichter | the problem is that everything is interdependent because of these circular imports | 23:41 |
srichter | it is impossible to work, for example, on zope.app.registration, because it imports zope.app.tests, which imports about everything else | 23:42 |
*** PalmTree has joined #zope3-dev | 23:56 | |
*** RaFromBRC|afk has joined #zope3-dev | 23:58 | |
*** RaFromBRC|afk is now known as RaFromBRC | 23:58 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!