Re: [Zope3-Users] z3c.traverser and stackinfo

2009-10-21 Thread Dan Korostelev
2009/10/21 Simon Elbaz simon.el...@free.fr:
 I am trying to use stackinfo module from z3c.traverser and don't
 understand the following error because ITraversalStackInfo should adapt
 BrowserRequest class according to
 (http://svn.zope.org/z3c.traverser/trunk/src/z3c/traverser/stackinfo/consumer.py?rev=95983view=auto):

 TypeError: ('Could not adapt', zope.publisher.browser.BrowserRequest
 instance
 URL=http://localhost:9060/++skin++Adama/mysite/@@stackinfo.html,
 InterfaceClass z3c.traverser.stackinfo.interfaces.ITraversalStackInfo)

Did you not include z3c.traverser.stackinfo configure.zcml file?

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] zope.app.container importing problem

2009-09-14 Thread Dan Korostelev
2009/9/14 wsh shuha...@gmail.com

 Hi, all

 When I'm testing a package, some code is broken and I get the error
 message AttributeError: 'module' object has no attribute
 'interfaces'.

 After I checked the code I found that there are some code in the
 __init__.py like following:

from zope.app import container

 When it try to reference the interfaces attribute of the container
 module, but the attribute does not exist. I checked the container with
 print dir(container) and get following:

   ['__builtins__', '__doc__', '__file__', '__name__', '__path__']


 But if I add following line in the __init__.py this problem can be
 solved.

 from zope.app import container
 import zope.app.container.constraints
 print dir(container)
['__builtins__', '__doc__', '__file__', '__name__', '__path__',
 'constraints', 'i18n', 'interfaces']



 Can anyone explain this?


That's because zope.app.container.interfaces module is not imported, so
zope.app.container doesn't have interfaces attribute. But it seems to be
imported by constraints module, so it magically appears as interfaces in
zope.app.container.


-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] test writing with z3c.testsetup

2009-03-17 Thread Dan Korostelev
2009/3/17 Stephan Richter srich...@cosmos.phy.tufts.edu:
 On Tuesday 17 March 2009, Simon Elbaz wrote:
 It is maybe the download list http://download.zope.org/distribution/ that
 is not up to date.

 We should just remove this directory. Is there still anything useful there?

I use PILwoTk from there, however, I add the url to the package
directly as a find-link. It would be cool if the original PIL package
download worked out of box.


-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] problem adding localsitemanager in a subscriber with 3.5dev KGS

2009-02-28 Thread Dan Korostelev
2009/2/28 Dan Korostelev nad...@gmail.com:

 changing the assignment in
 zope.site.site.changeSiteConfigurationAfterMove (line 254) to

        site.getSiteManager().__bases__ = (next, ) if next else ()

 should do it.

 Well, it should be set to global site manager instead of empty tuple,
 but it's basically like that :) I've fixed that in the trunk.

 Thanks for the report!

It's in zope.site 3.6.1 now.

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] problem adding localsitemanager in a subscriber with 3.5dev KGS

2009-02-27 Thread Dan Korostelev
2009/2/27 Jens W. Klein j...@bluedynamics.com:
 Hi,

 I use the the KGS of zope 3.5dev (I need Python 2.6 because of third
 party code i integrate) and try to build a simple site and add a local
 component registry using a subscriber. It looks like I missed something -
 or I hit a bug in zope3.5dev. But before I report a bug I want to be sure
 that it isnt my fault.


...snip code and traceback...


 It calls the subscriber, adds the LocalSiteManager and then another event
 happens and the subscriber zope.site.site.changeSiteConfigurationAfterMove
 is called (line 251). Here is the code in there:

    if event.newParent is not None:
        next = _findNextSiteManager(site)
        site.getSiteManager().__bases__

 next is None here, so __bases__ has a None in the list.

 Btw., the way the sitemanager is added is the same as described in
 Phillip von Weiterhausens book.

 Whats wrong?

It assumes that the root folder has its own component registry, but
the rootFolder factory doesn't create one, so it returns none as the
next site manager. So, you need to call setSiteManager for the root
folder after creating it. However, I guess this case should be handled
by zope.site's event handler. I'll take a look at that tomorrow.

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] problem adding localsitemanager in a subscriber with 3.5dev KGS

2009-02-27 Thread Dan Korostelev
2009/2/28 Jens W. Klein j...@bluedynamics.com:
 Am Sat, 28 Feb 2009 00:28:38 +0300 schrieb Dan Korostelev:
 [...]
 It assumes that the root folder has its own component registry, but the
 rootFolder factory doesn't create one, so it returns none as the next
 site manager. So, you need to call setSiteManager for the root folder
 after creating it.

 indeed!

   from site import MySite
   mysite = MySite()
   from zope.app.folder import rootFolder
   root = rootFolder()
   root.setSiteManager(LocalSiteManager(root))
   root[u'mysite'] = mysite

 works fine!

 However, I guess this case should be handled by
 zope.site's event handler. I'll take a look at that tomorrow.

 changing the assignment in
 zope.site.site.changeSiteConfigurationAfterMove (line 254) to

        site.getSiteManager().__bases__ = (next, ) if next else ()

 should do it.

Well, it should be set to global site manager instead of empty tuple,
but it's basically like that :) I've fixed that in the trunk.

Thanks for the report!

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] TextIndexNG question...

2009-02-22 Thread Dan Korostelev
2009/2/18 Andreas Jung li...@zopyx.com:
 On 18.02.2009 17:14 Uhr, Thierry Florac wrote:

 I suppose that all this is a splitter/stopwords problem, but I can't
 manage to make this work correctly so any help would be greatly
 appreciated.

 Right. The splitter  and query parser use different approaches for
 splitting words and dealing with non-characters. This is subject
 for a major cleanup with the next TXNG 3.3 version to appear
 at some time in the future :-)

On the topic: Andreas, can you please review the two line patch (see
link) for zopyx.textindexng3 that fixes a core dump with python 2.5 at
last? It does work with python 2.4 and exactly the same patch was
applied for normalizers before.

https://sourceforge.net/tracker/index.php?func=detailaid=2111923group_id=50052atid=458418

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Run starup code with zope 3.

2009-02-12 Thread Dan Korostelev
2009/2/12 Thierry Florac thierry.flo...@onf.fr:
 Le jeudi 12 février 2009 à 17:50 +0100, Sebastian Bartos a écrit :
 I'm struggling with some Zope 3 startup code. I registered a user like
 this for the Session Credentials plugin and login form stuff:

 ...

 def create(self, data):
 site = getSite()
 sm = site.getSiteManager()

 if sm.has_key('auth'):
 return Site is already set up

 pau = Pluggableauth()
 sm['auth'] = pau
 sm.registerUtility(pau, Iauth)
 users = PrincipalFolder()
 sm['auth']['Users'] = users
 sm.registerUtility(users, IAuthenticatorPlugin, name=Users)
 pau.authenticatorPlugins = (users.__name__, )
 pau.credentialsPlugins = (No Challenge if Authenticated,
   Session Credentials)

 user = InternalPrincipal(user, foo, user,
  passwordManagerName=SHA1)
 users[user] = user
principalPermissionManager.grantAllPermissionsToPrincipal(user)


 To run code automatically at application startup, I think that you
 should have a look at the IDatabaseOpenedWithRootEvent (defined in
 zope.app.appsetup.interfaces).
 I use this event to check a set of persistent database utilities at
 application startup, and it works fine.

Also, zope.securitypolicy provides a way to store location-based
grants. Just adapt your site object to IPrincipalRoleManager or to
IPrincipalPermissionManager (defined in zope.security.interfaces) and
use its methods to allow/deny roles/permissions to some principal ID.
It will handle the actual storing work. Child objects will inherit
parent's settings until they have their own local settings.

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Zope security and inheritance

2009-02-08 Thread Dan Korostelev
2009/2/7 Taurus5 tauru...@web.de:
 I have some trouble with the zope security. I got ForbiddenAttribute
 Exception on sub-classes.

The checkers should be defined for each class separately. They aren't
used for subclasses automatically, though you can use protectLikeUnto
or require like_class=.your.Class / to define the same checkers.

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Question about menu.py

2009-02-03 Thread Dan Korostelev
2009/2/4 Simon Elbaz elbazsim...@gmail.com:
 When I look to the getMenuItemType() function, it returns a utility (
 return zope.component.getUtility(IMenuItemType, self.id)) and the
 consequence is that the adapter lookup returns nothing in getMenuItems.

That's strange, because that IMenuItemType utility is the interface
that the menu item adapters are registered as providing. It works as
intended here in plain zope3. Can you provide some more info?

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Users as Content

2009-01-17 Thread Dan Korostelev
You should look at the zope.app.authentication package. It has a basic
persistent principal folder and principal itself classes that can be
used as is to add principals to the site. You need to add pluggable
authentication to your site and register it as an IAuthentication
utility, then you can add principal folder to it and then principals
to that folder.

2009/1/17 Ben Mason b...@sharkbyte.co.uk:
 Hey all,

 I'm new to Zope 3 but a long time user of Zope 2.

 I'd like to make a content type behave like a principal so I can add
 users to my site as content. In Plone this is done with membrane.

 Anyone got any pointers in how to do this?

 Thanks

 Ben
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users




-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Is zope3 dead?

2008-12-22 Thread Dan Korostelev
Oh, also note, that zope3 releases actually happen and the latest one
(according to SVN) is 3.4.0c7 (released on sept 2008). But they are
released in form of versions.cfg file for KGS (like
http://download.zope.org/zope3.4/versions-3.4.0c7.cfg) instead of
tarballs. I think this is the most important thing that should be
mentioned on the website.

Correct me if I am wrong. :)

2008/12/21 Alek the...@poczta.onet.pl:
 For some time, I have a bad, worrisome feeling that Zope3 development pace
 has slew down.
 Today looked to zope wiki and discovered that there are virtually no new
 articles. I've also found that last release is almost one year old and zope
 3.4.0c0 is not even a real release, but a release candidate. Someone would
 say: hey, but maybe the development has just been decentralized? Zope 3.4 is
 the first eggified release, so maybe the development just moved to eggs
 (z3c.* and others).
 But I digged deeper and searched for some stats of Zope3-Users traffic,
 thanks to google. What I found I have published on a chart at
 http://pmiblog.blox.pl/2008/12/Is-Zope3-Dead.html. The traffic is at least
 half lower in 2008 than in 2007.

 Maybe the traffic moved somewhere else - to Wiki? This hypothesis haven't
 worked: I looked to zope 3 wiki and:

 the last new topic is 3 months old
 last month there is one edit of a topic
 After July 2008 there was not a one month with more than 5 edits.

 To summarize: It seems that zope3 development and engegement have been
 stalled for over half a year.
 Any thoughts? Have I missed some switch to other communication channels? Or
 maybe grok really took away all hearts and souls?
 What are the causes of the slowdown? Or maybe I just misinterpret the
 symptoms?

 Warm Regards,
 Alek

 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users





-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Is zope3 dead?

2008-12-21 Thread Dan Korostelev
No. Just the zope3 package is not released anymore. Now there's a
bunch of eggs on PyPI, providing some functionality, like
zope.component or zope.app.catalog. Some of core packages are mature
enough, so there aren't much new releases of them, but other (like
ZODB or z3c.form) are developed very actively. So Zope3 is alive and
rocking :)

There's certainly a problem with the website/documentation. IIRC,
there was a project to redesign zope.org website to make it more
friendly and informative, but people are quite busy so it looks
stalled. Also, it would be great if people wrote more articles and
updated current docs though, but it isn't the case currently. :-(

2008/12/21 Alek the...@poczta.onet.pl:
 For some time, I have a bad, worrisome feeling that Zope3 development pace
 has slew down.
 Today looked to zope wiki and discovered that there are virtually no new
 articles. I've also found that last release is almost one year old and zope
 3.4.0c0 is not even a real release, but a release candidate. Someone would
 say: hey, but maybe the development has just been decentralized? Zope 3.4 is
 the first eggified release, so maybe the development just moved to eggs
 (z3c.* and others).
 But I digged deeper and searched for some stats of Zope3-Users traffic,
 thanks to google. What I found I have published on a chart at
 http://pmiblog.blox.pl/2008/12/Is-Zope3-Dead.html. The traffic is at least
 half lower in 2008 than in 2007.

 Maybe the traffic moved somewhere else - to Wiki? This hypothesis haven't
 worked: I looked to zope 3 wiki and:

 the last new topic is 3 months old
 last month there is one edit of a topic
 After July 2008 there was not a one month with more than 5 edits.

 To summarize: It seems that zope3 development and engegement have been
 stalled for over half a year.
 Any thoughts? Have I missed some switch to other communication channels? Or
 maybe grok really took away all hearts and souls?
 What are the causes of the slowdown? Or maybe I just misinterpret the
 symptoms?

 Warm Regards,
 Alek

 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users





-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] resource-directories

2008-12-02 Thread Dan Korostelev
That's quite hard, because resources and resource directories are
registered providing simple zope.interface.Interface instead of
something like IDirectoryResource. I think it's a problem that need to
be fixed in zope.app.publisher.

2008/12/2 Frank Burkhardt [EMAIL PROTECTED]:
 Hi everyone,

 how can I get a list of all resourceDirectory's which are currently
 accessible via my zope instance? I'm interested in a
 name-physical_directory for all of them mapping.

 Thank you,

 Frank
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users




-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] SimpleComponentTraverser flaw

2008-09-24 Thread Dan Korostelev
I think that topic was raised before, but I can't find any information
about what's going to be done on that :)

The zope.app.publication.traversers.SimpleComponent (that's used by
default for most of objects) in its publishTraverse method uses the
adapter lookup without asking for some specific view interface (like
IBrowserView), like this:

  view = queryMultiAdapter((ob, request), name=name)

This causes problems when we have any non-view context/request
adapters registered. One real-life example of that kind of adapter is
ILayoutTemplate adapter registered with z3c:layout directive from
z3c.template package.

So the publisher that looks for views should look them up like this:

  view = queryMultiAdapter((ob, request), IBrowserView, name=name)

One issue is that SimpleComponentTraverser also provides
IXMLRPCPublisher and (as far as I understood) should be able to look
up IXMLRPCView adapters. I'm asking about how to fix this without
breaking much backward-compatibility. Should we just write split the
traverser in two (one for IBrowserViews and one for IXMLRPCViews) or
should we look up the view depending on request by using if/then
condition (if IBrowserRequest is provided - lookup IBrowserView, if
IXMLRPCRequest provided - lookup IXMLRPCView). Or probably some other
way? Also, is there any things to note when fixing that issue?

Thanks in advance for any comments on this.

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Call for translating z3c.form

2008-09-04 Thread Dan Korostelev
Hello, fellow users and developers of zope components!

I just added support for i18n in z3c.form, so it can be now translated
to many languages. If you want to contribute to z3c.form
internationalization, checkout the z3c.form.pot file from the
z3c.form's trunk and translate it to your language, then send back to
me or commit to the repo, if you are a committer.

Thanks!

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Bug in z3c.form.browser.orderedselect

2008-08-06 Thread Dan Korostelev
Hi, people!

In the OrederedSelectWidget's input template there's a little bug in options
displaying. Options (for selectedItems and notSelectedItems) are displayed
using expression like this (simplified):

option tal:content=entry/content /

Which will result in calling entry['content'] if it is callable, which is
true (for example) for the standard zope's Content Types vocabulary from
zope.app.content, because by default the term.value is used for the
content and then, if the term provides ITitleTokenizedTerm it is replaced
with translated term.title. But in the Content Types vocabulary, terms are
not titled, so term.value is used, which is some Interface subclass and
which is callable.

So, as far as I understand, to fix little issue, we need to add the nocall
modifier in the template, so option expression will look like this
(simplifed):

option tal:content=nocall:entry/content /

Thanks!

PS Is there any bug tracking system for z3c.form package (like zope's
general one on launchpad)?

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Versions policy for KGS

2008-04-21 Thread Dan Korostelev
Hi!

I guess this question have been raised before, but I can not find any info
on this. What is the process/policy of version update for the zope 3.4 KGS (
http://download.zope.org/zope3.4/). Does package maintainers should inform
administrator about the update or there's some monitoring system? I am
asking this, because there's some packages that needs to be updated for
sure. I currently can remember just two, but I guess there's more:

 - zope.app.locales - newer versions contains fixes/updates for Russian
(fixes some ugly mistakes), Japanese and Spanish translations for 3.4.
 - zc.recipe.filestorage - contains fix for blobstorage configuration
problem. The version in KGS just produces wrong config snippet if you
specify blob-dir option and so it's unusable.

Currently, I just redefine versions for this packages in my buildout.cfg
files, but I guess they should go in the KGS.

Thanks in advance.

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Catalog add menu item permission.

2007-11-15 Thread Dan Korostelev
Hello.

I wonder why catalog's (zope.app.catalog.catalog.Catalog) addMenuItem has 
zope.ManageContent permission when all other interactions (including simple
__len__ attribute) is restricted to the zope.ManageServices permission. Is
it a bug or I just don't understand something? Right now I just redefine
that addMenuItem in my site configuration, but if it's a bug, I really want
to see it fixed in Zope3 itself. Does anyone knows about this issue?

Thanks!

-- 
WBR, Dan Korostelev
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users