Re: [Zope-dev] WSGI access log user info howto?
Hi Alex > Betreff: Re: WSGI access log user info howto? > > A branch containing this refactoring named > 'achapman__username_logging now exists in the zope.app.wsgi > directory. I'll be merging it today and tagging a release if > it appears acceptable. This looks good to me. Can you add a test for the new logging part? Or let me know if I can do it for you. Regards Roger Ineichen > - Alex Chapman > > > On Tue, Mar 31, 2009 at 10:00 PM, Alex Chapman > wrote: > > > This would work great for my own needs if its acceptable with > everyone else. > > Thanks for the help on this. In the future I'll do work > on a branch and > request a review from all those on the owner list > before merging, > tagging, and releasing. > > -Alex Chapman > > On Wed, 2009-04-01 at 03:30 +0200, Roger Ineichen wrote: > > Hi all > > > > Shane, > > any idea about the following which whould also > > affect the zope.pipeline or the zope.publisher refactoring? > > > > I need some advice for the access log topic in wsgi. > > > > > > The zope http server logs access in zope.publisher.http > > like: > > > > def setPrincipal(self, principal): > > 'See IPublicationRequest' > > super(HTTPRequest, self).setPrincipal(principal) > > logging_info = ILoggingInfo(principal, None) > > if logging_info is None: > > message = '-' > > else: > > message = logging_info.getLogMessage() > > self.response.authUser = message > > > > This means there is a ILoggingInfo adapter which returns > > a simple string. ASCII and no space are preffered because > > the standard access log format uses space aas delimiter. > > And access lgo fiels are not unicode. > > > > Of corse the ILoggingInfo adapter is responsible for > > choose the right format for each project. A default > > is configured in zope.publisher.principallogging > > PrincipalLogging > > > > Now to the question. > > > > In the latest checkins there was a access log part > > implemented. It doesn't use the ILoggingInfo adapter and > > is exposing the user login which is a part of the security > > credential. This get already released. (not good) > > > > Is there a standard how WSGI apps will log user info in > > access logs? I guess not, right? > > > > Does someone have a good idea how we should implement > > user access info for access logs in zope.app.wasg? > > > > If not, I propose the following: > > > > logging_info = ILoggingInfo(request.principal, None) > > if logging_info is None: > > message = '-' > > else: > > message = logging_info.getLogMessage() > > environ['wsgi.logging_info'] = message > > > > > > - this will set a ``wsgi.logging_info`` environ > > variable (or is there already a standard name)? > > > > - it uses the ILoggingInfo adapter which let us use > > different kind of access log info strategies in > > custom projects. By default we should use the > > PrincipalLogging adapter form > zope.publisher.principallogging. > > > > Does anybody have a better idea how we can make the user > > info available for the access log? > > > > Alex whould this fit for you? > > > > > > Regards > > Roger Ineichen > > _ > > END OF MESSAGE > > > > > > ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [Checkins] SVN: zope.annotation/trunk/setup.py Whitespace fixes
Hi Baiju If this whitespace fix is based on the current style guide, I think the guide needs to be fixed. I find the fixed version much less readable. A function that takes this many arguments should have an exception to the PEP 8 rule of no whitespace around the equals sign used for keyword arguments. I *think* a reasonable rule is that if you split the call over multiple lines with one argument per line, you should add single spaces before and after the equals sign. What does anyone else think? - Jacob Baiju M wrote: > Log message for revision 98773: > Whitespace fixes > > > Changed: > U zope.annotation/trunk/setup.py > > -=- > Modified: zope.annotation/trunk/setup.py > === > --- zope.annotation/trunk/setup.py2009-04-01 21:02:33 UTC (rev 98772) > +++ zope.annotation/trunk/setup.py2009-04-01 21:13:34 UTC (rev 98773) > @@ -23,14 +23,14 @@ > return open(os.path.join(os.path.dirname(__file__), *rnames)).read() > > setup( > -name = 'zope.annotation', > -version = '3.5.0dev', > -url = 'http://pypi.python.org/pypi/zope.annotation', > -license = 'ZPL 2.1', > -description = 'Object annotation mechanism', > -author = 'Zope Corporation and Contributors', > -author_email = 'zope-dev@zope.org', > -classifiers = [ > +name='zope.annotation', > +version='3.5.0dev', > +url='http://pypi.python.org/pypi/zope.annotation', > +license='ZPL 2.1', > +description='Object annotation mechanism', > +author='Zope Corporation and Contributors', > +author_email='zope-dev@zope.org', > +classifiers=[ > 'Development Status :: 5 - Production/Stable', > 'Intended Audience :: Developers', > 'License :: OSI Approved :: Zope Public License', > @@ -40,23 +40,23 @@ > 'Topic :: Internet :: WWW/HTTP', > 'Topic :: Software Development', > ], > -long_description = \ > +long_description= \ > read('src', 'zope', 'annotation', 'README.txt') > + '\n\n' + > read('CHANGES.txt'), > -packages = find_packages('src'), > -package_dir = {'': 'src'}, > -namespace_packages = ['zope',], > -install_requires = ['setuptools', > -'zope.interface', > -'zope.component', > -'zope.location', > -'zope.proxy', > -], > -extras_require = dict( > -test = ['zope.testing', > -'ZODB3'], > +packages=find_packages('src'), > +package_dir={'': 'src'}, > +namespace_packages=['zope',], > +install_requires=['setuptools', > + 'zope.interface', > + 'zope.component', > + 'zope.location', > + 'zope.proxy', > + ], > +extras_require=dict( > +test=['zope.testing', > + 'ZODB3'], > ), > -include_package_data = True, > -zip_safe = False, > +include_package_data=True, > +zip_safe=False, > ) > > ___ > Checkins mailing list > check...@zope.org > http://mail.zope.org/mailman/listinfo/checkins > ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
Martin Aspeli wrote at 2009-4-1 22:02 +0800: >I'd like to add support for the following: > >1) Provider decorator: > > @provider(IFoo) > def some_function(context) > pass I have already searched for this several times -- and was disappointed about my failure :-) -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
On 1 Apr 2009, at 18:25, Chris Rossi wrote: > Additionally, if I was grokking Lennart correctly yesterday, > __metaclass__ is going away, so the current metaclass implementation > is going to need some rejiggering. What was unclear was whether a > single implementation could support both <=2.5 and >=2.6. __metaclass__ is being replaced by a metaclass kwarg to class definition in 3.0, I believe. Matt ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Zope and Cygwin
Cesar Canassa wrote at 2009-3-30 14:54 -0300: >It would be possible to modify the plonectl script in order to make it run >without using the zdaemon? As someone modified "zopectl" to run under Windows without "zdaemon" (in newer Zope versions), it should be possible to change "plonectl" in a similar way. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
Additionally, if I was grokking Lennart correctly yesterday, __metaclass__ is going away, so the current metaclass implementation is going to need some rejiggering. What was unclear was whether a single implementation could support both <=2.5 and >=2.6. Chris On Wed, Apr 1, 2009 at 1:09 PM, Martin Aspeli wrote: > Hi Marius, > > >> It's a Python 2.6/3.0 feature: > > Oh... sniff... I so want that. ;) > >> from zope.component import adapter >> from zope.interface import implementer >> >> @adapter(IFoo) >> @implementer(IBar) >> class MyClass(object): >> >> def __init__(self, context): >> self.context = context >> ... >> >> which translates to the obvious >> >> class MyClass(object): >> >> def __init__(self, context): >> self.context = context >> ... >> >> MyClass = implementer(IBar)(MyClass) >> MyClass = adapter(IFoo)(MyClass) >> >> assuming I got the application order right. > > Great. > >> I now also wonder if adapter()/implementer() would work when called with >> classes rather than functions...? > > I would hope so, or it'd be really confusing. :) > > Martin > > -- > Author of `Professional Plone Development`, a book for developers who > want to work with Plone. See http://martinaspeli.net/plone-book > > ___ > Zope-Dev maillist - zope-...@zope.org > http://mail.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope ) > ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
Hi Marius, > It's a Python 2.6/3.0 feature: Oh... sniff... I so want that. ;) > from zope.component import adapter > from zope.interface import implementer > > @adapter(IFoo) > @implementer(IBar) > class MyClass(object): > > def __init__(self, context): > self.context = context > ... > > which translates to the obvious > > class MyClass(object): > > def __init__(self, context): > self.context = context > ... > > MyClass = implementer(IBar)(MyClass) > MyClass = adapter(IFoo)(MyClass) > > assuming I got the application order right. Great. > I now also wonder if adapter()/implementer() would work when called with > classes rather than functions...? I would hope so, or it'd be really confusing. :) Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
On Wed, Apr 01, 2009 at 10:56:30PM +0800, Martin Aspeli wrote: > Tres Seaver wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Martin Aspeli wrote: > >> Hi, > >> > >> I'd like to add support for the following: > >> > >> 1) Provider decorator: > >> > >> @provider(IFoo) > >> def some_function(context) > >> pass > >> > >> This is an alternative to doing a separate alsoProvides() on the function. > >> > >> 2) An interfaceProvides directive: > >> > >> > >> class IFoo(Interface): > >> interfaceProvides(ISomeMarker) > >> > >> This is alternative to doing alsoProvides() on the interface. > >> > >> The reason for this is that currently, you have to put those > >> alsoProvides() lines after the function or interface. This makes them > >> difficult to find if the bodies of the functions or interfaces are long, > >> and goes against the convention of having the "what is this" information > >> at the top of the entity. > >> > >> I can probably help implement this. Any thoughts? > > > > You should probably add a "class decorator" 'interfaceProvider', as > > well, because the "in-suite" versions are problematic for 2to3 > > conversion (IIRC what Lennart said yesterday). > > I'm not sure I understand what you mean by that. Can you show an example? It's a Python 2.6/3.0 feature: from zope.component import adapter from zope.interface import implementer @adapter(IFoo) @implementer(IBar) class MyClass(object): def __init__(self, context): self.context = context ... which translates to the obvious class MyClass(object): def __init__(self, context): self.context = context ... MyClass = implementer(IBar)(MyClass) MyClass = adapter(IFoo)(MyClass) assuming I got the application order right. I now also wonder if adapter()/implementer() would work when called with classes rather than functions...? Marius Gedminas -- http://pov.lt/ -- Zope 3 consulting and development signature.asc Description: Digital signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Martin Aspeli wrote: >> Hi, >> >> I'd like to add support for the following: >> >> 1) Provider decorator: >> >> @provider(IFoo) >> def some_function(context) >> pass >> >> This is an alternative to doing a separate alsoProvides() on the function. >> >> 2) An interfaceProvides directive: >> >> >> class IFoo(Interface): >> interfaceProvides(ISomeMarker) >> >> This is alternative to doing alsoProvides() on the interface. >> >> The reason for this is that currently, you have to put those >> alsoProvides() lines after the function or interface. This makes them >> difficult to find if the bodies of the functions or interfaces are long, >> and goes against the convention of having the "what is this" information >> at the top of the entity. >> >> I can probably help implement this. Any thoughts? > > You should probably add a "class decorator" 'interfaceProvider', as > well, because the "in-suite" versions are problematic for 2to3 > conversion (IIRC what Lennart said yesterday). I'm not sure I understand what you mean by that. Can you show an example? Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Aspeli wrote: > Hi, > > I'd like to add support for the following: > > 1) Provider decorator: > > @provider(IFoo) > def some_function(context) > pass > > This is an alternative to doing a separate alsoProvides() on the function. > > 2) An interfaceProvides directive: > > > class IFoo(Interface): > interfaceProvides(ISomeMarker) > > This is alternative to doing alsoProvides() on the interface. > > The reason for this is that currently, you have to put those > alsoProvides() lines after the function or interface. This makes them > difficult to find if the bodies of the functions or interfaces are long, > and goes against the convention of having the "what is this" information > at the top of the entity. > > I can probably help implement this. Any thoughts? You should probably add a "class decorator" 'interfaceProvider', as well, because the "in-suite" versions are problematic for 2to3 conversion (IIRC what Lennart said yesterday). Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJ03rd+gerLs4ltQ4RAhmLAJ94wuHpAwJjNu8rylhKZeYn1yV11QCeLh36 zMqCZerP8HNUyFJH4IvNkaY= =pD4Z -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component
On Apr 1, 2009, at 10:02 AM, Martin Aspeli wrote: > Hi, > > I'd like to add support for the following: > > 1) Provider decorator: > > @provider(IFoo) > def some_function(context) > pass > > > This is an alternative to doing a separate alsoProvides() on the > function. > > 2) An interfaceProvides directive: > > > class IFoo(Interface): > interfaceProvides(ISomeMarker) > > This is alternative to doing alsoProvides() on the interface. > > The reason for this is that currently, you have to put those > alsoProvides() lines after the function or interface. This makes them > difficult to find if the bodies of the functions or interfaces are > long, > and goes against the convention of having the "what is this" > information > at the top of the entity. > > I can probably help implement this. Any thoughts? +1 -- Jim Fulton Zope Corporation ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Two small convenience suggestions for zope.interface and zope.component
Hi, I'd like to add support for the following: 1) Provider decorator: @provider(IFoo) def some_function(context) pass This is an alternative to doing a separate alsoProvides() on the function. 2) An interfaceProvides directive: class IFoo(Interface): interfaceProvides(ISomeMarker) This is alternative to doing alsoProvides() on the interface. The reason for this is that currently, you have to put those alsoProvides() lines after the function or interface. This makes them difficult to find if the bodies of the functions or interfaces are long, and goes against the convention of having the "what is this" information at the top of the entity. I can probably help implement this. Any thoughts? Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Announcing: Zope 4.0 project
Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On behalf of the Zope community, I am pleased to announce the creation > of the "Zope 4.0" project. After extensive discussion with the Zope > wizards in conclave at PyCon 2009, the new project's website has been > launched: > > http://zopefour.org/ Ah, best one yet. :) Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [Zope-Annce] Announcing: Zope 4.0 project
*looks at the date* *sigh* I'll go back to my cave now... Chris Chris Withers wrote: > Tres Seaver wrote: >> On behalf of the Zope community, I am pleased to announce the creation >> of the "Zope 4.0" project. After extensive discussion with the Zope >> wizards in conclave at PyCon 2009, the new project's website has been >> launched: >> >> http://zopefour.org/ > > Er? > > Little more context and explanation please... > > Chris > -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [Zope-Annce] Announcing: Zope 4.0 project
Tres Seaver wrote: > On behalf of the Zope community, I am pleased to announce the creation > of the "Zope 4.0" project. After extensive discussion with the Zope > wizards in conclave at PyCon 2009, the new project's website has been > launched: > > http://zopefour.org/ Er? Little more context and explanation please... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Announcing: Zope 4.0 project
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Zope community, I am pleased to announce the creation of the "Zope 4.0" project. After extensive discussion with the Zope wizards in conclave at PyCon 2009, the new project's website has been launched: http://zopefour.org/ Enjoy! Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJ01VR+gerLs4ltQ4RAiljAKCACB9aMtI3YnsXPZss4hdEDrA7FACgsqv7 3jR6FQeEy0qpX4D4NOX+HsA= =q8Fu -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )