Re: [Zope3-Users] Security Roles and custom authenticators and scarcely-persistent apps (HELP!)
On 4/26/06, Bernd Dorn <[EMAIL PROTECTED]> wrote: > > On 27.04.2006, at 02:44, Jeff Shell wrote: > > > So I spent the day writing an IAuthenticator utility that loads > > principals out of an RDBMS (via a SQLAlchemy mapper based model). I > > got that working. All I want right now is to have my site, > > 'presenters', have view access restricted to the role > > 'app.Presenters'. > > > > The site is persistent and the authenticator is a local utility. I set > > up the site on load to disallow the 'zope.View' and > > 'zope.app.dublincore.view' (not really needed, I guess, since I'm not > > using dublin core anywhere) for the 'zope.Anonymous' role, and allow > > it for 'app.Presenters' and 'zope.Manager'. It's just a simple / > > blanket security policy, I know. But something similar has been in > > place on the Zope 2 based version of this app for a number of years > > now and has worked fine for this use case. > > > > But.. I have no idea how to do this in Zope 3 land. It took me all day > > to write my authenticator, At the end of the day I saw it working in > > so far as it obviously retrieved a user record out of the database, > > validated the password, and returned a dirt simple principal object. I > > could tell this by the login form giving me a different message this > > time ("you're not allowed to do that operation"). I tried looking at > > the Principal-Role map and... I don't understand it. > > just plug your own implementation in > > > provides="zope.app.securitypolicy.interfaces.IPrincipalRoleMap" >for=".interfaces.IYourSiteOrSo" >trusted="true" >/> > > just for granting local roles on the site it's inough to implement > > > > def getRolesForPrincipal(principal_id): > > """Get the roles granted to a principal. > > > > Return the list of (role id, setting) assigned or removed from > > this principal. > > > > If no roles have been assigned to > > this principal, then the empty list is returned. > > """ > > but you have to set your authenticator somewhere, so that you can see > if the principal is from your authenticator by comparing ids Thanks for the response. After some snooping around tonight, I was suspecting that'd be the option to use. But then I decided to try using IGroupedPrincipal instead. So now when my site configurator sets up this particular site/app, it: - Denies permission 'zope.View' to role 'zope.Anybody' - Grants permission 'zope.View' to principal 'presenter.group' My authenticator recognizes that and returns an IGroup. All of the presenters returned have a groups attribute with the value ['presenter.group']. Seems to work so far, and I'm breathing a sigh of relief tonight. Sure beats hoping I don't mess up an IPrincipalRoleMap when I've got so much other work to do and am so far behind as it is. Wheee, life! -- Jeff Shell ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Container base classes
On 26.04.2006, at 21:16, Jachin Rupe wrote: hi there I am new to Zope. I have been spending the last several days reading everything I can find on Zope. So far a lot of the larger examples I've seen use zope.app.container.btree.BTreeContainer any time it is necessary to hold a bunch of other objects. Yet when I looked at the documentation for BTreeContainer it says that I probably shouldn't be using it and should be doing something else. hm, where did you read that? i use BTreeContainer all the time as a base class of my containers and never had any problem Assuming I know enough now to start working on a "real" project, should I be sticking with the stuff in the "persistent" package? Are there other persistent objects hiding somewhere else in the API I should be aware of? thanks -jachin ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Oracle Adapter
Hi. > there is an Oracle database adapter available? Yes, here http://svn.zope.org/cxoracleda/trunk/ -- Yusei Tahara ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Security Roles and custom authenticators and scarcely-persistent apps (HELP!)
On 27.04.2006, at 02:44, Jeff Shell wrote: So I spent the day writing an IAuthenticator utility that loads principals out of an RDBMS (via a SQLAlchemy mapper based model). I got that working. All I want right now is to have my site, 'presenters', have view access restricted to the role 'app.Presenters'. The site is persistent and the authenticator is a local utility. I set up the site on load to disallow the 'zope.View' and 'zope.app.dublincore.view' (not really needed, I guess, since I'm not using dublin core anywhere) for the 'zope.Anonymous' role, and allow it for 'app.Presenters' and 'zope.Manager'. It's just a simple / blanket security policy, I know. But something similar has been in place on the Zope 2 based version of this app for a number of years now and has worked fine for this use case. But.. I have no idea how to do this in Zope 3 land. It took me all day to write my authenticator, At the end of the day I saw it working in so far as it obviously retrieved a user record out of the database, validated the password, and returned a dirt simple principal object. I could tell this by the login form giving me a different message this time ("you're not allowed to do that operation"). I tried looking at the Principal-Role map and... I don't understand it. just plug your own implementation in provides="zope.app.securitypolicy.interfaces.IPrincipalRoleMap" for=".interfaces.IYourSiteOrSo" trusted="true" /> just for granting local roles on the site it's inough to implement def getRolesForPrincipal(principal_id): """Get the roles granted to a principal. Return the list of (role id, setting) assigned or removed from this principal. If no roles have been assigned to this principal, then the empty list is returned. """ but you have to set your authenticator somewhere, so that you can see if the principal is from your authenticator by comparing ids an example from an appllication which i wrote, it assigns roles to homefolders _marker = object() class HomeFolderPrincipalRoleMap(object): """Mappings between principals and roles.""" implements(IPrincipalRoleMap) def __init__(self,context): self.context=context authName = self.context.__parent__.__parent__.authenticator if authName: auth = getUtility(IAuthenticatorPlugin,authName) authPrefix = auth.principalIdPrefix self._prefix = auth.__parent__.prefix+authPrefix else: self._prefix = _marker def getPrincipalsForRole(self,role_id): raise NotImplementedError def getSetting(self,role_id, principal_id): raise NotImplementedError def getPrincipalsAndRoles(self): raise NotImplementedError def getRolesForPrincipal(self,principal_id): """Get the roles granted to a principal. Return the list of (role id, setting) assigned or removed from this principal. If no roles have been assigned to this principal, then the empty list is returned. """ if self._prefix == _marker: return [] if not principal_id.startswith(self._prefix): return [] name = principal_id[len(self._prefix):] if name == self.context.__name__: return [('fhvao.HomeFolderOwner',Allow)] return [] It's very annotations oriented (the default implementation storing data in some internal table-like structure). I, obviously, don't have annotations going on right now. The hard thing is that I can't even figure out at first glance what the different security manager adapters (PrincipalRole, RolePermission, etc) are meant to adapt - a principal? an object? a site? I'm not sure how much of the interface I have to provide, what I should have it adapt (my Site object, I'm guessing?), and so on. All I want to say is "every user returned from this authenticator has the view access for this site". I'm not sure which of these I have to fill in. I'm not wanting to assign every principal coming out of the RDBMS a role mapped in the ZODB - so do I have to straddle both ZODB and RDBMS worlds here? "Mappings between principals and roles" - where? A local object? Globally? Do the answers have to include all answers from higher up the tree if there's anything? Global settings? Am I looking at the wrong thing? class IPrincipalRoleMap(Interface): """Mappings between principals and roles.""" def getPrincipalsForRole(role_id): """Get the principals that have been granted a role. Return the list of (principal id, setting) who have been assigned or removed from a role. If no principals have been assigned this role, then the empty list is returned. """ def getRolesForPrincipal(principal_id): """Get the roles granted to a principal. Return the list of (role id, setting) assigne
[Zope3-Users] Security Roles and custom authenticators and scarcely-persistent apps (HELP!)
So I spent the day writing an IAuthenticator utility that loads principals out of an RDBMS (via a SQLAlchemy mapper based model). I got that working. All I want right now is to have my site, 'presenters', have view access restricted to the role 'app.Presenters'. The site is persistent and the authenticator is a local utility. I set up the site on load to disallow the 'zope.View' and 'zope.app.dublincore.view' (not really needed, I guess, since I'm not using dublin core anywhere) for the 'zope.Anonymous' role, and allow it for 'app.Presenters' and 'zope.Manager'. It's just a simple / blanket security policy, I know. But something similar has been in place on the Zope 2 based version of this app for a number of years now and has worked fine for this use case. But.. I have no idea how to do this in Zope 3 land. It took me all day to write my authenticator, At the end of the day I saw it working in so far as it obviously retrieved a user record out of the database, validated the password, and returned a dirt simple principal object. I could tell this by the login form giving me a different message this time ("you're not allowed to do that operation"). I tried looking at the Principal-Role map and... I don't understand it. It's very annotations oriented (the default implementation storing data in some internal table-like structure). I, obviously, don't have annotations going on right now. The hard thing is that I can't even figure out at first glance what the different security manager adapters (PrincipalRole, RolePermission, etc) are meant to adapt - a principal? an object? a site? I'm not sure how much of the interface I have to provide, what I should have it adapt (my Site object, I'm guessing?), and so on. All I want to say is "every user returned from this authenticator has the view access for this site". I'm not sure which of these I have to fill in. I'm not wanting to assign every principal coming out of the RDBMS a role mapped in the ZODB - so do I have to straddle both ZODB and RDBMS worlds here? "Mappings between principals and roles" - where? A local object? Globally? Do the answers have to include all answers from higher up the tree if there's anything? Global settings? Am I looking at the wrong thing? class IPrincipalRoleMap(Interface): """Mappings between principals and roles.""" def getPrincipalsForRole(role_id): """Get the principals that have been granted a role. Return the list of (principal id, setting) who have been assigned or removed from a role. If no principals have been assigned this role, then the empty list is returned. """ def getRolesForPrincipal(principal_id): """Get the roles granted to a principal. Return the list of (role id, setting) assigned or removed from this principal. If no roles have been assigned to this principal, then the empty list is returned. """ def getSetting(role_id, principal_id): """Return the setting for this principal, role combination """ def getPrincipalsAndRoles(): """Get all settings. Return all the principal/role combinations along with the setting for each combination as a sequence of tuples with the role id, principal id, and setting, in that order. """ -- Jeff Shell ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: development workflow
Jachin Rupe wrote: > hi there > > I'm new to Zope development from the PHP realm. When I worked in PHP I > would, write a little code, save it, refresh the browser and see what > happened. > > Initially I tried to do that in Zope and as you can imagine I decided > very quickly that having to restart Zope after I made every change and > then waiting for it to restart was just not going to work. > > (bunny trail: I've got a 1.67 ghz G4 PowerBook with 1 gig of Ram, is " > root Startup time: 32.328 sec real, 16.860 sec CPU" about where I should > be or am I doing something terribly wrong if it's taking me that long to > start zope?) Nope. I've got a 1.33 G4, so I need about the same amount of time. Of course, you *can* speed up the start up a little bit by disabling all the stuff you don't need. ZCML execution isn't exactly fast, so any package you don't need and can live without, even if it's only for the moment, saves you startup time. > After some reading it sounds like the way to go with Zope is to just > write lots of those "tests", which run much much quicker. So my > development processes looks something like this: > > 1. write code > 2. write tests > 3. run tests > 4 debug > 5. repeat steps 1-4 until there's a whole bunch of new features and I > can't stand not trying them out. > 6. restart zope and try things out. > > Is that how Zope 3 development is supposed to work? This is definitely a good way of reducing the amount of restarts one has to make. Typically, I write at least the basic unit tests for components before I think about their ZCML registration or even starting up Zope. Often, I also write science fiction tests, meaning, I first write a test that illustrates how I'd like the component to behave, and then I implement the component until the tests pass. Either way, writing the basic unit tests definitely will catch "stupid" errors immediately, such as import errors, typos, etc. > Right now I'm concerned about what will happen when I start testing the > security and the design (skin). My guess is there are mechanisms to > write tests to try out the the security settings Of course there are. We call those functional tests and usually write them using a test browser (see zope.testbrowser). For more info on functional tests (though not on the test browser as it's more recent technology), I can refer you to my book, http://worldcookery.com. > but if I makes design > changes I obviously can't look at those via the command line. ZPT pages reload without having to restart Zope, which is a big win during the layouting phase. Philipp ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
RE: [Zope3-Users] development workflow
I'm somewhat of a novice myself and big PHP fan, and I've found the tests just as slow as restarting, and they don't always cover everything the way I expect (although I think this may be due to my ignorance). I spend a lot of time in ZCML and they don't do so well there. I think it is good practice to write tests, but I've not worked up enough expertise to use them effectively, and they therefore impede my development; I suspect my opinion will change in time as I get more proficient. I have found that you can edit page templates without restarting, which helps tremendously. The restart process for me is about 5 seconds, so it's not that bad. I've developed a tremendous amount of code with Zope 3 in the last 3 months and my process is then: 1. write code 2. restart zope 3. repeat > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Jachin Rupe > Sent: Wednesday, April 26, 2006 2:00 PM > To: zope3-users@zope.org > Subject: [Zope3-Users] development workflow > > hi there > > I'm new to Zope development from the PHP realm. When I worked in PHP > I would, write a little code, save it, refresh the browser and see > what happened. > > Initially I tried to do that in Zope and as you can imagine I decided > very quickly that having to restart Zope after I made every change > and then waiting for it to restart was just not going to work. > > (bunny trail: I've got a 1.67 ghz G4 PowerBook with 1 gig of Ram, is > " root Startup time: 32.328 sec real, 16.860 sec CPU" about where I > should be or am I doing something terribly wrong if it's taking me > that long to start zope?) > > After some reading it sounds like the way to go with Zope is to just > write lots of those "tests", which run much much quicker. So my > development processes looks something like this: > > 1. write code > 2. write tests > 3. run tests > 4 debug > 5. repeat steps 1-4 until there's a whole bunch of new features and I > can't stand not trying them out. > 6. restart zope and try things out. > > Is that how Zope 3 development is supposed to work? > > Right now I'm concerned about what will happen when I start testing > the security and the design (skin). My guess is there are mechanisms > to write tests to try out the the security settings but if I makes > design changes I obviously can't look at those via the command line. > Am I going to have to restart zope every-time I tweak something and > want to see how my changes look? Are there good tools and techniques > that will make the "skinning" of zope easier and faster? > > thanks > > -jachin > ___ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] newbie question on i18n
Hi, On Wed, Apr 26, 2006 at 11:14:19AM +0200, Riccardo Tonon wrote: > Hi everybody, > > I'm developing a multilanguage site in Zope 3. > > I've just prepared it to support the i18n based on the browser language. > > I would like also to let the user decide which language to use. (e.g. using a > combo > box present on each page of the site) > > Anybody has an example where I could learn from? I'm developing a multilingual site, too. It works like this: * browser language preferences are usually used to determine favorite language * users can click on one of 3 small flags to override browser preferences with a different language * all data fields on content objects are stored as dictionaries like this: context.sampledata={'de':'Einige Daten','en':'Some Data'} * Data fields are inserted into pagetemplates using a special metal-namespace http://namespaces.zope.org/browser"; xmlns:zope="http://namespaces.zope.org/zope"; xmlns:i18n="http://namespaces.zope.org/i18n"; i18n_domain="mpgsite" > from zope.app.publisher.browser import BrowserView from mpgsite.i18n.browser.tools import getPreferredLanguages from zope.formlib import form from zope.interface import Interface class CookieLanguageSwitchView(BrowserView): """A view that sets a new preferred language by sending a cookie to the user. Presence of this cookie overrides preferred-language settings in the browser. This is useful for systems where the user is unable to control the browser settings.""" def setlanguage(self, language, newurl): response = self.request.response response.setCookie('mpgsite.preferredlanguage', language, path='/') response.redirect(newurl) class GetLanguageView(BrowserView): """Returns the current language selection""" def __call__(self): languages=getPreferredLanguages(self.request) return languages[0] def getClass(self,language): if language == self.__call__(): return 'MpgSelectedLanguage' else: return 'MpgUnSelectedLanguage' class I18NEditView(form.EditForm): schema=Interface def __init__(self,context,request): self.form_fields=form.Fields(self.schema) @form.action("edit") def handle_edit_action(self,action,data): if form.applyChanges(self.context,self.form_fields,data): self.status='Object updated' else: self.status='No changes' def __call__(self): self.update() self.i18nwidgetcontroller=I18NWidgetController(self) self._show_navmenu=False for widget in self.widgets.__Widgets_widgets_list__: widget.i18nwidgetcontroller=self.i18nwidgetcontroller return self.index() from zope.component import adapts from zope.publisher.interfaces.browser import IBrowserRequest from zope.publisher.browser import BrowserLanguages from zope.i18n.interfaces import IUserPreferredLanguages class CookieBrowserLanguages(BrowserLanguages): adapts(IBrowserRequest) def getPreferredLanguages(self): lang = self.request.cookies.get('mpgsite.preferredlanguage', None) if lang is None: languages=super(CookieBrowserLanguages,self).getPreferredLanguages() return languages return [lang] ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] announce: pure ORM for Zope3
Hello! In new branch zsqlmap-project i develop light plugable ORM for Zope3(only!). It's NOT wrapper for sqlobject, but i use sqlobject naming style. Supported: StringCol and other; ForeignKey & MulitpleJoin; AND\OR \BETWEEN\...\LIKE-sql conditions for select\selectBy; Now exist two orm-adapters: for gadfly and postgres, but it's easy develop new orm-adapters and new column-types without 'monkey patching'. Doc-test: https://code.keysolutions.ru/trac/zsqlmap/browser/branches/orm/README.txt ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Container base classes
hi there I am new to Zope. I have been spending the last several days reading everything I can find on Zope. So far a lot of the larger examples I've seen use zope.app.container.btree.BTreeContainer any time it is necessary to hold a bunch of other objects. Yet when I looked at the documentation for BTreeContainer it says that I probably shouldn't be using it and should be doing something else. Assuming I know enough now to start working on a "real" project, should I be sticking with the stuff in the "persistent" package? Are there other persistent objects hiding somewhere else in the API I should be aware of? thanks -jachin ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] development workflow
hi there I'm new to Zope development from the PHP realm. When I worked in PHP I would, write a little code, save it, refresh the browser and see what happened. Initially I tried to do that in Zope and as you can imagine I decided very quickly that having to restart Zope after I made every change and then waiting for it to restart was just not going to work. (bunny trail: I've got a 1.67 ghz G4 PowerBook with 1 gig of Ram, is " root Startup time: 32.328 sec real, 16.860 sec CPU" about where I should be or am I doing something terribly wrong if it's taking me that long to start zope?) After some reading it sounds like the way to go with Zope is to just write lots of those "tests", which run much much quicker. So my development processes looks something like this: 1. write code 2. write tests 3. run tests 4 debug 5. repeat steps 1-4 until there's a whole bunch of new features and I can't stand not trying them out. 6. restart zope and try things out. Is that how Zope 3 development is supposed to work? Right now I'm concerned about what will happen when I start testing the security and the design (skin). My guess is there are mechanisms to write tests to try out the the security settings but if I makes design changes I obviously can't look at those via the command line. Am I going to have to restart zope every-time I tweak something and want to see how my changes look? Are there good tools and techniques that will make the "skinning" of zope easier and faster? thanks -jachin ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Oracle Adapter
I’ve not seen any posts or information on this recently. Does anyone if there is an Oracle database adapter available? -- David Johnson ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] KeyError: Surrogate
Hi Bernd. Personally, I think zope and twisted is a good combination. Are you still running twisted in your installation or are you using zserver for your instances? Had you posted on twisted list to see if this triggered any discussion? I am wondering what it means by surrogate? As in codec surrogate? If this were the case, I wonder why it would not be a decoding error you would receive instead. One kind of surrogate issue is when you have an incomplete byte sequence for a character in a codec. I found this explanation of a problem that appeared in an earlier version of python... Explanation of lone surrogates: In Unicode, a surrogate pair is when you create the representation of a character by using two values. So, for instance, UTF-32 can cover the entire Unicode space (since Unicode is 20 bits, although MvL says it is really more like 21 bits), but UTF-16 can't. To solve the issue for an encoding that cannot cover all possible characters in a single value a character can be represented as a pair of UTF-16 values. The high surrogate cover the high 10 bits while the low surrogate cover the lower 10 bits. High and low surrogates can never be the same since they are defined by a range of possible values and those ranges do not overlap. So with the proper high and low surrogate paired together you can make any possible Unicode character. The problem in Python 2.2.1 is that when there is only a lone surrogate (instead of there being a pair of surrogates), the encoder for UTF-8 messes up and leaves off a UTF-8 value. The following line is an example: >>> u'\ud800'.encode('utf-8') '\xa0\x80' #In Python 2.2.1 '\xed\xa0\x80' #In Python 2.3a0 Notice how in Python 2.3a0 the extra value is inserted so as to make the representation a complete Unicode character instead of only encoding the half of the surrogate pair that the encode was given. Don't know if this is meaninful or not, perhaps this issue has to do with a surrogate of another type in some form of object creation in Zope itself. Regards, David Bernd Dorn wrote: On 26.04.2006, at 16:52, David Pratt wrote: Hi Bernd. This is a bit unsettling. I realize as a practical matter, folks want their sites to run so the recommendation for zserver. It would be good to know what it is causing this problem with twisted. Anyone know how widespread this is. Anyone else with this experience. Hi David Sorry, but I don't know where to place this bug. I thought i was the only one who got it. I asked stephan on the sprint about the cause, he didn't know either, so i thought it was a missconfiguration of my deployment first. I can't reproduce it now. I think it has something to do with files which are not that small e.g. 1MB and multiple requests, but I am not sure. The twisted as default is really annoying, because the option for zserver implies that twisted is more stable. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
RE: [Zope3-Users] debian installation
I figured it out. An admin installed a different version and overrode Debian. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of David Johnson > Sent: Wednesday, April 26, 2006 10:21 AM > To: 'Stéphane Brault'; 'user-list zope' > Subject: RE: [Zope3-Users] debian installation > > This conversation must have jinxed me, because now I cannot install > python2.4-dev. Does anyone know a good apt source for the python2.4-dev > package? Ours depends upon python2.4 (=2.4.1-2), while the current > version of python is 2.4.2, and so we cannot install. > > Our apt list is: > deb http://ftp.us.debian.org/debian/ stable main contrib non-free > deb http://non-us.debian.org/debian-non-US/ stable/non-US main contrib > non-free > deb http://debian.yorku.ca/debian/ stable main contrib non-free > deb-src http://mirrors.usc.edu/pub/linux/distributions/debian/ stable main > deb http://security.debian.org/ stable/updates main contrib non-free > > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > On Behalf Of Stéphane Brault > > Sent: Tuesday, April 25, 2006 7:01 AM > > To: user-list zope > > Subject: Re : [Zope3-Users] debian installation > > > > Thanks Andrius, > > it now works. > > > > Stéphane > > > > > > - Message d'origine > > De : Andrius Armonas <[EMAIL PROTECTED]> > > À : Stéphane Brault <[EMAIL PROTECTED]> > > Cc : user-list zope > > Envoyé le : Lundi, 24 Avril 2006, 10h55mn 23s > > Objet : Re: [Zope3-Users] debian installation > > > > Hi, > > > > you have to install python2.4-dev package. > > > > -- > > Andrius > > > > > > Stéphane Brault wrote: > > > > > Hi, > > > I'm trying to install zope on a debian distribution. ./configure > works > > ok, then when I invoke make > > > I get : > > > /usr/bin/python2.4 install.py -q build > > > error: invalid Python installation: unable to open > > /usr/lib/python2.4/config/Makefile (No such file or directory) > > > make: *** [build] Error 1 > > > I then create a config directory and copy Makefile in it. > > > I relaunch make and get: > > > /usr/bin/python2.4 install.py -q build > > > Traceback (most recent call last): > > >File "install.py", line 29, in ? > > > context.setup() > > >File "/home/Zope-3.2.0/Support/zpkgsetup/setup.py", line 132, in > > setup > > > setup(**kwargs) > > >File "/usr/lib/python2.4/distutils/core.py", line 149, in setup > > > dist.run_commands() > > >File "/usr/lib/python2.4/distutils/dist.py", line 946, in > > run_commands > > > self.run_command(cmd) > > >File "/usr/lib/python2.4/distutils/dist.py", line 966, in > run_command > > > cmd_obj.run() > > >File "/usr/lib/python2.4/distutils/command/build.py", line 112, in > > run > > > self.run_command(cmd_name) > > >File "/usr/lib/python2.4/distutils/cmd.py", line 333, in > run_command > > > self.distribution.run_command(command) > > >File "/usr/lib/python2.4/distutils/dist.py", line 966, in > run_command > > > cmd_obj.run() > > >File "/home/Zope-3.2.0/Support/zpkgsetup/build_ext.py", line 24, in > > run > > > distutils.command.build_ext.build_ext.run(self) > > >File "/usr/lib/python2.4/distutils/command/build_ext.py", line 254, > > in run > > > customize_compiler(self.compiler) > > >File "/usr/lib/python2.4/distutils/sysconfig.py", line 161, in > > customize_compiler > > > cpp = cc + " -E" # not always > > > TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' > > > make: *** [build] Error 1 > > > > > > Any hint ? > > > Thanks, > > > > > > Stéphane > > > > > > > > > ___ > > > Zope3-users mailing list > > > Zope3-users@zope.org > > > http://mail.zope.org/mailman/listinfo/zope3-users > > > > > > > > > > ___ > > Zope3-users mailing list > > Zope3-users@zope.org > > http://mail.zope.org/mailman/listinfo/zope3-users > > ___ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] KeyError: Surrogate
On 26.04.2006, at 16:52, David Pratt wrote: Hi Bernd. This is a bit unsettling. I realize as a practical matter, folks want their sites to run so the recommendation for zserver. It would be good to know what it is causing this problem with twisted. Anyone know how widespread this is. Anyone else with this experience. Hi David Sorry, but I don't know where to place this bug. I thought i was the only one who got it. I asked stephan on the sprint about the cause, he didn't know either, so i thought it was a missconfiguration of my deployment first. I can't reproduce it now. I think it has something to do with files which are not that small e.g. 1MB and multiple requests, but I am not sure. The twisted as default is really annoying, because the option for zserver implies that twisted is more stable. Regards, David Bernd Dorn wrote: On 25.04.2006, at 19:38, ksmith99 wrote: Hi All, I'm using Zope 3.2.0 with Python 2.4.1, this error is popping up and crashing my zope. Does anyone know where I should start looking for problems? i've had the same problem, seems that it has something to do with the twisted server, because on zserver this does not happen workaround: make a zserver instance mkzopeinstance -zserver option Thanks, Ksmith 2006-04-22T20:53:59 ERROR SiteError Exception while getting IExceptionSideEffects adapter Traceback (most recent call last): File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ app/publication/zopepublication.py", line 357, in handleException adapter = IExceptionSideEffects(exception, None) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/interface.py", line 675, in __call__ adapter = self.__adapt__(obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/interface.py", line 742, in __adapt__ adapter = hook(self, obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/ twisted/python/components.py", line 124, in _hook factory = lookup(declarations.providedBy(ob), iface) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/adapter.py", line 401, in lookup1 return self.lookup((required,), provided, name, default) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/adapter.py", line 333, in lookup byname = s.get(provided) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/adapter.py", line 253, in get self.clean() File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/adapter.py", line 159, in clean base.unsubscribe(self) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/adapter.py", line 280, in unsubscribe raise KeyError(dependent) KeyError: 0x42340bac>)> -- 2006-04-22T22:08:59 ERROR SiteError http://www.edwardmontgomeryfineart.com/artists/anne_blair_brown/ ArtCollection/lunch_break/@@viewart/thumbnail Traceback (most recent call last): File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ publisher/publish.py", line 138, in publish result = publication.callObject(request, object) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ app/publication/zopepublication.py", line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ publisher/publish.py", line 113, in mapply return debug_call(object, args) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ publisher/publish.py", line 119, in debug_call return object(*args) File "/home/admin/myzope/z1/lib/python/gallerymaker/browser/ photo.py", line 76, in __call__ image.contentType) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ security/checker.py", line 475, in check self._checker2.check(object, name) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ app/securitypolicy/zopepolicy.py", line 278, in checkPermission if not self.cached_decision( File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ app/securitypolicy/zopepolicy.py", line 92, in cached_decision decision = self.cached_prinper(parent, principal, groups, permission) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ app/securitypolicy/zopepolicy.py", line 138, in cached_prinper prinper = IPrincipalPermissionMap(parent, None) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/interface.py", line 675, in __call__ adapter = self.__adapt__(obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/ interface/interface.py", line 742, in __adapt__ adapter = hook(self, obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/ twisted/python/components.py", line 124, in _h
RE: [Zope3-Users] debian installation
This conversation must have jinxed me, because now I cannot install python2.4-dev. Does anyone know a good apt source for the python2.4-dev package? Ours depends upon python2.4 (=2.4.1-2), while the current version of python is 2.4.2, and so we cannot install. Our apt list is: deb http://ftp.us.debian.org/debian/ stable main contrib non-free deb http://non-us.debian.org/debian-non-US/ stable/non-US main contrib non-free deb http://debian.yorku.ca/debian/ stable main contrib non-free deb-src http://mirrors.usc.edu/pub/linux/distributions/debian/ stable main deb http://security.debian.org/ stable/updates main contrib non-free > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Stéphane Brault > Sent: Tuesday, April 25, 2006 7:01 AM > To: user-list zope > Subject: Re : [Zope3-Users] debian installation > > Thanks Andrius, > it now works. > > Stéphane > > > - Message d'origine > De : Andrius Armonas <[EMAIL PROTECTED]> > À : Stéphane Brault <[EMAIL PROTECTED]> > Cc : user-list zope > Envoyé le : Lundi, 24 Avril 2006, 10h55mn 23s > Objet : Re: [Zope3-Users] debian installation > > Hi, > > you have to install python2.4-dev package. > > -- > Andrius > > > Stéphane Brault wrote: > > > Hi, > > I'm trying to install zope on a debian distribution. ./configure works > ok, then when I invoke make > > I get : > > /usr/bin/python2.4 install.py -q build > > error: invalid Python installation: unable to open > /usr/lib/python2.4/config/Makefile (No such file or directory) > > make: *** [build] Error 1 > > I then create a config directory and copy Makefile in it. > > I relaunch make and get: > > /usr/bin/python2.4 install.py -q build > > Traceback (most recent call last): > >File "install.py", line 29, in ? > > context.setup() > >File "/home/Zope-3.2.0/Support/zpkgsetup/setup.py", line 132, in > setup > > setup(**kwargs) > >File "/usr/lib/python2.4/distutils/core.py", line 149, in setup > > dist.run_commands() > >File "/usr/lib/python2.4/distutils/dist.py", line 946, in > run_commands > > self.run_command(cmd) > >File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command > > cmd_obj.run() > >File "/usr/lib/python2.4/distutils/command/build.py", line 112, in > run > > self.run_command(cmd_name) > >File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command > > self.distribution.run_command(command) > >File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command > > cmd_obj.run() > >File "/home/Zope-3.2.0/Support/zpkgsetup/build_ext.py", line 24, in > run > > distutils.command.build_ext.build_ext.run(self) > >File "/usr/lib/python2.4/distutils/command/build_ext.py", line 254, > in run > > customize_compiler(self.compiler) > >File "/usr/lib/python2.4/distutils/sysconfig.py", line 161, in > customize_compiler > > cpp = cc + " -E" # not always > > TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' > > make: *** [build] Error 1 > > > > Any hint ? > > Thanks, > > > > Stéphane > > > > > > ___ > > Zope3-users mailing list > > Zope3-users@zope.org > > http://mail.zope.org/mailman/listinfo/zope3-users > > > > > ___ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] KeyError: Surrogate
On 4/26/06, David Pratt <[EMAIL PROTECTED]> wrote: > Hi Bernd. This is a bit unsettling. I realize as a practical matter, > folks want their sites to run so the recommendation for zserver. It > would be good to know what it is causing this problem with twisted. > Anyone know how widespread this is. Anyone else with this experience. The only unsettling thing is that twisted became the default by mistake in 3.2. It's actually suprising how well it works, considering what a huge change it is. :) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] KeyError: Surrogate
Hi Bernd. This is a bit unsettling. I realize as a practical matter, folks want their sites to run so the recommendation for zserver. It would be good to know what it is causing this problem with twisted. Anyone know how widespread this is. Anyone else with this experience. Regards, David Bernd Dorn wrote: On 25.04.2006, at 19:38, ksmith99 wrote: Hi All, I'm using Zope 3.2.0 with Python 2.4.1, this error is popping up and crashing my zope. Does anyone know where I should start looking for problems? i've had the same problem, seems that it has something to do with the twisted server, because on zserver this does not happen workaround: make a zserver instance mkzopeinstance -zserver option Thanks, Ksmith 2006-04-22T20:53:59 ERROR SiteError Exception while getting IExceptionSideEffects adapter Traceback (most recent call last): File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/app/publication/zopepublication.py", line 357, in handleException adapter = IExceptionSideEffects(exception, None) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/interface.py", line 675, in __call__ adapter = self.__adapt__(obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/interface.py", line 742, in __adapt__ adapter = hook(self, obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/twisted/python/components.py", line 124, in _hook factory = lookup(declarations.providedBy(ob), iface) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 401, in lookup1 return self.lookup((required,), provided, name, default) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 333, in lookup byname = s.get(provided) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 253, in get self.clean() File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 159, in clean base.unsubscribe(self) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 280, in unsubscribe raise KeyError(dependent) KeyError: )> -- 2006-04-22T22:08:59 ERROR SiteError http://www.edwardmontgomeryfineart.com/artists/anne_blair_brown/ArtCollection/lunch_break/@@viewart/thumbnail Traceback (most recent call last): File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/publisher/publish.py", line 138, in publish result = publication.callObject(request, object) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/app/publication/zopepublication.py", line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/publisher/publish.py", line 113, in mapply return debug_call(object, args) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/publisher/publish.py", line 119, in debug_call return object(*args) File "/home/admin/myzope/z1/lib/python/gallerymaker/browser/photo.py", line 76, in __call__ image.contentType) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/security/checker.py", line 475, in check self._checker2.check(object, name) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/app/securitypolicy/zopepolicy.py", line 278, in checkPermission if not self.cached_decision( File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/app/securitypolicy/zopepolicy.py", line 92, in cached_decision decision = self.cached_prinper(parent, principal, groups, permission) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/app/securitypolicy/zopepolicy.py", line 138, in cached_prinper prinper = IPrincipalPermissionMap(parent, None) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/interface.py", line 675, in __call__ adapter = self.__adapt__(obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/interface.py", line 742, in __adapt__ adapter = hook(self, obj) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/twisted/python/components.py", line 124, in _hook factory = lookup(declarations.providedBy(ob), iface) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 401, in lookup1 return self.lookup((required,), provided, name, default) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 333, in lookup byname = s.get(provided) File "/home/admin/downloads/Zope-3.2.0/build/lib.linux-i686-2.4/zope/interface/adapter.py", line 253, in get self.clean() File "/home/admin/downloads/Zope-3.2.0/build/lib.linu
Re: [Zope3-Users] newbie question on i18n
--On 26. April 2006 11:14:19 +0200 Riccardo Tonon <[EMAIL PROTECTED]> wrote: Hi everybody, I'm developing a multilanguage site in Zope 3. I've just prepared it to support the i18n based on the browser language. I would like also to let the user decide which language to use. (e.g. using a combo box present on each page of the site) Look at PloneLanguageTool and/or LinguaPlone. -aj -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope & Plone development, Consulting pgpyImroX5xQy.pgp Description: PGP signature ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] newbie question on i18n
Hi everybody, I'm developing a multilanguage site in Zope 3. I've just prepared it to support the i18n based on the browser language. I would like also to let the user decide which language to use. (e.g. using a combo box present on each page of the site) Anybody has an example where I could learn from? Thank You, Ricki ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Debugger for Zope 3
On 4/26/06, Stephan Richter <[EMAIL PROTECTED]> wrote: > WingIDE's debugger is superb. Once you set the thread count to 1 it should > work. At some point we'll have to write a small package that installs the > debugger hook automatically. For now duplicating the Zope 2 steps and the > Zope 2 product is the way to go. You don't happen to have that code somewhere? I could probably mold it into a product, and would really like it. Figuring out what the WingDBG product really does is gonna take me way to much time. :) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re[2]: [Zope3-Users] Debugger for Zope 3
Hi, If we are coming to commercial IDEs then Komodo is also a good choice for debugging. You just have to put it's dbgp module on the PYTHONPATH and use the below small script to avoid some irritating deprecation mesages. After this, you put brk() in you code and it will stop there. After it was stopped for the first with brk() the debugger will obey all 'normal' breakpoints. I think it supports threading also but never tried it. import zope.deprecation from dbgp.client import brk as dbgpbrk def brk(): zope.deprecation.__show__.off() dbgpbrk() Wednesday, April 26, 2006, 9:58:52 AM, you wrote: > On Tuesday 25 April 2006 08:27, Achim Domma wrote: >> I would like to start Zope 3 with the debugger, set some breakpoints in >> my modules and step through the code to learn more about Zope. > WingIDE's debugger is superb. Once you set the thread count to 1 it should > work. At some point we'll have to write a small package that installs the > debugger hook automatically. For now duplicating the Zope 2 steps and the > Zope 2 product is the way to go. > Regards, > Stephan -- Best regards, Adammailto:[EMAIL PROTECTED] -- Quote of the day: "Oh, Aunty Em, it's so good to be home!" ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Debugger for Zope 3
On Tuesday 25 April 2006 08:27, Achim Domma wrote: > I would like to start Zope 3 with the debugger, set some breakpoints in > my modules and step through the code to learn more about Zope. WingIDE's debugger is superb. Once you set the thread count to 1 it should work. At some point we'll have to write a small package that installs the debugger hook automatically. For now duplicating the Zope 2 steps and the Zope 2 product is the way to go. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users