[Zope] Problems with buildout and zope.interface
Hi there! I am trying right now to convince people to use buildout and ZCA for the Open Grid Protocol project but it turns out that it's not working as expected. So maybe somebody on here can help me :-) The setup is Mac OSX 10.5.4 with Python 2.5.1 installed and apparently a zope.interface egg inside the standard install of Python of version 3.3.0. (you can see the contents of the lib dir her: http://pastebin.com/d3f5fb455) On some machines it now seems that this version is used instead of using a newer one the system wide installed one is used (for some reason not on my own machine), so the for instance the testrunner script looks like this: http://pastebin.com/d1a1024d2 (as you can see the standard lib is put into the path but not a separate zope.interface egg). The problem it comes down to when running buildout is the following: http://pastebin.com/d1ec846fa The important lines are probably: # File /Users/tess/pyogp/eggs/zope.security-3.5.1-py2.5-macosx-10.5-i386.egg/zope/security/interfaces.py, line 20, in module # from zope.interface.common.interfaces import IException, IAttributeError # File /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/zope/interface/common/interfaces.py, line 80, in module # classImplements(OverflowWarning, IOverflowWarning) # ZopeXMLConfigurationError: File /Users/tess/pyogp/src/pyogp.lib.base/pyogp/lib/base/configure.zcml, line 6.2-6.55 # ZopeXMLConfigurationError: File /Users/tess/pyogp/eggs/zope.component-3.4.0-py2.5.egg/zope/component/meta.zcml, line 7.4-11.10 # NameError: name 'OverflowWarning' is not defined So zope.component 3.4.0 probably needs zope.interface 3.4.x but installed is 3.3.0. Now my question is: How can I solve this problem. I think I tried to put zope.interface=3.4 into all sorts of places but one outcomes only seemed to be a version conflict saying that 3.3.0 is installed already (unfortunately I also cannot test this myself as in my case it's working). Here is the buildout.cfg: http://svn.secondlife.com/svn/linden/projects/2008/pyogp/buildouts/libdev_mac/trunk/buildout.cfg There also is a setup.py which contains the following dependencies: install_requires=[ 'setuptools', # -*- Extra requirements: -*- 'zope.interface=3.4', 'zope.component [zcml]', 'WebOb', 'wsgiref', 'grokcore.component', ], (http://svn.secondlife.com/svn/linden/projects/2008/pyogp/pyogp.lib.base/trunk/setup.py) And you can find the whole buildout here: http://svn.secondlife.com/svn/linden/projects/2008/pyogp/buildouts/libdev_mac/trunk/ (this is a special version which only runs with Python2.5 and installed a development version of setuptools which I bundled with it because of the problems with subversion 1.5. I suspect though that it also fixed some other bugs as people here constantly seemed to have problems with buildout which now seems to be reason enough to move away from buildout and the Zope Component Architecture). Hope somebody can help :-) Thanks! Christian -- Christian Scholz video blog: http://comlounge.tv COM.lounge blog: http://mrtopf.de/blog Luetticher Strasse 10Skype: HerrTopf 52064 Aachen Homepage: http://comlounge.net Tel: +49 241 400 730 0 E-Mail [EMAIL PROTECTED] Fax: +49 241 979 00 850 IRC: MrTopf, Tao_T neue Show: TOPFtäglich (http://mrtopf.de/blog/category/topf-taglich/) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Problems with buildout and zope.interface
Daniel Nouri wrote: The solution to this one is quite simple: Use virtualenv with --no-site-packages and then use bin/python to run bootstrap.py Ok, thanks. How do I deploy such a thing? I guess virtualenv then has to run by the one setting up his development sandbox? What files can/need to be in subversion? (I never used virtualenv before, only buildout). So my main question is probably: Is there a way to automate the process of installing and running virtualenv similar to what bootstrap.py does for buildout so that people do not need to care about the virtualenv part? -- Christian -- Christian Scholz video blog: http://comlounge.tv COM.lounge blog: http://mrtopf.de/blog Luetticher Strasse 10Skype: HerrTopf 52064 Aachen Homepage: http://comlounge.net Tel: +49 241 400 730 0 E-Mail [EMAIL PROTECTED] Fax: +49 241 979 00 850 IRC: MrTopf, Tao_T neue Show: TOPFtäglich (http://mrtopf.de/blog/category/topf-taglich/) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Problems with buildout and zope.interface
Baiju M wrote: Christian Scholz wrote: Daniel Nouri wrote: The solution to this one is quite simple: Use virtualenv with --no-site-packages and then use bin/python to run bootstrap.py Ok, thanks. How do I deploy such a thing? I guess virtualenv then has to run by the one setting up his development sandbox? What files can/need to be in subversion? (I never used virtualenv before, only buildout). So my main question is probably: Is there a way to automate the process of installing and running virtualenv similar to what bootstrap.py does for buildout so that people do not need to care about the virtualenv part? Use a clean custom built Python. I myself am using this but the opinion of the rest of the group is that it should be as easy as possible to get going without the need to compile custom Pythons etc. I actually second this because losing potential co-developers directly at the beginning would be bad. (I think this is also one the ideas behind buildout: To make setting these things up as easy as possible). So maybe there is a way to solve this :) -- Christian -- Christian Scholz video blog: http://comlounge.tv COM.lounge blog: http://mrtopf.de/blog Luetticher Strasse 10Skype: HerrTopf 52064 Aachen Homepage: http://comlounge.net Tel: +49 241 400 730 0 E-Mail [EMAIL PROTECTED] Fax: +49 241 979 00 850 IRC: MrTopf, Tao_T neue Show: TOPFtäglich (http://mrtopf.de/blog/category/topf-taglich/) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Problems with buildout and zope.interface
Daniel Nouri wrote: Christian Scholz: Daniel Nouri wrote: The solution to this one is quite simple: Use virtualenv with --no-site-packages and then use bin/python to run bootstrap.py Ok, thanks. How do I deploy such a thing? I guess virtualenv then has to run by the one setting up his development sandbox? What files can/need to be in subversion? (I never used virtualenv before, only buildout). So my main question is probably: Is there a way to automate the process of installing and running virtualenv similar to what bootstrap.py does for buildout so that people do not need to care about the virtualenv part? This shell script should help: #!/bin/sh sudo easy_install virtualenv virtualenv . --no-site-packages bin/python bootstrap.py Ok, except that this does not run under windows and it still needs to have easy_install installed. But if there is no existing script, maybe I write one then. I have my custom bootstrap for using the development version of setuptools now already anway. Thanks so far! -- Christian -- Christian Scholz video blog: http://comlounge.tv COM.lounge blog: http://mrtopf.de/blog Luetticher Strasse 10Skype: HerrTopf 52064 Aachen Homepage: http://comlounge.net Tel: +49 241 400 730 0 E-Mail [EMAIL PROTECTED] Fax: +49 241 979 00 850 IRC: MrTopf, Tao_T neue Show: TOPFtäglich (http://mrtopf.de/blog/category/topf-taglich/) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] Possible performance problem in Page Template engine?
Hi everybody! When I was trying to fix portlets in Plone I was wondering why the render() method of my portlet actually gets called multiple times. After a bit of investigation I ended up in the Five product in browser/providerexpressions.py where provider expressions also seem to be called twice for each provider statement. The problem seems to be in Products/PageTemplates/Expressions.py in line 199/200 (in Zope 2.10.4): def evaluateStructure(self, expr): customized version in order to get rid of unicode errors for all and ever text = super(ZopeContext, self).evaluateStructure(expr) return self._handleText(text, expr) This construct seems to evaluate expr twice. One time in evaluateStructure() of the super class which is basically a call to self.evaluate(expr) (to be found in zope/tales/tales.py around line 713: def evaluateStructure(self, expr): return self.evaluate(expr) and then again in _handleText(): def _handleText(self, text, expr): text = self.evaluate(expr) ... I now tried to remove the evaluation of expr in handleText() and in a very simple test using ab on my site I got twice the speed! I might be missing something here of course but if every expression is evaluated twice then this is of course huge performance drain. And of course this fix was just a quick idea without much understanding of the underlying engine (e.g. not knowing if _handleText() is also called from somewhere else etc.) So any Page Template experts here who can confirm this? cheers, Christian -- Christian Scholz video blog: http://comlounge.tv COM.lounge blog: http://mrtopf.de/blog Luetticher Strasse 10Skype: HerrTopf 52064 Aachen Homepage: http://comlounge.net Tel: +49 241 400 730 0 E-Mail [EMAIL PROTECTED] Fax: +49 241 979 00 850 IRC: MrTopf, Tao_T connect with me: http://mrtopf.de/connect ___ 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] Re: Possible performance problem in Page Template engine?
Ok, little correction here: I used ploneout on plone-trunk and it then uses Zope trunk and thus 2.11. This problem seems to be a new problem coming from refactoring: r78767 | andreasjung | 2007-08-12 12:55:45 +0200 (So, 12 Aug 2007) | 4 lines - Collector #2339: ZPT: fixed unicode issue when using the 'structure' directive - ZopeContext: added evaluateStructure() and refactored _handleText() in order to deal with unicode issues when using the 'structure' directive -- christian ___ 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] Re: DTML problem
Hi! Phil Beardmore wrote: I have a problem writing a DTML page. The page will be used to submit data to an SQL database, and the page itself is working great, however I get all of my users to login via an LDAP server using LDAPUserFolder. Once logged in the users can complete a form, click submit and the data is stored (along with their userID and date and time). Problem is, I also want to store the full name (or CN attribute in LDAP tree). I know in ZPT I can use b tal:condition=cnLogged in as: /b font color=#00strongspan tal:replace=cnreplace cn/span/strong/font/span and this works great but I cannot manage to work it out in DTML. Below is my page code (Hope you can help!) Thanks Phil dtml-call REQUEST.set('user',AUTHENTICATED_USER.getUserName()) html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en metal:use-macro=here/main_template/macros/master i18n:domain=plone So what type of file is this? Is it a DTML file or a Page Template? You cannot use both. You need to decide whether you use DTML or TAL and create an file of the correct type accordingly. You though might keep in the TAL space and write tal:block tal:define=dummy python:request.set('user',AUTHENTICATED_USER.getUserName()) / dtml-var user might be straightforward to convert to TAL e.g. tal:attributes=value name (however name is defined.) Though probably you don't need to set it in the request anyway and just can define it as normal variable on top and then use it later. -- christian body div metal:fill-slot=main body bgcolor=#FF table width=100% border=0 td width=80%form name=Add_student_modules method=post action=add_stu_modules_method enctype=multipart/form-data input type=hidden name=userid value=dtml-var user input type=hidden name=datetime value=dtml-var ZopeTime() fmt=fCommon input type=hidden name=name value=dtml-var name table width=90% border=0 cellspacing=0 cellpadding=2 align=center tr td colspan=2 class=standard align=center bgcolor=#D6DBDFstrongSubmit Module Choices/strong/td /tr tr td width=101 bgcolor=#D6DBDFnbsp;/td td width=419nbsp;/td/tr tr td width=101 align=right bgcolor=#D6DBDF class=standardbChoice 1/b/td td width=419 select name=choice1 option value=APC101APC101 - Accounting, Planning and Control/option option value=BUS999BUS999 - Marketing Business Enterprise/option option value=HRM121HRM121 - Human Resource Management/option option value=SIM222SIM222 - Strategy and International Management/option option value=PSY666PSY666 - Psychology/option option value=LAW421LAW421 - Law/option option value=ADM555ADM555 - Administration/option option value=TEC834TEC834 - Technical/option /select/td/tr tr td width=101 align=right bgcolor=#D6DBDF class=standardbChoice 2/b/td td width=419 select name=choice2 option value=APC101APC101 - Accounting, Planning and Control/option option value=BUS999BUS999 - Marketing Business Enterprise/option option value=HRM121HRM121 - Human Resource Management/option option value=SIM222SIM222 - Strategy and International Management/option option value=PSY666PSY666 - Psychology/option option value=LAW421LAW421 - Law/option option value=ADM555ADM555 - Administration/option option value=TEC834TEC834 - Technical/option /select/td/tr td width=101 bgcolor=#D6DBDFnbsp;/td td width=419 input type=submit name=Submit value=Submit input type=reset name=Submit2 value=Clear/td/tr /table /form/td /tr /table /div /body /html ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Zope Foundation Update
Hi! Thanks for this long and balanced post. Far less heated than I (or other hot people of the community) can produce. I hope ZC will take time to answer your legitimate questions... I'd also prefer some answers by some independant people regarding legal topics (as long as it can be told based on the facts). I suppose you'll await some progress on the negotiation before joining us in ZEA... Well, it was explained to me what ZEA is at EP and I was just listening for now ;-) The same is true for the ZF. BTW, do you have the feeling ZEA was trying to steal anything, have you heard of others that would think we tried to ? Well, I cannot look into the heads of people but in general I trust people so when ZEA says they just wanted to protect it, I believe it as I believe that ZC has no evil plans with the TM. I think trying to steal it wouldn't be a good idea anyway and I think that the people at ZEA know this as the publicity of this would be against them (as we see now). Moreover I know some people at ZEA and they seem to be nice guys anyway and not business sharks. Actually it feels a bit like a competition issue between ZC and ZEA and it would be nice if this would be sorted out between them (internally please) as the market is big enough (especially if one party is in the US and the other one in Europe). So about this whole topic actually there are two points: 1. How the issue was handled. IMHO not good on both sides. 2. What the plans with the TM are and what they mean to the Zope community. At least I agree ZEA should have communicated with ZC far earlier. Good :-) -- christian ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Zope Foundation Update
Hi! Andrew Milton wrote: You took someone else's work and claimed it as your own. This is the worst crime you can commit in the Open Source world. I think it's not really a discussion about Open Source here as it should make no difference to the Zope community whether ZC or ZEA is holding the TM. Both don't represent it and both possibly could do harm to it if they just wanted to (which they don't want as I see it). I think it's more a story about a company which some time ago made their software open source. The result of that was a big win for the Zope project as it attracted a lot of developers and, as a result, created a lot of additional projects like Silva, Plone, CPS etc. So now we have quite a big community advocating the use of Zope and now also doing the main development of the software itself (in form of Zope3). I am part of that community and I am proud of that :-) So from Zope having it's roots in that company these problems arise IMHO. So having said that I am a bit disappointed by the recent discussions here as it's maybe the sign of some unresolved problems between certain important players in the Zope world. Some points: - How the thread was started by ZC was IMHO not really good style. For me it sounded like very hard words and threatening with not doing the foundation did not sound too good and not really a good thing for the community. I also still don't understand what the foundation has to do with the actual TM discussion - wasn't it just the logo about which was being discussed? So what would have happened in the case if not ZEA did register it but any evil guy? To hold the creation of the Foundation should not have been the answer in any case! - if ZEA has registered the TM without telling ZC this is of course not ok. I understand if you don't discuss it loudly so that other parties hurry to register it but it could have been solved easily back then with a silent negotiation between the two parties. (too bad ZC did not simply register everything themselves so we would have one discussion less) - in general: Bashing each other will not help Zope and not the community. And a damaged community cannot help ZC or ZEA or any other player in the Zope world. So it should be in everyones interest to keep things going in a good mood. So that much about the form now more about my worries about the TM itself. Legally of course ZC is the right owner of the TMs as they created Zope. But OTOH it would feel more right if the TM would be transferred to the Zope Foundation. ZC once opensourced their project and the main work in terms of coding and marketing seems to be done by the community now and less and less by ZC (at least it seems to me that way). And for me Zope also feels like an open source project through and through and not something belonging to some single company. From what I see that's also the way most of the rest of the world thinks about it, especially in Europe. Thus for me it would just feel better if also the TM would be given to the community in form of the foundation (as the community is no real legal person the foundation might be the next possible thing). I also read about the irrevocable license given to the Zope Foundation and it might make no difference legally for the TM whether ZC or the ZF owns it. But as said before, I am no legal expert and thus I don't know about all the impacts and thus I am worried. So also because of this it would feel better for me if the TM would be owned by the ZF as there are just more checksbalances between their members than there will be with a single player. And hopefully I would at least trust one of them ;-) But maybe somebody can answer me some questions about it anyway: 1. What does the license mean. Does it mean that ZF will also have the right to decide who is allowed what to do with the TM, and even restrict ZC? 2. If ZC might get evil (I don't assume that, btw :-): What might happen with sites like zopelabs or any other site/institution having Zope in it's name. Can they tell them to remove that name? 3. What will happen in this worst case if ZC (or more exactly evil ZC) will suddenly start doing a Java CMS under the name Zope? Can the ZF prevent this? So basically it's not quite clear to me if the license just means that ZF is allowed to use the name or if they also can really protect it. There might always be the possibility to rename the whole project but why should I advocate Zope now if this investment might be lost someday? So because of this discussion I am a bit worried. It might be called irrational fears but I might not be the only one and as many in the community are not fluent in legal things this stuff should be thought about very carefully in order to keep the environment intact as this is what Zope makes alive. (OTOH the community seems not really taking part in that discussion so maybe it's just me who is a bit worried ;-) Finally I would
[Zope] Re: ZSQLMethod conditional insert
Hi! Might something like this help? INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1; So this will catch errors and instead do the update. Available from version 4.1.0 on as the docs say. See also the docs: http://dev.mysql.com/doc/mysql/en/insert.html -- christian PS: I might have misunderstood something ;-) Thomas Olsen wrote: Hi This is probably an FAQ but I haven't been able to find and answer. I need a counter for a certain CMFType and want to store the hits in a MySQL database not to fill up the ZODB. I've checked to two suggestions below but they both use two ZSQLMethods first to check if the URL is already in the table, then to do the actual update or insert. http://www.zope.org/Members/element/Simple_SQL_Page_Counter http://zopelabs.com/cookbook/991116439 I'd like to be able to do that just in one ZSQLMethod for efficiency but I cant seem to figure out a way of doing it. The table is very simple: CREATE TABLE mostread ( path varchar(255) NOT NULL default '', num bigint(20) NOT NULL default '0', dt datetime NOT NULL default '-00-00 00:00:00', PRIMARY KEY (path) ) For now my ZSQLMethod get the argument path which is a relative URL and it looks like this: select @lastval:=num from mostread where dtml-sqltest path type=string dtml-var sql_delimiter update mostread set [EMAIL PROTECTED], dt=now() where dtml-sqltest path type=string; /dtml-if But that naturally only works if there is already a record containing path. What I want to do is something like this (pseudo-code): select @lastval:=num from mostread where dtml-sqltest path type=string dtml-var sql_delimiter dtml-if sequence-length 0 update mostread set [EMAIL PROTECTED], dt=now() where dtml-sqltest path type=string; dtml-else insert into mostread(path, num, dt) values(dtml-sqlvar path type=string, 1, now()) /dtml-if Is there a way of doing this or should I just create that extra ZSQLMethod? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] serialization with Ape
Hi list! :) I am just playing around with Ape (very cool, btw :) and wondering how it can be used from the outside, e.g. not controlled by transactions. Main idea is to manually copy parts of the ZODB to the filesystem (from a product). I first tried the transaction based process, as I found it in some tests: # init (createMapper imported from fsmapper) root_mapper, conns = createMapper(fspath) conn=conns['fs'] resource = StaticResource(root_mapper) storage = ApeStorage(resource, conns) db = ApeDB(storage, resource) get_transaction().begin() # test object to store object = getattr(self,'standard_template.pt') c=db.open() app=c.root()['Application'] id=object.getId() app._setObject(id,object.aq_base,set_owner=0) get_transaction().commit() db.close() which actually stores it but does not seem to me that clean because of all the transaction stuff. I would here then recursively run through all the objects and do that inside one transaction. I then detected the fascades in io.py which I tried to use (dunno if they're thought to be used for such a purpose actually ;-): root_mapper, conns = createMapper(fspath) ei=ExportImport(root_mapper,conns) ei.exportObject(object) Unfortunately this results in an exception Type: MappingError Error Value: Path keychains require a name So can maybe somebody point me to the easiest way to serialize an object using the fsmapper (Shane? ;-) ? I am also interested in reading a serialized object from the fs again and writing it to the fs. Also I wonder if I need to delete objects which have been modified before another export or if there's a possibility to just change it). (and the best would be of course some simple methods for reading/writing a whole directory recursively. I don't know if something like this is already in there somehow or how it works internally.. seems all a bit magic to me ;-) So thanks in advance if anybody can help me :) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] serialization with Ape
Hi! I actually now have a (as it seems) working version of my first approach, just using _setObject() etc. which even works recursively. Has this some drawbacks except it looks a bit like a hack due to the call of commit()? I also have the deserialization working and basically it's just a copying between two ZODBs I'd say. On Wed, Jun 11, 2003 at 10:12:46AM -0400, Shane Hathaway wrote: Christian Scholz wrote: I then detected the fascades in io.py which I tried to use (dunno if they're thought to be used for such a purpose actually ;-): root_mapper, conns = createMapper(fspath) ei=ExportImport(root_mapper,conns) ei.exportObject(object) This is *exactly* the purpose ExportImport is meant for, but it's quite new and unfinished. I'm glad you found it, although it's only in CVS, not in the released version of Ape. Well, I am looking a bit on the repository and was reading log messages ;-) Unfortunately this results in an exception Type: MappingError Error Value: Path keychains require a name So can maybe somebody point me to the easiest way to serialize an object using the fsmapper (Shane? ;-) ? You're on the right track. I wonder what went wrong. I looked into that a bit and in core/io.py line 316 you do return kgen.makeKeychain(event, None, 1) so name is None here as it seems. I just dunno if it's a special case because I was doing something wrong or not ;-) I am also interested in reading a serialized object from the fs again and writing it to the fs. Also I wonder if I need to delete objects which have been modified before another export or if there's a possibility to just change it). Ape will assign new OIDs on import, so you don't have to delete objects first. Well, at least with my first approach I need to do that because I just do a folder._setObject() and this fails then of course. (and the best would be of course some simple methods for reading/writing a whole directory recursively. I don't know if something like this is already in there somehow or how it works internally.. seems all a bit magic to me ;-) Again, ExportImport is designed to do this. Will it also do it recursively? I found out that when I do it via folder._setObject() it will also serialize all content which is quite nice :) What is actually the result of an export? Where in the fs is it stored then? Is the whole path to the object in ZODB is taken ? But thanks for the answer and thanks for Ape! :) -- christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] serialization with Ape
Hi again! Christian Scholz wrote: root_mapper, conns = createMapper(fspath) ei=ExportImport(root_mapper,conns) ei.exportObject(object) Ah-ha, I just realized what went wrong. You need to tell exportObject() where to export. PathKeychainGenerator refused to guess. Try changing the last line to: ei.exportObject(object, keychain=('some/path/under/fspath',)) I now tested it and had the following results: - the last item of the path needs to be the same id as the object has - only objects derived from Objectmanager in the end can be serialized. - they are not written to disk as long as I don't do conns['fs'].vote() conns['fs'].finish() After that it worked quite well :) I now did the import the other way round with obj=ei.importObject(keychain) and then using _setObject with that object in order to store it again in the usual ZODB (Data.fs). Is this ok? Or do I again need to do some copy? It's still obtuse. I'll think about how to make that cleaner. Well, for me the whole thing actually is magic. But maybe it helps if there is an example of usage in the docstring. But it seems working now, so fine :-) Thanks again! Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 crash in select_trigger
Hi! I once had similar problems and as far as I remember also with SuSE 6.4. I think it stopped when using SuSE 7.1 (and 7.0 had the problems, too I think). I was using python 1.5.2 and various Zope versions.. so maybe the pymalloc hint would have worked for me then, too. Actually the crashes were some sort of non deterministic and did not depend on load etc. Unfortunately I don't know any details anymore.. I might test this again sometime and give you a note. (maybe there also some old mails from me in the archive explaining some more details but as I am on a text terminal right now I haven't looked..) greetings! Christian On Tue, Nov 06, 2001 at 12:00:40PM -0800, Mark Mitchell wrote: --On Tuesday, November 06, 2001 02:58:11 PM -0500 Chris McDonough [EMAIL PROTECTED] wrote: Hi mark, Which OS, and which Zope version? I dont have an answer at all right now, but I'd like to start collecting info. If anybody else has this problem, can they also provide platform and Zope version? From the control panel: Zope version: (Zope 2.4.2 (binary release, python 2.1, linux2-x86), python 2.1.0, linux2) Python version: 2.1 (#2, Jun 22 2001, 10:20:42) [GCC 2.7.2.3] System Platform: linux2 The system is SuSE Linux 6.4 with their most recent kernel patch, i.e, the 2.2.19 kernel. -- Mark Mitchell[EMAIL PROTECTED] CodeSourcery, LLChttp://www.codesourcery.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] cycles and mem leaks and Zpatterns..
Hi! As some of you might know, I still have my mem leak problem.. I've now looked again at some code and discovered some cycle in ZPatterns.. Means: I have a Price class and some PriceWinner class, which reference each other via some SkinScript. Could this lead to a leak then? I am not sure at the moment if the backlink to the price is used somewhere.. At least I will try to eliminate it now and maybe replace the price attribute in the winner class by some method which returns the price.. (hope, this is no problem then..) regards, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] memory eating Zope..
Hi! It looks like you're leaking requests. This is often the consequence of setting an attribute on the REQUEST object which is aquisition wrapped. For instance: REQUEST.adtmldoc = REQUEST['PARENTS'][0] When requests leak, references to all the objects referenced within the request (acquisition wrappers, etc.) leak as well. This can be disastrous and gets worse when the site is busy (when there are more requests). ok, that's what I experienced.. the day the site got some more traffic it also suddenly grow memorywise. I also didn't know that doing above is a bad thing to do.. (though I don't actually understand why this is a problem and why it's not freed then.. but on the other hand I am not that much into the inner workings of acquisition ;-) It used to be the case that tracking this problem down was tediously difficult, and involved basically a binary search for leaks in all methods on the site. But now, finding the cause is likely a job for Shane's LeakFinder product: http://www.zope.org/Members/hathawsh/LeakFinder . Ah, will try that out :) And actually I directly found some method which fetches the actual user object from a ZPatterns rack and sets this in the REQUEST at every request. So maybe that's already the problem then.. will try to remove that.. Note that this is likely caused by some sort of brainbending circular reference problem that might be helped by Python 2.X's cyclic garbage collector. Well, will also try out python 2.x then... (btw. are all 2.x python versions working without problems with Zope? Don't want to get a new problem when resolving the old one ;-) Thanks! Christian ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] memory eating Zope..
Hi there! I got another problem with my Zope server and that seems to be a memory hole.. I am using Zope 2.3.2 with Python 1.5.2 now on SuSE 7.0 (this seems to solve the hanging problem, which appeared on 7.1) and I use Python Script, ZSQL methods, ZMySQLDA and ZPatterns. Now using top I see over time how the memory consumption of the zope processes grows, which means I have to restart once a day as it then becomes too slow.. When looking at the refcount in the debug section I see the following: Acquisition.ImplicitAcquirerWrapper: 7509 DocumentTemplate.DT_Util.Eval: 719 Products.ZPatterns.Expressions.Expression: 716 ZPublisher.HTTPRequest.HTTPRequest: 457 ZServer.HTTPResponse.ZServerHTTPResponse: 450 ZPublisher.BaseRequest.RequestContainer: 447 So Acquisition.ImplicitAcquirerWrapper seems to be referenced quite often (this is in an early state..) So does anybody know what this might cause? Or maybe how to track that problem down? (seems to be a long way with that server to become it stable.. ;-) Thanks in advance! Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] dtml-in bug?
Hi! Dunno if it's again my strange setup, but I have some problem with dtml-in or maybe I simply didn't get something right.. Well, I used the following dtml code: html dtml-in expr=[1,2,3,4,5,6] size=4 abr /dtml-in /html and I thought I will get three a's as output.. instead I get 6.. If I do size=3 it's ok (3 output), if I do size=4 or 5 or 6 I get them all.. (actually it happened with some more complex list of Result objects but this seems to do the same here) Can someone explain that to me..? (it's Zope 2.3.2, Python 1.5.2, SuSE Linux 7.0) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] dtml-in bug?
Hi! ok, some more people told me now about it.. ;-) It's not that intuitive nevertheless.. (IMHO) ;-) cheers and thx, Christian On Mon, May 28, 2001 at 05:20:39PM +0200, Tino Wildenhain wrote: Hi Christian, --On Montag, 28. Mai 2001 15:38 +0200 Christian Scholz [EMAIL PROTECTED] wrote: Hi! Dunno if it's again my strange setup, but I have some problem with dtml-in or maybe I simply didn't get something right.. Well, I used the following dtml code: html dtml-in expr=[1,2,3,4,5,6] size=4 abr /dtml-in /html *rustle* try orphan=0 :-) Greetings Tino and I thought I will get three a's as output.. instead I get 6.. If I do size=3 it's ok (3 output), if I do size=4 or 5 or 6 I get them all.. (actually it happened with some more complex list of Result objects but this seems to do the same here) Can someone explain that to me..? (it's Zope 2.3.2, Python 1.5.2, SuSE Linux 7.0) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] getPersistentItemIDs not cooperating?
Hi! It works.. partially. For some reason it looks like getPersistentItemIDs does not always return a *complete* list. I need to run this method several times to completely exhaust the Rack's storage. Thoughts? The only way I ever create Track objects is via a different method that is only accessed once (a long time ago!) Well, I experiences something similar when changing a Racks storage from persistent to non-persistent. The included objects are marked as orphaned then and should be deleted with the Clear-Button. This also works, but only the half of them gets deleted every time I click on that button.. So I also have to press it several times.. Sounds like the same problem.. cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] another Zope hanging..
Hi! Just FYI: The server still hangs once a day and another one is doing the same.. It even does this when simply accessing one page or image over and over again. More precisely I've started the server and did ab -n 10 -c 10 http://foo.bar/we/pics/someimg.gif (ab being the apache benchmarking utility) and after a while I get the broken pipe error. I've also changed my python version to 2.0 and tested it with this but still the same effect. Also changing the server (and thus hardware and system) did not help it. I've also removed the mysqlda from the zope installation but also this did not help.. I will try now to create the smallest version of the site that still hangs.. Dunno if anybody has some idea, I actually have none.. I'll keep you informed.. -- christian PS: strangely it works on the development server but also here I am doing some tests with ab right now.. and this one is still 1.5.2 On Thu, May 03, 2001 at 02:16:30PM -0400, Chris McDonough wrote: Well, my problem might be that in my case most sql statement are done inside some attribute provider of ZPatterns.. This is using ZSQL methods internally but actually those then won't show up I guess.. Even if you weren't using ZPatterns, the error probably wouldn't jump out and say here I am! So I don't think there's much difference between using ZPatterns and not using ZPatterns. The process of detecting when something hangs is just like any other troubleshooting process, it's a matter of exclusion. If you notice that the request named foobargorf/fleafang *always* hangs, you investigate what it does, and try to reproduce it. If it's incidental, so be it, and move on to the next theory. I've also seen that some more recent version of the mysql stuff is around and I am using this now.. The problem's also that I just have a few methods to invoke from the outside which do lots of things by calling other object. Thus I might not really see what's really causing the problem.. I hope though that my upgrade will show some benefit.. The -M log perhaps won't show you the actual operation that's causing the hang, but it will show you the entry point into a routine which causes the hang. It's your job from there to track down the cause. This is just like debugging a program. You get an error somewhere, and you need to track it back to its root, which may be six levels up the call stack buried in some godforsaken regex. ;-) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] another Zope hanging..
Hi! Is there any evidence of any sort of relationship between the broken pipe error and the hang? Do they happen at the same time? Or do they have no discernable relationship with one another? How about memory utilization? Is the process leaking memory? yes, they happen at the same time.. I've also stripped it down and removed evertyhing and put some test.gif up there.. Then running ab against it created again a broken pipe (quite soon). looking via top the memory utilization seems ok.. -- christian PS: with this test.gif it seems to hang very quickly.. PPS: ab tests on my development host are still running without problems.. strange.. - Original Message - From: Christian Scholz [EMAIL PROTECTED] To: Chris McDonough [EMAIL PROTECTED] Cc: Christian Scholz [EMAIL PROTECTED]; Tino Wildenhain [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, May 18, 2001 10:13 AM Subject: Re: [Zope-dev] another Zope hanging.. Hi! Just FYI: The server still hangs once a day and another one is doing the same.. It even does this when simply accessing one page or image over and over again. More precisely I've started the server and did ab -n 10 -c 10 http://foo.bar/we/pics/someimg.gif (ab being the apache benchmarking utility) and after a while I get the broken pipe error. I've also changed my python version to 2.0 and tested it with this but still the same effect. Also changing the server (and thus hardware and system) did not help it. I've also removed the mysqlda from the zope installation but also this did not help.. I will try now to create the smallest version of the site that still hangs.. Dunno if anybody has some idea, I actually have none.. I'll keep you informed.. -- christian PS: strangely it works on the development server but also here I am doing some tests with ab right now.. and this one is still 1.5.2 On Thu, May 03, 2001 at 02:16:30PM -0400, Chris McDonough wrote: Well, my problem might be that in my case most sql statement are done inside some attribute provider of ZPatterns.. This is using ZSQL methods internally but actually those then won't show up I guess.. Even if you weren't using ZPatterns, the error probably wouldn't jump out and say here I am! So I don't think there's much difference between using ZPatterns and not using ZPatterns. The process of detecting when something hangs is just like any other troubleshooting process, it's a matter of exclusion. If you notice that the request named foobargorf/fleafang *always* hangs, you investigate what it does, and try to reproduce it. If it's incidental, so be it, and move on to the next theory. I've also seen that some more recent version of the mysql stuff is around and I am using this now.. The problem's also that I just have a few methods to invoke from the outside which do lots of things by calling other object. Thus I might not really see what's really causing the problem.. I hope though that my upgrade will show some benefit.. The -M log perhaps won't show you the actual operation that's causing the hang, but it will show you the entry point into a routine which causes the hang. It's your job from there to track down the cause. This is just like debugging a program. You get an error somewhere, and you need to track it back to its root, which may be six levels up the call stack buried in some godforsaken regex. ;-) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] another Zope hanging..
Hi! Hm, another strange thing.. I've now tried to start Zope via the normal ./start script. (I've done it via some own script with INSTANCE_HOME set). What I've got was: bash-2.04# ./start -- 2001-05-18T14:59:49 PANIC(300) z2 Startup exception Traceback (innermost last): File /opt/zopeneu/z2.py, line 566, in ? File string, line 1, in ? File /opt/zopeneu/lib/python/Zope/__init__.py, line 94, in ? File /opt/zopeneu/lib/python/ZODB/__init__.py, line 85, in ? ImportError: undefined symbol: PyObject_Init So what does this want to tell me? ;-) I've also done the following before that: - delete Data.fs in my instance home - create a new user - create a folder - put an image (test.gif) into that folder - started the test on that image = hang I've also removed any products I don't need which still have been installed.. -- christian On Fri, May 18, 2001 at 10:49:23AM -0400, Chris McDonough wrote: Is there any evidence of any sort of relationship between the broken pipe error and the hang? Do they happen at the same time? Or do they have no discernable relationship with one another? How about memory utilization? Is the process leaking memory? - Original Message - From: Christian Scholz [EMAIL PROTECTED] To: Chris McDonough [EMAIL PROTECTED] Cc: Christian Scholz [EMAIL PROTECTED]; Tino Wildenhain [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, May 18, 2001 10:13 AM Subject: Re: [Zope-dev] another Zope hanging.. Hi! Just FYI: The server still hangs once a day and another one is doing the same.. It even does this when simply accessing one page or image over and over again. More precisely I've started the server and did ab -n 10 -c 10 http://foo.bar/we/pics/someimg.gif (ab being the apache benchmarking utility) and after a while I get the broken pipe error. I've also changed my python version to 2.0 and tested it with this but still the same effect. Also changing the server (and thus hardware and system) did not help it. I've also removed the mysqlda from the zope installation but also this did not help.. I will try now to create the smallest version of the site that still hangs.. Dunno if anybody has some idea, I actually have none.. I'll keep you informed.. -- christian PS: strangely it works on the development server but also here I am doing some tests with ab right now.. and this one is still 1.5.2 On Thu, May 03, 2001 at 02:16:30PM -0400, Chris McDonough wrote: Well, my problem might be that in my case most sql statement are done inside some attribute provider of ZPatterns.. This is using ZSQL methods internally but actually those then won't show up I guess.. Even if you weren't using ZPatterns, the error probably wouldn't jump out and say here I am! So I don't think there's much difference between using ZPatterns and not using ZPatterns. The process of detecting when something hangs is just like any other troubleshooting process, it's a matter of exclusion. If you notice that the request named foobargorf/fleafang *always* hangs, you investigate what it does, and try to reproduce it. If it's incidental, so be it, and move on to the next theory. I've also seen that some more recent version of the mysql stuff is around and I am using this now.. The problem's also that I just have a few methods to invoke from the outside which do lots of things by calling other object. Thus I might not really see what's really causing the problem.. I hope though that my upgrade will show some benefit.. The -M log perhaps won't show you the actual operation that's causing the hang, but it will show you the entry point into a routine which causes the hang. It's your job from there to track down the cause. This is just like debugging a program. You get an error somewhere, and you need to track it back to its root, which may be six levels up the call stack buried in some godforsaken regex. ;-) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] another Zope hanging..
Hi! Another test without apache inbetween is still running now.. Could apache and it's proxypass be the problem? I am simply using ProxyPass and ProxyPassReverse in front of Zope in a simple virtual site environment.. Apache version is 1.3.19 Where is the bug then? In Zope or in Apache? I also have other servers running like that for ages without problems though it's another host and thus another apache version. cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] another Zope hanging..
Hi! I also now have some problems with a hanging zope. I got something like this in my stupid logfile: 2001-05-03T13:44:39 ERROR(200) ZServer uncaptured python exception, closing channel select-trigger (pipe) at 81d64c8 (exceptions.OSError:[Errno 11] Die Ressource ist zur Zeit nicht verf?gbar [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|poll|83] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|handle_read_event|335] [/opt/Zope-2.3.1-src/ZServer/medusa/select_trigger.py|handle_read|77] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|recv|287] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|recv|475]) Now my question is simply if I can catch this exception somewhere and get some traceback etc. Actually I am quite confused from the inner workings of medusa so I dunno where to start searching. Can anyone help? (I know about the -M logging but unfortunately this does not help that much..) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] another Zope hanging..
Hi! What Python version are you using? That's 1.5.2 MySQLDA is MySQL-python-0.3.3.tar.gz and ZMySQLDA-2.0.4.tar.gz (if this makes any problems..) Zope is 2.3.1 as suerly have noticed.. :) cheers, christian - Original Message - From: Christian Scholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 03, 2001 11:05 AM Subject: [Zope-dev] another Zope hanging.. Hi! I also now have some problems with a hanging zope. I got something like this in my stupid logfile: 2001-05-03T13:44:39 ERROR(200) ZServer uncaptured python exception, closing channel select-trigger (pipe) at 81d64c8 (exceptions.OSError:[Errno 11] Die Ressource ist zur Zeit nicht verf?gbar [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|poll|83] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|handle_read_event|335] [/opt/Zope-2.3.1-src/ZServer/medusa/select_trigger.py|handle_read|77] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|recv|287] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|recv|475]) Now my question is simply if I can catch this exception somewhere and get some traceback etc. Actually I am quite confused from the inner workings of medusa so I dunno where to start searching. Can anyone help? (I know about the -M logging but unfortunately this does not help that much..) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] another Zope hanging..
Maybe another general question: How are exceptions handled which appear in your own products and you don't catch them? Is there some except somewhere on top ? How does this look if you're using ZPatterns with your own attribute providers (as I do with my sql attribute provider). Are these all handled somehow? (usually I get some sort of traceback on the console/stupid log is something goes wrong there and I don't handle it myself.. hope it's in general..) cheers, Christian On Thu, May 03, 2001 at 11:23:54AM -0400, Chris McDonough wrote: What Python version are you using? - Original Message - From: Christian Scholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 03, 2001 11:05 AM Subject: [Zope-dev] another Zope hanging.. Hi! I also now have some problems with a hanging zope. I got something like this in my stupid logfile: 2001-05-03T13:44:39 ERROR(200) ZServer uncaptured python exception, closing channel select-trigger (pipe) at 81d64c8 (exceptions.OSError:[Errno 11] Die Ressource ist zur Zeit nicht verf?gbar [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|poll|83] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|handle_read_event|335] [/opt/Zope-2.3.1-src/ZServer/medusa/select_trigger.py|handle_read|77] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|recv|287] [/opt/Zope-2.3.1-src/ZServer/medusa/asyncore.py|recv|475]) Now my question is simply if I can catch this exception somewhere and get some traceback etc. Actually I am quite confused from the inner workings of medusa so I dunno where to start searching. Can anyone help? (I know about the -M logging but unfortunately this does not help that much..) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] another Zope hanging..
Hi! most problems with hanging zope come from external RDBMS-access. Lots do, but lots don't... You wont see anything useful in the logs because there are some objects published before the *sql-method is hanging. If you see a request come into ZServer, and you see the request go into ZPublisher from ZServer, but ZPublisher never returns any data to ZServer, that's an indication that something is wrong. A SQL method hanging would look like this, it's the same thing as any other Zope component hanging. The big-M log is your friend, even in this case. As a matter of fact, it's *especially* your friend in this case because it will be patterned against one or a few methods, which is an easy problem to track down. Well, my problem might be that in my case most sql statement are done inside some attribute provider of ZPatterns.. This is using ZSQL methods internally but actually those then won't show up I guess.. I've also seen that some more recent version of the mysql stuff is around and I am using this now.. The problem's also that I just have a few methods to invoke from the outside which do lots of things by calling other object. Thus I might not really see what's really causing the problem.. I hope though that my upgrade will show some benefit.. (strangely on my development server these problems did not arise.. might have to check for any differences between the two..) I will keep cheking the -M anyway (as it seems all I can do.. ;-) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns AttributeProvider question
Hi! So here's more :) def _objectAdding(self,client, _tmap={ None:AddedStatus, DeletedStatus:ChangedStatus, ChangedStatus:AddedStatus } ): t = client._getTokenFor(self) s = t.status t.status = _tmap.get(s,s) # we need to do a commit here in order to store the record into the database! # and we need to have it stored as an AttributeFor() of the primary key will # return None otherwise (as this also just makes a query). client.commitSubtransaction() This is broken. Don't do this! commitSubtransaction() is an application-level operation. Only. If you have to use it inside of provider-level code or code called from SkinScript, chances are that you are doing something horribly wrong. You run the risk of causing a recursive commit operation in the Zope transaction machinery. Don't do this! well, it always looked no-good to me, I just didn't know how to solve my problem. So my problem I was trying to fix was actually the following: - When creating a new object via newItem(), the Rack checks if self.loadAttrib is defined before creating a new one. if loadAttrib is returned by the attribute provider then the Rack assumes it already exists and raises an exception. - My Attribute Provider now does not know if an object exists or not before looking into the database (I tried different ways to check it but somehow they haven't worked). So it does that. If it finds a record with the given id it returns it, if not it returns the default value (which means does not exist to the rack). - When adding a new object in my provider it does an insert via an ZSQL method to store it inside the database. This is done in _objectAdded(). Unfortunately this is too late as before this is called, we already need to have it in the database as the request to my primary key will return the default still. So I moved this insert to _objectAdding(). Unfortunately this new record seems not to appear in the database before commit() (dunno why, maybe some new transaction code in ZMySQLDA? haven't checked this). That's why I did a commit() there which then called _objectAdded(). So my problem is basically that I need to know in _AttributeFor() whether this object is already created or not.. I will check now again with asking the status of the client but I think I also tried this before. The best would be to collect all data before _objectAdded() and store it at once and not as it's done now by first creating an empty record and doing the rest via _objectChanged(). But I am open for any other idea :) def _SetAttributeFor(self,client,name,value): Set the attribute and return true if successful # attribs stores the attributes we care about if name in self._attribs.keys(): client._getCache()[name]=value client.__dict__[name]=value; client._p_changed = 1 return 1 return None This also looks broken to me. Why are you changing both the cache and the persistent state? There's no reason to do both. ok, this is old code where I wanted to test some other solution to fix my problem. I will remove the additional line.. (__dict__ might be all I need, it's already a cache if I remember right?!?) I think you're seriously over-engineering this. I don't see anything that you're doing here that couldn't be done more easily with SkinScript statements. If all you want to do is store the data in an SQL database, a few SkinScript triggers would suffice. Well, as mailed yesterday I know this. I've also done this a lot but was then tired of always typing those paramater lists (for each ZSQL method, for each SkinScript call twice, ...). This is of course always the tradeoff between easy to use plugins which are somehow restricted and the more flexible ones which do need lots of configuration. I would like to have the first one for the day-to-day-stuff and the latter for more advanced operations, like linking specialists together etc. Now, if you're trying to get a row to be inserted in an SQL database at the actual time of the newItem() call, there is a trick you can use to do that from SkinScript also. Do this: INITIALIZE OBJECT WITH someAttr1=default1, someAttr2=default2,...,dummyAttributeName=myInsertQuery(primaryKey=self.id) Where myInsertQuery() is an SQL insert query that takes primaryKey as a parameter, and dummyAttributeName is some attribute name you don't care about. You should also set any default values for fields that will be inserted. Your insert query will be called, initializing the row in the database, and then use something like this: WHEN OBJECT ADDED,CHANGED STORE foo,bar,baz USING UpdateMethod(widget_id=self.id, foo_field=self.foo, wbar=self.bar) To update the data at transaction commit time. Voila. No need to make any custom attribute
Re: [Zope-dev] ZPatterns AttributeProvider question
Hi! A little update.. Actually I was mistaken and SetAttributeFor() is called. Just _objectChanged() is not called in that case.. and thus my attributes are not stored to the database. Also commit() is not called at all in this case. It get's called once when the subtranscation is committed but not after some data has changed (which happens after that). Printing _v_status_ in SetAttributeFor() also gives me "Changed", thus this seems right. Maybe some more code will help (just the important pieces): def _objectAdded(self,client): """ store cached data in database """ ... here we do an sql query to insert things in database ... def _objectChanged(self,client): """ store cached data in database """ ... here we do an sql query to update things in database ... def _objectAdding(self,client, _tmap={ None:AddedStatus, DeletedStatus:ChangedStatus, ChangedStatus:AddedStatus } ): t = client._getTokenFor(self) s = t.status t.status = _tmap.get(s,s) # we need to do a commit here in order to store the record into the database! # and we need to have it stored as an AttributeFor() of the primary key will # return None otherwise (as this also just makes a query). client.commitSubtransaction() def _SetAttributeFor(self,client,name,value): """Set the attribute and return true if successful""" # attribs stores the attributes we care about if name in self._attribs.keys(): client._getCache()[name]=value client.__dict__[name]=value; client._p_changed = 1 return 1 return None So _objectChanging() is not overridden, the rest I have ommitted.. So as you also can see I already do a subtransaction commit but it does not seem to help for this problem.. regards, Christian PS: It might also be that I am simply blind ;-) But somehow ZPatterns always confuses me, especially the inner workings ;-) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns AttributeProvider question
Hi! Just a quick note as it's quite late already (more tomorrow): In the early days of ZPatterns, I assumed that I would create SQL providers, LDAP providers, and suchlike gizmos. Later, it became clear that it was more useful to have a simple "glue" language to allow harnessing the full power of Zope in the context of events happening to objects. I still toy with the idea of making an "SQL attribute provider", however, that would be based on the ZSQLMethod object and add some ZPatterns hooks to it, but it's not a big priority. Its main value would be to cut down on some repetitive typing between one's SQL statements and SkinScript statements. Well, exactly this was the intention of programming this as I was a bit bored by all this typing, exactly when the attribute lists are getting longer. So right now I define it once in the ZClass, press the "Read ZCLass propsheet" button and the my attribute provider sets everything up itself.. (it also saves me from typing errors..) Actually I did it with SkinScript before but thought some simple plugin would be nicer.. But thanks for explaining the inner workings in some more detail (maybe I should put this into some howto or so? or it might be put into the ZPatterns wiki..), as this really should help (not only me I guess :) I will comment more on this tomorrow.. (at least I got some idea how I might solve my problem... though I thought this some times before already.. ;-) And the other possible option would be (as Steve suggested once on IRC) to create some wizard which sets up all the SkinScript methods and ZSQL methods in one go.. Anyway, more about it tomorrow. good nite.. Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns AttributeProvider question
Hi! Good evening everybody! I have some question regarding attribute and agent programming for ZPatterns. I have some provider which is registered for the "handlers" and "attributes" methods and some attributes. My problem is when trying to create a new object and directly editing it, e.g. obj=newItem() obj.propertysheets.data.manage_changeProperties(foobar=13) the propertysheet is defined and my provider is also registered for handling the property "foobar". Unfortunately my SetAttributeFor() method is never called. Have you defined a namesForRegistration method in your provider? Yes, as said above it registers for handlers and attributes. Also _objectChanged and _SetAttributeFor() etc. are called. They're just not called directly after creating the object (when being in the same request that is). cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns AttributeProvider question
Good evening everybody! I have some question regarding attribute and agent programming for ZPatterns. I have some provider which is registered for the "handlers" and "attributes" methods and some attributes. My problem is when trying to create a new object and directly editing it, e.g. obj=newItem() obj.propertysheets.data.manage_changeProperties(foobar=13) the propertysheet is defined and my provider is also registered for handling the property "foobar". Unfortunately my SetAttributeFor() method is never called. Also defined in my provider are _objectAdded(), _objectAdding(), _objectChanged() (but not _objectChanging()). Here's what they do: _objectAdded() is storing the data collected via SetAttributeFor() into an sql database as new record _objectAdding() is doing the same as the original method but also committing the transaction as otherwise the new record will not be stored into the database (basically it calls _objectAdded() via the transaction mechanism). I needed to do that as otherwise a getattr on the primary key (==loadAttrib) failed as I try to retrieve the record inside the _AttributeFor() method. _objectChanged() doing the same as objectAdded() but updating the sql database. So what's happening is that _objectAdding() and _objectAdded() get called from the newItem() call but _SetAttributeFor() is not called. When doing the manage_changeProperties() inside a new method which is called manually (and does a getItem()) everything is fine. I've also tried to do obj=newItem() newid=obj.id obj2=getItem(newid) obj2.propertysheets.data.manage_changeProperties(foobar=13) but this also did not call _SetAttributeFor(). So does any ZPatterns wizard has any idea on what I might do wrong? (I can also send someone the source code if this message seems too confusing ;-) regards, Christian Scholz PS: What I am trying to create is an sql attribute provider for ZPatterns which is some replacement for manually creating the zsql method and SkinScript methods. Unfortunately it seems more difficult than I thought at first ;-) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zope nautilus cabal
Hi! Basically, 'access contents information' isn't a great permission. If you turn if off, life gets horrible, if you leave it on, bits hang out. I'd prefer to see something like: - Access Contents Information via HTTP - Access Contents Information via FTP ...etc... This sounds more as if some "external interface" concept is needed, where you can add/disable modules for handling the XMLRPC stuff and the webdav stuff and the normal management interface stuff and the ftp stuff.. And this again also touches the area of model-view again, which seems a bit far away unfortunately .. -- mr topf ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns Attribute Provider Problem
Hi everybody! I am trying to write some attribute provider for storing data inside an SQL table as I am bored of typing parameter lists over and over again (e.g. in every ZSQL method, in every SkinScript method etc.) The problem now is that adding a new row to the table (and thus adding a new object to the rack) is working well but updating an object does not. Basically the main problem is that _objectChanged is not called in my provider. What I did is the following: - If an attribute of the propsheet is changed, _SetAttributeFor is called and stores it into the cache (as I don't want to update the database for every attribute change). - _objectChanged is then supposed to create an sql query and execute it. This - as said - is actually not happening, as the whole method is not called. - My namesForRegistration looks like this: def namesForRegistration(self,container): """ return names for registration """ return { 'provides':('handlers','attributes'), 'getattr': self._attribs.keys(), 'setattr': self._attribs.keys(), 'delattr': self._attribs.keys() } with self._attribs containing the attributes my provider is responsible for. So is there any reason why _objectChanged is not called? Actually I am a bit confused when reading the ZPatterns source which should call it.. ;-) So which are the conditions under which it's supposed to be called? (_objectAdded() as said before is called actually..) I hope someone can help me :) cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] FTP interface being worked on?
Hi! By the way -- is it me, or is the current Import/Export interface broken? I tried to select multiple objects to export, but I can only get the first one to actually be exported. It's not just you.. but never thought about whether this might be a bug ;-) -- christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] More Core Session Tracking Woes :-(
Hi! The setup: -Zope 2.2.4 -Core Session Tracking 0.7 -Cookie session ID manager (path=/,lifetime=0) -Internal Session Data Manager (timeout set to 60 minutes) This seems to randomly (but sometimes very frequently) loose session data items :-( FYI, you are not the only one.. I also experienced that. That's also the reason why I am back to using SQLSession again.. (actually I was too lazy to track it down..) -- mr topf -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] More Core Session Tracking Woes :-(
Hi! FYI, you are not the only one.. I also experienced that. That's also the reason why I am back to using SQLSession again.. How hard was that to swap in? depends. Of course the API is not the same.. So it depends if you've factored out the session stuff in some dtml or python method which you simply have to change. (and if you can factor it out, of course.. I basically just looked one variable up in the session and copied it to REQUEST, so I simply had to change one header file). Also I haven't written a plugin for my Virtual Site Root yet to make use of the Core Session Tracking package so I cannot use it in siterooted environments yet anyway.. cheers, MrT -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Adding a property to a batch of objects ?
Hi! I wanted to do sonething like this: dtml-in "objectIds(['DTML Document']) dtml-call manage_addProperty('foo','bar','string') /dtml-in You might want to use dtml-in "objectValues(['DTML Document'])" (or objectItems). then just say dtml-call "manage_addProperty(...)" or you might change the ... to dtml-call "_.getattr(this(),_['sequence-item']).manage_addProperty(...)" (hope this is right, have not tested it.) First form directly builds a list of the objects instead of the Ids, second form first looks up the id with _['sequence-item'] and then looks up the object with that id in the local object (your folder). Hope this helps.. -- mr topf -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] getPhysicalPath?
Hi! Ahh... thanks Brian. Thats a new one to me :) To me, aswell. Is this documented somewhere? ;-) And can someone explain to us where the differences between aq_chain and getPhysicalPath() are? Actually getPhysicalPath() seems also to walk up aq_parent. Or am I missing something? regards, Christian The aq_chain attribute (computed at time of access) provides a list (in reverse order) of the objects in the acquisition path. Hope this helps! Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Playing with DateTime
Hi! IMHO, the best approach would be to make mxDateTime available separately from DateTime in the _ variable. That would avoid breaking any code, but allow anyone who wanted to use mxDateTime that option from within Zope. I think a product that adds mxDateTime to the _ variable would be your best bet. Well, my opinion, too. On the long run this might get the preferred way of dealing with time stuff so that the use of DateTime gets depreceated. But I guess DC needs to decide this.. I also dunno if there are any problems with mxDateTime being used (e.g. security concerns, whatever) as I havent't looked to closely at this. -- christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZClass propertysheets
Hi! I am just wondering if it's possible to get hold of the properties of a propertysheet of a ZClass without instanciating it. So when instanciating I would just do map=object.propertysheets[1].propertyMap() and get all information of my ZClass instance object. So is this also possible on the class definition? (actually I would assume it is stored somewhere as I can edit it via the management interface. I just didn't manage to get it from the source code..) (next question might be how to get the class when only having a meta type or the path to it.. but I think I will just search the Zope source..) kind regards, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] initializing objects in ZPatterns
Hi! I just encountered another problem with ZPatterns (well not exactly with ZPatterns but the way I use it.. ;-) I have some Specialist with a normal rack which stores data persistently in the ZODB. Everytime I am creating a new object I want to create an object of another specialist on the fly and store it's id inside my first object. Thus I have setup a SkinScript with the following content: INITIALIZE OBJECT WITH company_address=addresses.createAddress() WITH addresses.getItem(self.company_address) COMPUTE company_addr=RESULT STORE company_address IN SELF The createAddress is called actually and it returns the ID of the new object (thus the object is created). Unfortunately the id is not stored inside company_address. After reading the new object again this value is still empty (and thus also no address object is return by the address specialist). Same happens when just using some dummy property and filling it with a fixed string. This also disappears.. To get company_address stored, you can probably do something like: your_object.manage_changeProperties(company_address=your_object.company_address) or possibly your_object.propertysheets.NameOfSheet.manage_changeProperties... depending on what kind of object you're using. You could have this as a trigger: WHEN OBJECT ADDED CALL self.manage_changeProperties(company_address=self.company_address) Well, the first one seems to work, but the SkinScript trigger does not unfortunately. So I will try to incorporate this into my other code (which is a bit more tricky as I automated all the property handling stuff). But thanks anyway! As for whether it is a bug, the implementation of the INITALIZE clause just puts its attributes directly into the DataSkin's attribute-cache. It appears to be designed for the behaviour that you see. You could get the behaviour that you want by making the implementation actually set the attributes instead. I'm not sure what the other implications of doing that are, though. If you're interested, the code is in lib/python/Products/ZPatterns/SkinScript/Components.py about line 71. ok, thanks, will have a look at that. cheers, Christian ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] initializing objects in ZPatterns
Hi! To get company_address stored, you can probably do something like: your_object.manage_changeProperties(company_address=your_object.company_address) or possibly your_object.propertysheets.NameOfSheet.manage_changeProperties... depending on what kind of object you're using. I've now tried WHEN OBJECT ADDED CALL self.propertysheets.data.manage_changeProperties(company_address=self.company_address) which gives me some Unauthorized error on the method call. (when doing it manually in some dtml method after newItem() it works ok, though. And I am logged in as Manager..) Sometimes I wish Zope would print more about the details of such an response, e.g. which permissions might be missing.. Anyway, I will keep experimenting with it (also tried to subclass directly from DataSkin, to override some method which create the company address) but then I noticed that it always needs to be a ZClass (except I would also implement my own Rack, I guess..) Wonder when the basic app will be running.. ;-) ok, nice evening everybody! :) -- christian ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] initializing objects in ZPatterns
Hi! I just encountered another problem with ZPatterns (well not exactly with ZPatterns but the way I use it.. ;-) I have some Specialist with a normal rack which stores data persistently in the ZODB. Everytime I am creating a new object I want to create an object of another specialist on the fly and store it's id inside my first object. Thus I have setup a SkinScript with the following content: INITIALIZE OBJECT WITH company_address=addresses.createAddress() WITH addresses.getItem(self.company_address) COMPUTE company_addr=RESULT STORE company_address IN SELF The createAddress is called actually and it returns the ID of the new object (thus the object is created). Unfortunately the id is not stored inside company_address. After reading the new object again this value is still empty (and thus also no address object is return by the address specialist). Same happens when just using some dummy property and filling it with a fixed string. This also disappears.. So what do I have to do to get it stored? (the other data which is handled via the default plugins is stored and all the attributes are defined inside the ZClass..) Hope, anyone knows how this might be fixed.. regards, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and SQL
Hi! So as the item is an instance of my ZClass containing also an company_name attribute it will always return the item and because of that the Rack thinks it's already there. So why is this happening? What do I need to change? You need to use an attribute which the object has *if and only if* it exists in the database. If the class has the attribute defined, all instances exist, and you can't even load it with SkinScript because ZPatterns uses __getattr__ to redefine attributes, and that doesn't work if the attribute already exists in the class. So I shouldn't define it inside the ZClass propertysheet? Do I understand this right? (I remember having problems when using properties not defined in a sheet somewhere.. or am I mistaken completely somehow? ;-) When changing the loadAttrib to something else (non existing), the newItem is working but instead getItem is not working anymore as it returns None only.. (somehow the zsql method is not even called thus the skinscript seems not to work in that case (I guess because the loadAttrib is not defined in it somewhere)). Right. The load attribute has to be one defined in a provider, and which will end up being "NOT_FOUND" if the object doesn't exist in the table you're querying. I will experiment a little with this information. Hope it helps :) Thanks! -- christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns and SQL
Hi! So I shouldn't define it inside the ZClass propertysheet? Do I understand this right? (I remember having problems when using properties not defined in a sheet somewhere.. or am I mistaken completely somehow? ;-) You can't do this with a load attribute, because a default value will exist. The easiest way to deal with this is simply to have a seperate attribute name just for loading, or use an attribute that isn't on a property sheet. Ok, I now removed customer_id (which won't be set anyway as this is the id set by the database automatically) from the propertysheet and used this as loading attribute. Seems to work now :) (though I am still confused a little, as I tried one non-existing attribute and it didn't work. But this one also was not defined inside the SkinScript and the database). But it's working now, so it's ok :) Thanks again! Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns question
Hi! Well, virtual in the sense as a specialist is no real folder but can provide content from different sources. Thus what I mean is some mechanism which emulates objectIds() etc. so it looks to the user (and the ones using it via dtml) like a normal folder object. Somehow like the Customizer but without the need for actually creating Zope objects. Something inbetween Specialist and Customizer this would be I guess. yeah, this is exactly what I'm after too. I'd like the virtual objects the specialist is responsible for to have normal Zope management screens. Well, I think this shouldn't be too difficult to create. Just a subclass of Specialist and add some Contents-Tab, define objectIds() etc. in the Methods tab and call it in the management screen of "Contents". Though the more advanced things like Copy/Paste/Rename might then not be available.. But for me actually it would be sufficient to get the contents. Also, much mroe trickily, I'd like them to be able to contain each other, although Steve A's __bobo_traverse__ trick might help with this bit... What do you mean? Nesting Specialists (or these virtual folder specialists)? cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns question
Hi! Actually should answer to these posts... ;-) On Thu, Dec 28, 2000 at 03:11:37PM -0500, Steve Spicklemire wrote: Hi Christian, Well, nobody else answered that I saw... so I'll take a crack at your questions "CS" == Christian Scholz [EMAIL PROTECTED] writes: CS Hi there! CS Finally I managed to get a basic understanding of how to do CS things with ZPatterns ;-) So seems quite cool :) (and CS hopefully I find some time to write some basic howto about it) CS But I have some little questions: CS 1. Is it possible to retrieve the set of known IDs from a CS specialist? Or would I need to add my own method to it which CS does this (and change it accordingly if I switch to another CS storage method)? If you store persistently you can use the Rack's method: "defaultRack.getPersistentItemIDs()" Thanks, also found this out in the meanwhile. but a couple of notes: 1) this returns a BTree object, not a simple list, so you can't iterate through it in DTML. You'll need to copy it to a simple list for that.. and 2) If you change to a different storage you'll need to create your own method (ZSQL Method?). What I've found is that if you have a large number of objects you'll either want to query a Catalog, or an SQL database to get Ids that match some criteria that limit the number of hits to something that makes sense to display in a browser. I am now using some method I create inside the specialist for it. CS 2. Is it planned to provide something like a virtual folder CS which acts like a normal object manager but is controlled via CS ZPatterns (so actually something like Folder with Customizer CS Support just without the "anchor" in ZODB. (would also CS require some mechanism asked for in 1.) Hmmm... I'm not sure what you're after here. Why not just use a Specialist? In what sense do you want it to be virtual? Well, virtual in the sense as a specialist is no real folder but can provide content from different sources. Thus what I mean is some mechanism which emulates objectIds() etc. so it looks to the user (and the ones using it via dtml) like a normal folder object. Somehow like the Customizer but without the need for actually creating Zope objects. Something inbetween Specialist and Customizer this would be I guess. (Are you looking for a dynamic traversal interface that would allow you to map URLs to objects that are managed by ZPatterns? Can you give an example?) yes, something like this comes close I guess. e.g. I have some sql database consisting of people's addresses and I want to create some specialist which queries this database (or how ever this specialist is configured right now in order to get the object ids) and shows it as if it's a normal folder. (seems to me more transparent at some point). But I assume it's not suited for all applications e.g. if the number of objects gets a little bigger. And I guess I can create this myself if I subclass from Specialist and add the rest of the ObjectManager's interface to it. CS 3. Is it possible to use ZPatterns also without some exta CS ZClass defined in a Product? At least if I don't need methods CS for my objects but simple want to define the attribute they CS know. Would be nice as I could then hold everything together CS in one place (the specialist that is) without requiring to CS install something also in the Products folder of the Control CS Panel. I believe you need to either create a Python subclass, or a ZClass subclass of DataSkin. "Raw" DataSkins don't have the right permissions to allow for TTW access. If you're creating a 'product' anyway... just make a 'dummy' class that you can use for storage. ok, but I still need to define the attributes I want to handle inside a propertysheet of this ZClass, right? Actually what I would like is something which directly resides inside the Specialist and not somewhere outside in some Product folder. So everything is close together in one place. CS That's it for now, I will keep experimenting then.. :) Good Luck! Oh, it's working better than I thought :) but thanks, christian ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns question
Hi Steve! On Thu, Dec 28, 2000 at 10:45:46PM +, Steve Alexander wrote: Steve Spicklemire wrote: CS 2. Is it planned to provide something like a virtual folder CS which acts like a normal object manager but is controlled via CS ZPatterns (so actually something like Folder with Customizer CS Support just without the "anchor" in ZODB. (would also CS require some mechanism asked for in 1.) Hmmm... I'm not sure what you're after here. Why not just use a Specialist? In what sense do you want it to be virtual? (Are you looking for a dynamic traversal interface that would allow you to map URLs to objects that are managed by ZPatterns? Can you give an example?) Reading this just after reading the source to Specialists.py, I had a thought; and tried it out; and it works! :-) You can use SkinScript to define __bobo_traverse__ for a particular kind of DataSkin in a Specialist. For example: WITH SELF COMPUTE __bobo_traverse__=traversal_method that's very cool :) I just created some base class for this from which my ZClasses are derived but nice to know that it's also possible without this base class. (though for this application it's easier with this base class as it's easier to configure then) cheers, Christian ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope] dtml-if newbie question
HI! I want to select from a select menu, 3 amounts: 1000, 5000 or 1. After this, the form action method should reply: - "this is not much" if 1000 was selected, - "this is ok" if 5000 was selected, - "this is very much" if 1 was selected Now my form method looks like this: form action="form_action" How many money? select name="money" option1000 option5000 option1 /select input type="submit" value="checkit" /form and the form_action method is this: dtml-in money dtml-if "1000" This is not much! /dtml-if dtml-if "5000" This is ok! /dtml-if dtml-if "1" This is very much! /dtml-if /dtml-in I am sure that there is an error in my thinking of these tags. The dtml-in is not right. Use dtml-in if you want to iterate over lists. So in your case you should try: dtml-if "money=='1000'" This is not much! /dtml-if dtml-if "money=='5000'" This is ok! /dtml-if dtml-if "money=='1'" This is very much! /dtml-if (or use dtml-elif in this case) This now makes a string compare as usually form parameters will be passed as strings if you don't tell Zope to do it different. In order to e.g. let it pass integers, you might try in the form: select name="money:int" ... Then you can say dtml-if "money==1000", etc. More information about this "type casting" feature can be found at http://classic.zope.org:8080/Documentation/Reference/ORB cheers, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] zope.org down from Thu Nov 9 12:00:00 GMT 2000 to present?searchable list archive not linked to from mailman page; console-based zope development. list archive not linked to from mailman page; console-based zope development.
Hi! * Colin Leath [EMAIL PROTECTED] [001109 14:00]: I'm trying to figure out ways of managing/developing with Zope from a unix console, using text editors, text browsers and so on. I often work from emacs, accessing the ZODB through the Zope FTP Server on port 8021. The syntax for ange-ftp is /user@localhost 8021:/your/zope/object (you can get the space with C-q space) There is also ZopeShell: http://www.zope.org/Members/sf/zopeshell and e.g. Cadaver if you want to use filetransfer via webdav (but lost the url unfortunately, but from webdav.org you should be able to find it). My problem though with all these things is that the file you edit is not automatically uploaded when you save it. Usually you always have to quit the editor and do an ftp upload yourself as the ftp (or ZopeShell) always work on a local copy of the file and do not notice if you save it (well, how should they do it anyway ;-)) So some sort of ftp filesystem would be nice to have :) cheers Christian ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] redirect
Hi! how to for that function REDIRECT understand a variable. ex. dtml-call "RESPONSE.redirect('http://zope.org/index.htm?cod=dtml-var test')" use dtml-call "RESPONSE.redirect('http://zope.org/index.htm?cod='+test)" with "" you will enter the python scope and thus no dtml syntax is allowed anymore. Instead you have to use python syntax (test should be a string btw, otherwise use _.str(test) to make it one). cheers, Christian ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Content Management System
Hi! I know you can restrict permissions on just about every available method, and I am aware of the current skinnable zope project, which may improve the situation drastically. But I'm interested to know, how many of you offer the Zope TTW interface to clients as a content management system, and how many just use it as a development interface? I'm beginning to wonder if content management and system administration should be split out into separate subsystems. Or if a CMS Tool Kit should be developed. (workflows, syndication, etc...). But I'm still far from being a zope power user myself, and have yet to appreciate the range of its potential. What do you people think? We have some client who use Zope for (at least partly) doing CMS on their site. But these are quite simple (thus no commitments, etc.) When switching from a database centered approach to a more Zope based (e.g. doing it via Zope Products) I actually splitted the management interface in one for the main manager (we) and one more simple and configurable one for the clients (starting with /admin ). I now used it in two subprojects and it seems to work. The only thing I need to think about more specifically is how to factor out the client-side of the management interface more clearly as right now it's very much weaved into the actual classes. Also I am thinking about possibilities to split the actual data from the presentation and to make the presentation pluggable. But this is quite raw at the moment ;-) cheers, Christian ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] some suggestion..
Hi! While trying to code some python Product I had the need for extending manage_delObjects in some Folderlike object. I simply want to call the the ObjectManager's version of it and then do my own stuff afterwards (like deleting some other dependant objects). Unfortunately when calling manage_delObjects() one cannot decide if some error occured or everything went ok as in both cases I get back some string (be it some html formatted error message or the manage_main dialog). So what about splitting these methods in two, e.g. one _delObjects() and one manage_delObjects(). The first one would the the actual work like testing for error conditions and deleting the objects and the other one would be the one called by the management interface. manage_delObjects() would then call _delObjects() and checks for errors afterwards generating some error message or the next dialog. The errors could then be passed via exceptions or similar methods from _delObjects() to manage_delObjects(). This would make subclassing a lot easier and would be at least a start in separating layout from logic. Just an idea :) cheers, Christian PS: Maybe it would even make XMLRPC more usable as there I also get back only html formatted error messages instead of something making more sense for a script (like an error code or something). -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Redirection and Authentication
Hi! I had a little problem and just wanted to ask if someone knows an explanation.. The goal: I want to show a list of newsitems to the user. If an administrator wants to change it he should be able to log in and see the same list but with edit- buttons. The setup is: /folder/list- public accessible dtml method which show the list /folder/edit- protected dtml method The edit method is protected so that the login requester pops up and asks for a passwort. Originally I was simply redirecting back to the list page inside the edit document by dtml-call "RESPONSE.redirect('./list')" (the only line in the document) In list I then check for a login with dtml-if "REQUEST['AUTHENTICATED_USER'].has_permission('whatever',this())" .. show edit button here ... /dtml-if The problem is now that after the Redirect AUTHENTICATED_USER is again set to Anonymous (which I tested by printing AUTHENTICATED_USER). If I do no redirect but put a normal link back to the list document, everything works as expected (thus showing the edit button). So has anyone an explanation? (Version is 2.2.0) (right now I directly include the list again in the edit document by using dtml-var. Works for this little thing but I assume this only being a workaround..) (I also remember having some strange problems with a redirect from python some time ago. Back then it did not commit the database transaction in Oracle. After putting a get_transaction().commit() before the redirect made things work again.) cheers, Christian -- Christian Scholz MrTopf@IRC COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope] Redirecting from Python?
Hi! On Fri, Aug 04, 2000 at 12:49:52PM -0500, Christopher J. Kucera wrote: I'm working on a Product, and I'd like to be able to do a RESPONSE.redirect() from inside the Python code. What I had was basically this: [...] def someConditions(self): if (some number of conditions): return 1 else: self.REQUEST.RESPONSE.redirect('blahblahblah') You actually should use something like this: raise 'Redirect','http://my.server/my/path' -- christian -- Christian Scholz MrTopf@IRC COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reg. ZMySQLDA/MySQLdb-0.1.2 - compile/install ..
Hi! Kindest .. I am having certain problems with the installment of the product. I dl'ed tyhe v1.2.0 that was recently put out.. and all seems to install and compile just fine with no errors reported. Try to use the most recent packages to be found at: http://www.dustman.net/andy/python Don't use any patch or whatever.. This should solve your problems. cheers, Christian -- Christian Scholz MrTopf@IRC COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Session
Hi! On Fri, Jul 28, 2000 at 05:34:52PM -0300, Diego Rodrigo Neufert wrote: Hi, walking trought zope.org I found a lot o Session Managers products like HappySession and SQLSession. Anyone know what's the best Session product for a production site??? I am using SQLSession here and haven't had any problems by now. (using it with cookies and with sessionid in the url). I've heard that someone had problems with FSSession, though. About the rest I dunno anything ;-) -- christian -- Christian Scholz MrTopf@IRC COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] HELP
Hi On Fri, Jul 28, 2000 at 05:08:59PM +0100, Chris Withers wrote: Norman Khine wrote: I have just installed the Zope Server on my NT and have gone through the tutorial about building the Job_Board. All works OK, but I am at a bit of a loss as to HOW I can make the SEARCH open. So that if I just wanted to see say all the jobs with Programmer in the description. I think you're looking for ZCatalog. There are a few how-to's on zope.org For example can I make a wild-card search ie Pr* Sadly, AFAIK, ZCatalog doesn't support this yet :S Hm, wasn't there some discussion about this on the IRC today and did not itamar say that globbing is possible since 2.2 ? (Actually there's also some globbing related stuff in the Source code, especially the vocabulary settings..) cheers, Christian -- Christian Scholz MrTopf@IRC COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hot fix and 2.20
Hi! On Fri, Jul 14, 2000 at 08:19:14PM -0700, michael montagne wrote: Do I have this right? I do not have to install the hot fix if I just installed the recently released version 2.2.0 final. correct? yes, right! -- mr topf ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML?
Hi! Brian Lloyd wrote: snip id is sometimes a method (not always though ;-) This is one of the things on my List Of Evil Things that should be changed one day in Zope3K :) RANT type="angry,frustrated" How about the nasty hacky mess that is DTML? Some priceless artifacts that need to go: dtml-var "someMethod(_, _.None, myparam)" dtml-call "REQUEST.set('keyname','value')" dtml-let x="'hello out there'" dtml-var "_[REQUEST['myDoc']]"What is this supposed to do?! dtml-var "PARENTS[-1].folder.getitem(_.getitem('id',1))" and maybe dtml-var "REQUEST[_['sequence-item']]" Not to mention the horribleness that is dtml-in and dtml-with. There's dtml-tree too, but hopefully I'm going to land very hard on that tomorrow and beat it into something like a decent shape ;-) While I'm at it, how about some docs for the manage_* methods in the interfaces Wiki? /RANT Okay, seriously, DTML is really hurting Zope's chances with a lot of people/companies. DTML should be easier than, say, creating a Form in Lotus Notes or writing a component in Mason. That requries, IMHO: 1. Clear definition of when it should be used. 2. A clean, concise syntax (like Python, DTML is more like Perl right now ;-) 3. Good documentation (much easier to do if 1 and 2 are met...) I also think having Python Methods ship with Zope would really help... Actually I also like it more to code stuff in Python. It's so much easier than to figure out how to do it in DTML. Basically what I like in Zope is the environment you also have in Python Products, like Acquisition. This is quite handy. That's why I try to do most stuff in Python Products then in DTML. But actually this is not one of the main things which were thought about a lot as it's still not that easy to use Products as ZClasses (and be it only the managing of Products.. You might want to have different locations for different products etc. ) And another thing I don't like about DTML is the mixture between code and layout. IMHO this is a bad thing. This is also the reason why I switched from PHP to Python some time ago.. What I would think as more useful is to provide some custom tags by the website developer which the website designer can then use. These should be abstract and clear in meaning. The actual implementating of these tags could then be done separately in maybe Python.. (we had this before.. maybe the XML stuff can help here). The advantage would also be that you can provide quite powerful tags like an easy handling of database forms, etc. (I did this some time ago with pure python.. developing with it is quite fast. One day and you have your basic database frontend with some basic CMS stuff.) But nevertheless for basic tasks a good template language is neccessary. And I agree with Chris that things like the above mentioned make it not that usable/readable. There are niggles (like the rediculous id problem) which you can live with, but doing anything other than the really mundane in DTML means extreme hair loss right now, which is not good. I wonder how many other people would agree with me: nevermind ZEO, or the PTK, ZPatterns or any new fancy functionality. Can we at least have a decent template language that doesn't confuse the hell out of newbies and oldbies alike... yep. PS: Zope: yes it makes the hard things very easy, but it makes the easy things very hard, so it all balances out nicely... ;-) :) -- christian ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZOracleDA and Zope 2.2?
Hi! I am encountering the following problem when using ZOracleDA 2.2.0b1 and Zope 2.2b2/3: When creating a ZOracle Connection and giving the wrong connection string then whole Zopes crashs with OCI_ERROR at oci_8.c:283 ORA-12541: TNS:no listener OCI_ERROR at oci_8.c:283 ORA-12154: TNS:could not resolve service name (this is just a test with no Oracle running). Sometimes it automatically restarts but sometimes not (after the second try). I cannot remember to have this seen in 2.1, so a new bug? (When you give the right string everything is ok) regards, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] The new SiteAccess and __no_before_traverse__?
Hi! I am playing around with SiteAccess and Zope 2.2b1 right now and I wonder if it's still possible to disable SiteAccess (actually an AccessRule) by using __no_before_traverse__? It seems not to and I am a bit trapped right now.. ;-) Even deleting SiteAccess from the Products-Directory didn't work as then Zope encountered a missing doc string error for the directory when trying to access it. Hope, someone can help.. otherwise I might have to use 2.1 again until this is fixed.. regards, Christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: The new SiteAccess and __no_before_traverse__?
Hi! - Original Message - From: "Christian Scholz" [EMAIL PROTECTED] I am playing around with SiteAccess and Zope 2.2b1 right now and I wonder if it's still possible to disable SiteAccess (actually an AccessRule) by using __no_before_traverse__? It seems not to and I am a bit trapped right now.. ;-) This has changed, and I need to make it clearer in the documentation. There is no longer a global "disable all __before_traverse__ hook" URL. Instead, there are specific SiteAccess object-disabling environment variables. Actually I looked up the documentation and there is still mentioned this hook. You need to start Zope with environment variable SUPPRESS_ACCESSRULE set. There is a similar SUPPRESS_SITEROOT variable for SiteRoots. Hm, is there a way of doing this without having to restart Zope. In some environments this might not be the best solution (e.g. if you want to move your application to a production server and have to set up a special SiteRoot and then notices that you mistyped something.. ) Fire up a command shell and type (*nix): SUPPRESS_ACCESSRULE=1 export SUPPRESS_ACCESSRULE Ok, thanks, that's working :) Even deleting SiteAccess from the Products-Directory didn't work as then Zope encountered a missing doc string error for the directory when trying to access it. That's because the fundamental mechanism is built into Zope 2.2, rather than grafted on by SiteAccess 2. It does look like we'd better wrap the hook call in a try..except pass, though. It's a little confusing the way it is right now.. Thanks for the fast answer :) -- christian -- COM.lounge http://comlounge.net/ communication design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope] Please test this Zope 2.2 beta 1 ZSQLMethods fix...
Hi! I think that you have hit it on the head - we're trying *hard* to make Zope harder to fool :^) Try adding the following to your class statement, for example: class MyClass: __allow_access_to_unprotected_subobjects__=1 Just a question: Is this documented somewhere.. I've seen some more of these things here and wonder if there's some explanation what exactly has changed in 2.2 and which constants can be used to control these things.. (well, my classes seem to work under 2.2, so no problem for me right now but one never knows.. ;-) greetings, Christian ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] html templates?
Hi! On Mon, 19 Jun 2000, Christian Scholz wrote: Imagine writing simple html templates with some custom tags which are quite abstract like addresslist. Then write some Python Product (or there might be one Product to make this happen a little simpler) which implements these tags. Insofar as I understood your examples, it sounds a lot like what I think you can do with XML in Zope. I'm not sure I really understood your examples, though (nor have I ever *used* the Zope XML support...) Thanks for the hint, maybe I look into this if this is what I need :) Still I guess I need to do the database support myself.. ;-) -- christian ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] How to call methods of a ZClass superclass?
Hi there! I have a little problem here: I created two ZClasses, where one is derived from the other, let's say A is the superclass and B the subclass. In both classes I created a dtml method called foobar(). Now when I have an instance of B, called b, and I call foobar on it, as in dtml-with b dtml-var "foobar()" /dtml-with and I want to call A's foobar() method inside B's foobar() method, how do I do this? (Actually I have two methods which show forms to fill out and I B's form contains more. So I want to make B's form to show also the contents of A's form without copying the code.. Thus I simply want to call A's method to show his part of the form.) In Python I would write class A: def foobar(self): do something; class B(A): def foobar(self): A.foobar(self) do something more; but with ZClasses it seems to be different (I hope it's possible at all.. ;-) Any ideas? best, Christian ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )