IRC log of #zope3-dev for Friday, 2005-01-14

*** foom has quit IRC00:30
*** gintas has joined #zope3-dev00:30
*** dlk has quit IRC01:04
*** J1m has left #zope3-dev01:05
*** gintas has quit IRC01:35
DamasceneI see a queryview, but is there a way I can get a master list of views for a component?02:22
Damascenerather, all views for a content component?02:22
*** stub has joined #zope3-dev02:43
*** hazmat has joined #zope3-dev02:52
*** stub has quit IRC03:12
*** BradB is now known as BradB|away03:21
*** RaFromBRC has quit IRC03:43
*** RaFromBRC has joined #zope3-dev03:43
*** ChanServ sets mode: +o hazmat03:43
*** `anthony has quit IRC03:53
*** mooded has quit IRC03:54
*** IZZ has joined #zope3-dev04:15
*** IZZ has quit IRC04:20
*** stub has joined #zope3-dev05:09
*** tvon has joined #zope3-dev05:22
*** `anthony has joined #zope3-dev05:31
*** bskahan has joined #zope3-dev05:35
*** bskahan has quit IRC05:40
*** tvon has quit IRC06:25
*** bskahan has joined #zope3-dev06:43
*** RaFromBRC has quit IRC06:45
*** hazmat has quit IRC06:58
*** hazmat has joined #zope3-dev07:37
*** BradB|away has quit IRC07:49
*** bradb has joined #zope3-dev07:51
*** __gotcha_ has joined #zope3-dev07:57
*** __gotcha has quit IRC08:03
*** sashav has quit IRC08:19
*** d2m has joined #zope3-dev08:26
*** hdima has joined #zope3-dev09:11
*** dlk has joined #zope3-dev09:16
*** adim has joined #zope3-dev09:17
*** bskahan has quit IRC09:25
*** `anthony has quit IRC09:42
*** sashav has joined #zope3-dev09:48
*** Theuni has joined #zope3-dev09:49
*** `anthony has joined #zope3-dev10:01
*** bskahan has joined #zope3-dev10:08
*** mgedmin has joined #zope3-dev10:40
*** vlado has joined #zope3-dev10:50
*** MalcolmC has joined #zope3-dev11:02
*** MalcolmC has quit IRC11:03
*** MalcolmC has joined #zope3-dev11:14
*** Theuni has quit IRC11:20
*** jack-e|away is now known as jack-e11:24
*** zagy has joined #zope3-dev11:33
*** bskahan has quit IRC11:36
*** `anthony has quit IRC11:39
*** `anthony has joined #zope3-dev11:40
*** bskahan has joined #zope3-dev11:41
*** `anthony has quit IRC12:08
*** Voblia has joined #zope3-dev12:08
*** bskahan has quit IRC12:19
*** hazmat has quit IRC12:20
*** sashav_ has joined #zope3-dev12:59
*** vlado has quit IRC13:14
*** d2m has quit IRC13:14
*** tav_ has quit IRC13:14
*** vinsci has quit IRC13:14
*** AJC has quit IRC13:14
*** bradb has quit IRC13:14
*** VladDrac has quit IRC13:14
*** mgedmin has quit IRC13:14
*** adim has quit IRC13:14
*** mohsen-away has quit IRC13:14
*** zagy has quit IRC13:14
*** Voblia has quit IRC13:14
*** MalcolmC has quit IRC13:14
*** jack-e has quit IRC13:14
*** sashav has quit IRC13:14
*** hdima has quit IRC13:14
*** __gotcha_ has quit IRC13:14
*** stub has quit IRC13:14
*** deo has quit IRC13:14
*** Damascene has quit IRC13:14
*** BjornT has quit IRC13:14
*** rabidbt has quit IRC13:14
*** Voblia has joined #zope3-dev13:20
*** zagy has joined #zope3-dev13:20
*** MalcolmC has joined #zope3-dev13:20
*** vlado has joined #zope3-dev13:20
*** mgedmin has joined #zope3-dev13:20
*** sashav has joined #zope3-dev13:20
*** adim has joined #zope3-dev13:20
*** hdima has joined #zope3-dev13:20
*** d2m has joined #zope3-dev13:20
*** __gotcha_ has joined #zope3-dev13:20
*** bradb has joined #zope3-dev13:20
*** stub has joined #zope3-dev13:20
*** deo has joined #zope3-dev13:20
*** tav_ has joined #zope3-dev13:20
*** Damascene has joined #zope3-dev13:20
*** AJC has joined #zope3-dev13:20
*** BjornT has joined #zope3-dev13:20
*** vinsci has joined #zope3-dev13:20
*** mohsen-away has joined #zope3-dev13:20
*** jack-e has joined #zope3-dev13:20
*** VladDrac has joined #zope3-dev13:20
*** rabidbt has joined #zope3-dev13:20
*** __gotcha_ is now known as __gotcha13:47
*** adim has left #zope3-dev13:47
*** stub has quit IRC13:55
*** mooded has joined #zope3-dev14:00
*** vlado has quit IRC14:01
*** vlado_ has joined #zope3-dev14:01
*** vlado_ has quit IRC14:19
*** vlado_ has joined #zope3-dev14:19
*** [nicknam] has joined #zope3-dev14:20
DamasceneI 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 IRC15:27
*** mooded has quit IRC15:29
*** mooded has joined #zope3-dev15:46
*** srichter has joined #zope3-dev15:58
*** ChanServ sets mode: +o srichter15:58
*** Voblia has quit IRC16:03
*** BjornT has quit IRC16:05
*** gintas has joined #zope3-dev16:09
*** Voblia has joined #zope3-dev16:24
*** foom has joined #zope3-dev16:44
*** benji_york has joined #zope3-dev16:44
*** sashav has quit IRC16:47
*** Theuni has joined #zope3-dev16:51
*** dlk has quit IRC17:15
*** hdima has quit IRC17:27
*** BjornT has joined #zope3-dev17:28
*** hazmat has joined #zope3-dev17:29
*** tav has joined #zope3-dev17:31
*** AJC has quit IRC17:35
*** J1m has joined #zope3-dev17:37
*** tav_ has quit IRC17:39
*** AJC has joined #zope3-dev17:44
*** jack-e is now known as jack-e|away17:44
*** Voblia has quit IRC17:50
*** bskahan has joined #zope3-dev18:07
*** MalcolmC has quit IRC18:13
*** bskahan has quit IRC18:28
*** faassen has joined #zope3-dev18:32
*** zagy has quit IRC18:47
*** bskahan has joined #zope3-dev18:51
*** vlado_ has quit IRC19:18
*** sashav has joined #zope3-dev19:27
*** hazmat has quit IRC19:40
*** zagy has joined #zope3-dev19:55
*** `anthony has joined #zope3-dev20:05
*** gintas has quit IRC20:11
*** RaFromBRC has joined #zope3-dev20:17
*** Theuni has quit IRC20:26
*** bskahan has quit IRC20:28
srichterJ1m: I hope you are not working on the deprecation module20:56
J1mno20:57
srichtergood, I have a DeprecationProxy for any obejct done now20:57
J1mcool20:57
srichterI am working on some convenience functions now20:57
J1mI wouldn't use this for anything but modules.20:57
*** bskahan has joined #zope3-dev21:01
srichterI want to use it for classes as well21:02
srichterit is much easier this way than doing different things for attributes and methods21:03
J1mThat is way too risky IMO21:03
J1mproxies suck.21:03
J1mThey are a necessary evol that we should use only when needed.21:04
J1mwould you proxy a class so that you got warnings when accessing methods through instances?21:04
srichteryes21:04
J1mHave you gotten this to work?21:05
J1mI would expect it to require deep magic21:05
J1mfeels like meta classes.21:05
srichteryes21:06
srichteras far as I can tell it works21:06
J1mThat's way to heavy for deprecation21:06
srichteroh, no I did not21:06
srichterI did it wonr21:06
srichterwrong21:06
srichtersorry21:06
srichterI put the proxy around the instance21:07
srichterduh21:07
J1mHow do you know to put a proxy around an instance?21:07
J1mwhat sort of instances are you using this for?21:07
srichterbut I had the other solution using descriptors work before21:07
srichteroh, it was just a trivial test21:08
srichter  >>> my = MyComponent()21:08
srichter  >>> from zope.deprecation import deprecation21: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
J1mOK, but, in practice, what would you use this for?21:08
*** zmogelis__ has joined #zope3-dev21:09
srichteryou don't; as I said, this is worng :-)21:09
srichterwrong21:09
srichterI will use descriptors and a simple function again21:09
J1mk21:09
srichterbut it works all great for modules21:10
Damascenesorry 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
srichterDamascene: look at zapi some more; it uses some low-level APIs to get all the views21:11
J1mgetAdapters21:11
srichteryeah, if you use the trunk :-)21:11
Damascenei'm using the trunk!21:11
Damascenewanted to try out that session stuff in another webapp heh.21:12
DamasceneJ1m;  oh yeah ugh.  that makes sense since views are now adapters21:12
Damascenerather, i searching via old code base... but using trunk as my test server.21:14
*** mohsen-away has quit IRC21:14
Damascenei just figured something ilke that would have been in there in the earlier code like getallutilities hehe.21:14
*** dice has joined #zope3-dev21:22
*** hazmat has joined #zope3-dev21:22
dicefree celeb porn http://www.pimpingame.com/refer.php?ref=4507521:22
*** dice has quit IRC21:25
srichterJ1m: ok, I have now a deprecate(names, message) function working that works inside modules and classes21:29
J1minside classes?21:30
srichter  >>> class MyComponent(object):21:31
srichter  ...     foo = 121:31
srichter  ...     deprecation.deprecate('foo', 'foo is no more.')21:31
srichter  ...21:31
srichter  ...     bar = 221:31
srichter  ...21:31
srichter  ...     def blah(self):21:31
srichter  ...         return 321:31
srichter  ...     deprecation.deprecate('blah', 'blah() is no more.')21:31
srichter  ...21:31
srichter  ...     def splat(self):21:31
srichter  ...         return 421:31
srichter  >>> my = MyComponent()21:31
srichter  >>> my.foo21:31
srichter  <string>:1: DeprecationWarning: foo is no more.21:31
srichter  121:31
srichter  >>> my.bar21:31
srichter  221:31
srichter  >>> my.blah()21:31
srichter  <string>:1: DeprecationWarning: blah() is no more.21:31
srichter  321:31
srichter  >>> my.splat()21:32
srichter  421:32
srichterit uses descriptors for attributes and a simple wrapper function for methods21:32
J1mI'd prefer:21:33
J1msomething like:21:33
J1mdef foo(...):21:33
J1m    ...21:33
*** gintas has joined #zope3-dev21:33
J1mfoo = reprecated(foo, reason)21:33
J1mwhich, 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
J1mdef foo(...):21:35
J1m    ...21:35
* J1m wonders is that came out21:35
* J1m wonders if that came out21:35
srichteryeah, got it21:35
J1mAttributes are tricky.21:35
srichterthat's fine too21:35
srichterI can easily change that21:35
J1mDo you look at the existing attr for a variable and decide what sort of descriptor to create?21:36
J1mIt seems a bit invasive to see 1 and change it to a data descriptor.21:36
srichterwell, right now I say: if you are not a function you are an attribute21:36
srichterwhich might be a bit too simple21:37
J1mThis feels rather magic (and therefore brittle)21:37
J1mWouldn't it be safe to say that deprecated attrs will always be implemented with some sort of property?21:37
srichteron the other hand the developer makes a conscious choice of using them21:37
J1mThen:21:37
J1mx = property(lambda self: self.y)21:38
J1mx = deprecated(x, 'X foes away in Zope 3.3, use y instead')21:38
J1m21:38
srichterbut sometimes there is not y21:39
srichterI simply want to get rid of an attribute21:39
srichtermaybe the info went into another part of the framework21:39
J1mright, but then, for backward compatibilty, you want to delegate to the new framework.21:40
J1mThe attribute must be getting used for something.21:40
J1mAnyway, in a situation where there is no delegation, then:21:41
J1m21:41
J1mx = property(lambda self: 1)21:41
J1mx = deprecated(x, 'X goes away in Zope 3.3. Stop using it!')21:41
J1mNote that deprecated has to be clever enough to return the same kind of descriptor as the original.21:42
Damascenei 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
srichterJ1m: how can it do this?21:43
J1mIt has to use it's nose.21:43
J1mDamascene, views adapt one or o=more objects *and* a request.21:43
J1mDamascene, views adapt one or more objects *and* a request.21:43
J1msrichter, there are theoretically 7 possibilities, perhaps less.21:44
srichterwhat are they?21:44
J1mDepending on whether the original has __get__, __set__, __delete__.21:45
srichteroh, I see21:45
J1mactually, I guess it could create an instance of a generic class with wrappers around the proginal methods as instance variables.21:46
srichterI could pass these options to the constructor of the new property21:46
J1mno, that probably doesn't work.21:46
J1mBecause these are slots.21:46
J1mYou will need some number of classes, depending on the allowable combinations.21:46
srichterbut I could do it all in one class21:47
srichterlike:21:47
srichterclass Property(object):21:48
srichter  def __init__(..., has_del=False):21:48
srichter        self.has_del = False21:48
srichter        self.has_del = has_del21:48
srichterdef __del__(self):21:48
srichter    if not self.has_del: AttributeError, ...21:49
J1m1. you misspelled __delete__ ;)21:50
srichteror even better, could I not just override a properties methods?21:50
*** faassen has quit IRC21:50
J1m2. This won't work because Python behaves differently depending on the presense or absense of slots.21:50
J1mHaving a __set__ method will cause it to be a data descr21:50
srichterif hasattr(property, '__delete__'): property.__delete__ = dep_delete21:51
srichterI see21:51
foomi find that really confusing. :(21:51
J1mfoom, you find what confusing?21:51
DamasceneJ1m:  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 the21:51
foomJ1m: the way so much depends on whether a descriptor has a __set__.21:52
* J1m shrugs21:53
J1mI data descrs and write descrs are different beasts21:53
J1mdang21:53
J1mI data descrs and read descrs are different beasts21:53
J1mComplain to Guido ;)21:54
srichterJ1m: I think we do not have to support descriptors having __delete__21:56
srichterI cannot remember seeing this anywhere in the code21:56
J1mDamascene, you want something like: zapi.getAdapters([self.context, self.request], IIntCMS)21:56
srichterJ1m: in fact, I think we only need to support __get__ and __get__/__set__ combinations21:57
J1msrichter, not handling __delete__ is a bug waiting to happen.21:57
srichterok, so we need: g, gs, gsd21:58
srichterare the others realistic?21:58
J1mThat may be.  I don't know what permuations Python considers legal21:58
J1mI don't know21:58
srichterok, I do those for now and call YAGNI21:59
srichterJ1m: someone had the same idea as me about the flags: http://users.rcn.com/python/download/Descriptor.htm22:05
srichterunder Properties22:06
*** RaFromBRC is now known as RaFromBRC|afk22:07
J1mI don't see what you're refering to22:07
srichterhis big property class22:07
J1mYou mean the attribute error bit?22:08
srichteroh no, nevermind, it is not the same22:08
srichteryeah22:08
J1mHe's emulating propery, which *always* creates a data descr.22:08
srichteroh, I see22:08
srichterJ1m: another nice thing could be: deprected_property(getter, setter, deleter, message)22:14
J1mtoo many ways to do things22:14
srichterok22:15
srichterJ1m: what is the best way to take a string containing source code and compile it to a module?22:16
J1mwhy do you want to know?22:20
srichterI want it for a test22:20
J1mwhy not use a file?22:21
J1mso it's a real module?22:21
srichterbecause I started to dislike to depend on a file22:21
srichterok22:22
*** zagy has quit IRC22:22
J1mwell, a module can be anything22:23
J1mso I would use another object to test.22:23
srichterOh, ok, so I used a class before22:23
J1mOr, you could use the new module to create a module and just stuff some things into it.22:24
J1mYou don't need to compile code.22:24
srichteroh, yes22:25
srichterI will do that22:25
srichterwell, I cannot do that since I want to check the correct functioning of "deprecated()", which uses frames22:25
srichterI think I know what I do: I write the code in tests.py and put it also in the text file as reference22:26
*** foom has quit IRC22:32
*** RaFromBRC|afk has quit IRC22:52
*** zmogelis__ has quit IRC23:01
*** zmogelis__ has joined #zope3-dev23:04
*** mgedmin has quit IRC23:09
srichterJ1m: do you think I need to provide BBB for the RegistrationStack code?23:10
J1myou mean for the api?23:12
J1mdefinately for the instances23:12
J1mProbably not the api23:12
J1mtry not and see if we have a problem.23:13
*** tvon has joined #zope3-dev23:28
srichterJ1m: ok23:29
srichterJ1m: I do not understand what you mean by API versus instances?23:30
J1mwhat do you mean by "provide BBB for the RegistrationStack code"?23:30
srichterwell, when someone asks: registry.queryRegistrations() it used to return a registration stack23:32
srichterdo I still need to return a registration-stack compliant object?23:33
J1mI don't think we need to support old apis23:33
J1mNo one writes registration objects anymore, except you of course. ;)23:33
J1mBut old service instances have to work.23:34
srichterok23:34
J1mThat, or you need to provide an upgrade script.23:34
J1mMan you are doing a hard project.23:34
srichterI am providing an upgrade script!23:34
srichterno kidding23:35
J1mI'm sooo glad you are doing it.23:35
J1mI'm sooo glad I'm not. ;)23:35
srichtermmhhh, I wish you would have done it ;-)23:35
J1mI would have, eventually23:35
srichterok, 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 tests23:36
srichterthis will guarantee so that the trunk will break people's projects, because I provide a minimum of compatibility23:37
srichterthis puts the pressure on the application writers to test their code with the trunk23:37
J1mYou mean, you want to *not* break code of people working on the trunk, right?23:38
srichterright23:38
srichterbut I know I will, if I only fix broken code in the trunk23:38
srichterbecause I do not have a large enough sample of 3rd party code here23:39
*** jan_s has joined #zope3-dev23:39
srichterwe will fix everything that is being reported before the release of course23:39
J1myup23:40
srichterok, that's what I am going to do then; my head was about to explode23:40
J1mI can imagine23:41
srichterthe problem is that everything is interdependent because of these circular imports23:41
srichterit is impossible to work, for example, on zope.app.registration, because it imports zope.app.tests, which imports about everything else23:42
*** PalmTree has joined #zope3-dev23:56
*** RaFromBRC|afk has joined #zope3-dev23:58
*** RaFromBRC|afk is now known as RaFromBRC23:58

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