[Zope-Coders] Zope tests: 8 OK
Summary of messages to the zope-tests list. Period Wed Jun 22 11:01:02 2005 UTC to Thu Jun 23 11:01:02 2005 UTC. There were 8 messages: 8 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:22:43 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002415.html Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:24:14 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002416.html Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:25:44 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002417.html Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:27:14 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002418.html Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:28:44 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002419.html Subject: OK : Zope-2_8-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:30:14 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002420.html Subject: OK : Zope-trunk Python-2.3.5 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:31:44 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002421.html Subject: OK : Zope-trunk Python-2.4.1 : Linux From: Zope Unit Tests Date: Wed Jun 22 23:33:14 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-June/002422.html ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
Re: [Zope] From Zope 2.5.1 to Zope 2.7.6
On 6/22/05, Tim Suter [EMAIL PROTECTED] wrote: FWIW, here's the output of the old 2.5.1 install: ... So that tells me that there are many dependent on bobobase_modification_time. What does that mean and what do I need to do about it? It is completely wrong to rely on bobobase_modification_time because that value changes when the object storage changes. It's much better to use something like 'last_modified_date' that you control yourself in your own code. What happens when you import any object is that bobobase_modification_time gets set to today() which might make all your objects appear to be unordered because every time you refresh (now on you zope276) they seem to jump around from place to place. Solution is nasty but straight forward at least. On your (zope 2.5.1), this product that you have instanciated as Knowledge, Argyle and Helpdesk, do you have control over it's source code? Assuming it's a python product it might look something like this:: class MyProduct(Folder): meta_type = 'My Product' def __init__(self, id, title): self.id = id self.title = title def getModTime(self): return self.bobobase_modifiation_time() Now, what you need to do is tocopy the bobobase_modification_time to a new attribute. class MyProduct(Folder): meta_type = 'My Product' def __init__(self, id, title): self.id = id self.title = title self.last_modified_date = DateTime() def getModTime(self): return self.last_modified_date def upgrade(self): self.last_modified_date = self.bobobase_modification_time() And somewhere else you need to have a serious python script that loops through all instances and runs upgrade() on each. Something like this: for instance in context.objectValues('My Product'): instance.upgrade() Good luck Thanks much for your assistance; Tim On Wed, 2005-06-22 at 17:33 +0100, Peter Bengtsson wrote: Try something like this: $ cd zopehome/Products/ $ grep -rn bobobase_modification_time . That will tell you if any of your diskbased python products rely on bobobase_modification_time On 6/22/05, Tim Suter [EMAIL PROTECTED] wrote: Excuse the newbie question, but how would I find that out? I inherited this 'project' of upgrading Zope and migrating the data. I have had NO help with it so I have been banging through it all the way. Thanks, Tim On Wed, 2005-06-22 at 16:22 +0100, Peter Bengtsson wrote: Are any of your applications relying on the 'bobobase_modification_time' attribute? That's something that changes when you import a .zexp file which could maybe explain why things appear differently now. On 6/22/05, Tim Suter [EMAIL PROTECTED] wrote: I am upgrading our current Zope from 2.5.1 to Zope 2.7.6. I have the new version installed as a different instance on a different server. The Zope 2.5.1 is in tact and what I am wondering is, how do you migrate everything from the older to the newer? I thought exporting the .zexp out of Zope 2.5.1 would be ok. However, when I import it into the new install, it isn't the same as the original. For example, I exported knowledge.zexp from the 2.5.1 and imported into the 2.7.6. Now, when I go to pull up the page that points to info related to this data, the subtopics are now listed below the contents of the original page. In looking at the html (I am no HTML expert at ALL), it did not appear that there was even anything related to subtopics. It must be a control from within the Zope management interface. I guess I just want to know how to migrate properly with little administrative effort. Thanks, Tim ___ 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 ) -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ 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] problems with testing (PloneMailBoxer)
Hi there, I have a problem testing PloneMailBoxer I am using the Method added at the end getter = self.getProperty('getter') getterHandler = self.unrestrictedTraverse(getter, default=None) Calling the method in a test case I allways get None. In a real Plone setup it works fine. can somebody tell me why that is so? (Or where to look for a solution) thanks Robert security.declareProtected('Access contents information', 'getValueFor') def getValueFor(self, key): # Returns value for property; # if available, a dynamic getter will be used # we can not use MailBoxers getValueFor since # it does not work with skin elements on the FS getter = self.getProperty('getter') if getter: getterHandler = self.unrestrictedTraverse(getter, default=None) if getterHandler is not None: try: result = getterHandler(key) if result is not None: return result except: pass # Our stored properties are the default return self.getProperty(key) ___ 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] ZopeProfiler and Zope 2.8.0
Hi, I would like to know if anyone has tried using ZopeProfiler (1.4 version from http://www.dieter.handshake.de/pyprojects/zope/) with Zope 2.8.0 It was working fine with Zope 2.7.6 but it appears to cause the instance to hang with Zope 2.8.0... Thanks. Pascal ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ___ 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] Cached Variables
Hi, I am developing an application that is a front end to an RDBMS. Sometimes, when loading a page, several scripts get called that all require the same information from the database. It would obviously be costly for each script to call the same ZSQL method. My method for avioiding this senario is... Get the scripts to call another script that is a wrapper to the ZSQL method. This wrapper script returns context.REQUEST[value_name] if it exists or, if it does not exist, executes the ZSQL method, stuffs the result into REQUEST[value_name] and then returns it. I am not convinced that this is the right way of dealing with this situation however. Is there a better way? Thanks, Calisp ___ 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 )
Re: [Zope] Cached Variables
+---[ [EMAIL PROTECTED] ]-- | Hi, | | I am developing an application that is a front end to an RDBMS. | Sometimes, when loading a page, several scripts get called that all | require the same information from the database. It would obviously be | costly for each script to call the same ZSQL method. My method for | avioiding this senario is... ZSQL Methods can do their own caching... you can set it from the Advanced Tab of the ZSQL Method. This should eliminate the overhead of multiple calls. -- Andrew Milton [EMAIL PROTECTED] ___ 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 )
Re: [Zope] Cached Variables
On 23/06/05, Andrew Milton [EMAIL PROTECTED] wrote: +---[ [EMAIL PROTECTED] ]-- | Hi, | | I am developing an application that is a front end to an RDBMS. | Sometimes, when loading a page, several scripts get called that all | require the same information from the database. It would obviously be | costly for each script to call the same ZSQL method. My method for | avioiding this senario is... ZSQL Methods can do their own caching... you can set it from the Advanced Tab of the ZSQL Method. This should eliminate the overhead of multiple calls. Ah, nice. Setting it to a second should do the job in this case. Ideally I'd like it doing it on a per request basis though. ___ 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 )
Re: [Zope] Cached Variables
+---[ [EMAIL PROTECTED] ]-- | On 23/06/05, Andrew Milton [EMAIL PROTECTED] wrote: | +---[ [EMAIL PROTECTED] ]-- | | Hi, | | | | I am developing an application that is a front end to an RDBMS. | | Sometimes, when loading a page, several scripts get called that all | | require the same information from the database. It would obviously be | | costly for each script to call the same ZSQL method. My method for | | avioiding this senario is... | | ZSQL Methods can do their own caching... you can set it from the Advanced Tab | of the ZSQL Method. This should eliminate the overhead of multiple calls. | | Ah, nice. Setting it to a second should do the job in this case. | Ideally I'd like it doing it on a per request basis though. Yeah, a method to clear the cache would be nice (it's a simple matter of clearing the _v_cache attribute). But, a short-ish time for caching should cover most cases (unless there's a lot of updating/inserting that could possibly invalidate the result set). -- Andrew Milton [EMAIL PROTECTED] ___ 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 )
Re: [Zope] Cached Variables
Use the Z SQL Method cache if you can. The important difference is that the z sql method cache is for all people whereas the REQUEST is just for one person. Generic SQL: SELECT COUNT(*) FROM documents; Personal SQL: SELECT COUNT(*) FROM documents WHERE uid=dtml-sqlvar your_username type=string On 6/23/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I am developing an application that is a front end to an RDBMS. Sometimes, when loading a page, several scripts get called that all require the same information from the database. It would obviously be costly for each script to call the same ZSQL method. My method for avioiding this senario is... Get the scripts to call another script that is a wrapper to the ZSQL method. This wrapper script returns context.REQUEST[value_name] if it exists or, if it does not exist, executes the ZSQL method, stuffs the result into REQUEST[value_name] and then returns it. I am not convinced that this is the right way of dealing with this situation however. Is there a better way? Thanks, Calisp ___ 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 ) -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ 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] Using Zope to Manage an Asset Inventory Database
I run a local area network of about 200 Microsoft Windows based workstations and about 15 servers. The inventory consists of various pieces of information (make, model, serial number ...) relating to CPU, monitor, keyboard etc. At the present time, the computer inventory is maintained using an Excel spreadsheet. I would like to move/convert this inventory information into Zope, but I am having some difficulty in making the transition. My thinking is to have a hierarchy of objects. A CPU object, monitor object, keyboard object, tape drive, disk drives, etc. Some CPUs and monitors are spares and sit in a storage room. I would like to be able to use Zope and the ability to cut and paste objects to manage this information. If a monitor on a working CPU fails, I would like to be able to launch Zope, find the monitor, remove it from the existing system, pick one from the storage area and logically attach it to the working CPU. In addition, I would like to be able to generate reports/lists for auditing purposes. root |-- storage area | - monitor | - monitor | - cpu | - keyboard |-- room 1 | - system 1 |- cpu |- monitor |- keyboard | -system 2 |- cpu |- monitor |-keyboard |-- room 2 | - system 3 |- cpu |- monitor |- keyboard |-- room 3 | - system 4 |- cpu |- monitor |- keyboard I have been looking for examples of how this is done within Zope, but I have not found any working examples. Any thoughts on how to implement a system like this would be much appreciated. -- John W. Spann 410.765.4427 (Work) 410.232.0730 (Pager) Text Message: [EMAIL PROTECTED] ___ 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 )
Re: [Zope] Using Zope to Manage an Asset Inventory Database
On 6/23/05, Spann, John W. [EMAIL PROTECTED] wrote: I have been looking for examples of how this is done within Zope, but I have not found any working examples. Any thoughts on how to implement a system like this would be much appreciated. Interesting idea, and, well, you pretty much explained how to do it yourself, so... What's your question? And do you want to use Zope2 och Zope3. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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 )
Re: [Zope] Using Zope to Manage an Asset Inventory Database
- Original Message - From: Spann, John W. [EMAIL PROTECTED] My thinking is to have a hierarchy of objects. A CPU object, monitor object, keyboard object, tape drive, disk drives, etc. Some CPUs and monitors are spares and sit in a storage room. I would like to be able to use Zope and the ability to cut and paste objects to manage this information. If a monitor on a working CPU fails, I would like to be able to launch Zope, find the monitor, remove it from the existing system, pick one from the storage area and logically attach it to the working CPU. In addition, I would like to be able to generate reports/lists for auditing purposes. I have been looking for examples of how this is done within Zope, but I have not found any working examples. Any thoughts on how to implement a system like this would be much appreciated. Have a look at ZCatalog: http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalog.stx hth Jonathan ___ 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] ZODB performace/banchmarks
Hi, Two months ago I red about the ZODP that it has high performace, can store high amount of data, but there are no banchmarks e.g. for comparison for RDBMS. Are these true? If yes, why is not created a banchmark or something like that? Thanks, Tamas -- Tamas Hegedus | phone: (1) 919-966 0329 UNC - Biochem Biophys | fax: (1) 919-966 5178 5007A Thurston-Bowles Bldg | mailto:[EMAIL PROTECTED] Chapel Hill, NC, 27599-7248 | http://riordans.med.unc.edu ___ 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] Search path for objects
Does Zope look anywhere apart from the current folder for objects which are specified like this:- ? link rel=Stylesheet type=text/css href=ploneCustom.css / I've cobbled together a website and can't work out where certain CSS tags are being specified. Is there a simple way to determine this? -- John ___ 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 )
Re: [Zope] Search path for objects
+---[ John Poltorak ]-- | | | Does Zope look anywhere apart from the current folder for objects which | are specified like this:- ? | |link rel=Stylesheet type=text/css | href=ploneCustom.css / | | I've cobbled together a website and can't work out where certain CSS tags | are being specified. Is there a simple way to determine this? It will grab it via the normal Acquisition mechanism. Plone/CMF has special handling for 'skins' which it pushes into the Acquisition path, css files are normally one of the things that are pushed in. -- Andrew Milton [EMAIL PROTECTED] ___ 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] External editor for ZMI
What alternatives are there to editing objects through ZMI? -- John ___ 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 )
RE: [Zope] External editor for ZMI
I do recommend Boa Constructor, which feels the most like you're actually editing source code files (though you're editing the zope objects in place). This program has actually saved my life. Caveats: It has a few dependencies you'll need to track down, and it's a little buggy/quirky. If you're not comfortable with a bit of DIY, or you're relatively new to zope and/or python, it might be more trouble than its worth. The 'upload' mechanism in ZMI for most objects might do OK for you, then you can use whatever editing environment you want. I'm sure a lot of people have solved this particular problem for themselves in different ways, based on their own editing needs/preferences. After a little trial and error, of course. Jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Poltorak Sent: Thursday, June 23, 2005 11:28 AM To: zope@zope.org Subject: [Zope] External editor for ZMI What alternatives are there to editing objects through ZMI? -- John ___ 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 )
Re: [Zope] External editor for ZMI
On Thu, Jun 23, 2005 at 04:27:50PM +0100, John Poltorak wrote: What alternatives are there to editing objects through ZMI? ExternalEditor. -- Paul Winkler http://www.slinkp.com ___ 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 )
Re: [Zope] From Zope 2.5.1 to Zope 2.7.6
Yep, I think I hosed the new install. I imported the old Data.fs and corresponding .zexp files over and now it won't let me into the localhost:8080/manage interface even. I keep getting connection refused messages there. I have restarted zope. Tried to restore the working Data.fs file...but all is still not well. When I point to the Start Page that everyone should see, I get the authentication window and it does authenticate, but then I get Bad Gateway The proxy server received an invalid response from an upstream server. Do I have to start all over? Which is ok and maybe more efficient in getting this project off my plate (rather then peck my way through code I have no understanding of, (python). Unless you know what I can do to fix it quickly. Is there a way to cleanly uninstall Zope if I have to go this route? I compiled from the tar.gz and didn't use an RPM. Then what I want to do is start all over and set up a knowledge base: On an RHEL4 box: A fresh install of Zope (2.8.0 now) with; an apache2 front end with rewrite and redirect turned on so I can authenticate via LDAP, use our internal MySQL instead of the Zope DB, I want anyone to be able to edit freely provided they have the right authentication credentials from our organization, then import all the old knowledge base data from the Zope 2.5.1 install on the other Debian box to use in the new fresh install of Zope on the new RHEL4 install. Can anyone provide me some notes if you have similar installs and what I need to do to get this up and running? I have many projects going on right now, this one, is just the tip of the iceberg of Open Source technology that I am trying to absorb. Please don't tell me to RTFM because I am doing that already. My head is literally spinning with Perl, Python, LDAP, Apache, Zope, Linux, Unix, OpenBSDDon't get me wrong, I love it. I just need to make some progress on this through a good HowTO whether its already documented and I have overlooked it or if any of you would like to spend some time to help a very receptive learner. Thank you for any assistance, Tim On Thu, 2005-06-23 at 08:09 +0100, Peter Bengtsson wrote: On 6/22/05, Tim Suter [EMAIL PROTECTED] wrote: FWIW, here's the output of the old 2.5.1 install: ... So that tells me that there are many dependent on bobobase_modification_time. What does that mean and what do I need to do about it? It is completely wrong to rely on bobobase_modification_time because that value changes when the object storage changes. It's much better to use something like 'last_modified_date' that you control yourself in your own code. What happens when you import any object is that bobobase_modification_time gets set to today() which might make all your objects appear to be unordered because every time you refresh (now on you zope276) they seem to jump around from place to place. Solution is nasty but straight forward at least. On your (zope 2.5.1), this product that you have instanciated as Knowledge, Argyle and Helpdesk, do you have control over it's source code? Assuming it's a python product it might look something like this:: class MyProduct(Folder): meta_type = 'My Product' def __init__(self, id, title): self.id = id self.title = title def getModTime(self): return self.bobobase_modifiation_time() Now, what you need to do is tocopy the bobobase_modification_time to a new attribute. class MyProduct(Folder): meta_type = 'My Product' def __init__(self, id, title): self.id = id self.title = title self.last_modified_date = DateTime() def getModTime(self): return self.last_modified_date def upgrade(self): self.last_modified_date = self.bobobase_modification_time() And somewhere else you need to have a serious python script that loops through all instances and runs upgrade() on each. Something like this: for instance in context.objectValues('My Product'): instance.upgrade() Good luck Thanks much for your assistance; Tim On Wed, 2005-06-22 at 17:33 +0100, Peter Bengtsson wrote: Try something like this: $ cd zopehome/Products/ $ grep -rn bobobase_modification_time . That will tell you if any of your diskbased python products rely on bobobase_modification_time On 6/22/05, Tim Suter [EMAIL PROTECTED] wrote: Excuse the newbie question, but how would I find that out? I inherited this 'project' of upgrading Zope and migrating the data. I have had NO help with it so I have been banging through it all the way. Thanks, Tim On Wed, 2005-06-22 at 16:22 +0100, Peter Bengtsson wrote: Are any of your applications relying on the 'bobobase_modification_time' attribute? That's something that changes when you import a .zexp file which could maybe explain why things appear differently now. On 6/22/05, Tim Suter
Re: [Zope] External editor for ZMI
On Thu, Jun 23, 2005 at 11:49:19AM -0400, Paul Winkler wrote: On Thu, Jun 23, 2005 at 04:27:50PM +0100, John Poltorak wrote: What alternatives are there to editing objects through ZMI? ExternalEditor. Do you mean this? http://plope.com/software/ExternalEditor Are there any screen shots of it in action? I'm not exactly sure how it works, but have feeling it won't work for me. -- Paul Winkler http://www.slinkp.com -- John ___ 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 )
Re: [Zope] External editor for ZMI
AFAIK External Editor just provides the infrastructure not the editor itself. I use the External Editor product/infrastructure and HTML Kit on Windows: http://www.chami.com/html-kit/ ___ 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 )
Re: [Zope] External editor for ZMI
emacs via ftp -- see the Zope Book for funky details. On Thu, 23 Jun 2005, Paul Winkler wrote: On Thu, Jun 23, 2005 at 04:27:50PM +0100, John Poltorak wrote: What alternatives are there to editing objects through ZMI? ExternalEditor. -- Dennis Allison * Computer Systems Laboratory * Gates 227 * Stanford University * Stanford CA 94305 * (650) 723-9213 * (650) 723-0033 fax * [EMAIL PROTECTED] * [EMAIL PROTECTED] ___ 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 )
Re: [Zope] External editor for ZMI
External editor is an interface product that allows you to edit Zope objects with your local editor (vi, emacs, nano, wordpad, etc) but it does require installation of a helper product and Python on the client machine. On Thu, 23 Jun 2005, John Poltorak wrote: On Thu, Jun 23, 2005 at 11:49:19AM -0400, Paul Winkler wrote: On Thu, Jun 23, 2005 at 04:27:50PM +0100, John Poltorak wrote: What alternatives are there to editing objects through ZMI? ExternalEditor. Do you mean this? http://plope.com/software/ExternalEditor Are there any screen shots of it in action? I'm not exactly sure how it works, but have feeling it won't work for me. -- Paul Winkler http://www.slinkp.com -- Dennis Allison * Computer Systems Laboratory * Gates 227 * Stanford University * Stanford CA 94305 * (650) 723-9213 * (650) 723-0033 fax * [EMAIL PROTECTED] * [EMAIL PROTECTED] ___ 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 )
Re: [Zope] External editor for ZMI
On Thu, Jun 23, 2005 at 04:27:50PM +0100, John Poltorak wrote: What alternatives are there to editing objects through ZMI? I've often used the WebDAV support for using standard file system based editing tools on Zope content. How well it works depends greatly on the WebDAV client you have (I guess the WebDAV client authors would claim that it depends on the WebDAV server, but in this case the server is fixed as Zope) On MacOSX, it works very well. I've never been able to get Windows Web Folders to work successfully with Zope. ___ 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] Simple paypal IPN external method or product
I found the Bastion Ledger and Bastion Paypal connection, but it is way way overkill for what I want to do. Does anyone have a simple(r) IPN script they can point me towards? TIA! -e- ___ 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 )
Re: [Zope] ZopeProfiler and Zope 2.8.0
Pascal Peregrina wrote at 2005-6-23 10:54 +0200: I would like to know if anyone has tried using ZopeProfiler (1.4 version from http://www.dieter.handshake.de/pyprojects/zope/) with Zope 2.8.0 Someone has sent me a patch to let ZopeProfiler work with Python 2.4.1. Thus, apparently, it did not work with this Python version. I do not yet know about ZopeProfiler and Zope 2.8. -- Dieter ___ 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 )
Re: [Zope] problems with testing (PloneMailBoxer)
robert rottermann wrote at 2005-6-23 09:16 +0200: ... Calling the method in a test case I allways get None. ... security.declareProtected('Access contents information', 'getValueFor') def getValueFor(self, key): # Returns value for property; # if available, a dynamic getter will be used # we can not use MailBoxers getValueFor since # it does not work with skin elements on the FS getter = self.getProperty('getter') I expect that your mail composer distorted indentation in the line above. As it stands here, it is a SyntaxError. if getter: getterHandler = self.unrestrictedTraverse(getter, default=None) if getterHandler is not None: try: result = getterHandler(key) if result is not None: return result except: pass # Our stored properties are the default return self.getProperty(key) It this function returns None, then self.getProperty(key) (among others) must return None. If unrestrictedTraverse returns None, remove the default= argument an look at the resulting exception... -- Dieter ___ 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 )
Re: [Zope] Re: Problem with keep-alive timeout (zope: addressed to exclusive (zope: addressed to exclusive sender for this address) sender for this address)
Ralph wrote at 2005-6-22 18:46 +0200: ... MS says: By default, HTTP 1.1 is enabled in Internet Explorer except when you establish an HTTP connection through a proxy server. When HTTP 1.1 is enabled, HTTP connections remain open (or persistent) by default until the connection is idle for one minute or until the value that is specified by the KeepAliveTimeout value in the registry is reached. You can modify HTTP 1.1 settings in Internet Explorer by using the Advanced tab in the Internet Options dialog box.(http://support.microsoft.com/default.aspx?kbid=813827) I interpret this so: You have to use HTTP1.1 . The keep-alive request header was defined by HTTP 1.1. While some HTTP 1.0 extensions also know it, only HTTP 1.1 software must know it... Thus, specifying keep-alive for non HTTP 1.1 software may have no effect. *BUT* Tres explained you that keep-alive is *NOT* the request timeout! Instead, it is an idle connection timeout. The normal operation of HTTP 1.0 was: Client side: Open a new connection, send a request, close the connection (to indicate no more data). Server side: Read request data until EOF, perform the request, send the response, close the connection (to indicate no more data). Keep-Alive tells the HTTP endpoints in general not to close the connection (they are allowed to close the connection in case of errors or for other reasons at their discretion). This is more efficient because several requests can be send over the same connection (and opening a connection can be expensive). On the other hand, connections occupy valuable ressources. You want to free them when the connections are no longer used. That's the purpose of the keep-alive timeout. Connections not used for this time should be closed. It has nothing to do with a request timeout! So whats the reason that this f***ing browser using HTTP1.0? Zope understands large parts of HTTP 1.1, among others the Keep-Alive header, but it is not fully HTTP 1.1 compliant. Therefore, it uses HTTP 1.0 in its responses. That's probably the reason why your browser uses HTTP 1.0 for its requests... -- Dieter ___ 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] Problems changing from DTML to ZPT
I'm attempting to convert a page which uses DTML into one which uses ZPT but can't get it to look the same. Can some kind person quickly check over my poor attempt to utilise ZPT to see what I've done wrong? -- John ___ 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] Newbie-question
hi all, I have specific folder name art in Zope in which i installed a user folder, and a user with manager role. now i want anaonymous user to access i.e view the website ubeneath the folder art. Therefore i granted View Permission to the Anonymous Role at the folder level art, but that doesn't work. Then i came to the conclusion to grant that Permission at root level. But that doesn't work too. So my question is: What i have to do if: 1. i want only a manager user acces to the ZMI beneath the folder art 2. grant anonymous user acces to view the generated pages beneath this folder Thanks in advance Thomas Adams ___ 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] merging the contents of two acl_users folders
Title: merging the contents of two acl_users folders Can it be done? If not that, the ability to move selected users from one acl_users to another would be a decent plan B. This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved. Thanks for any help, Jim ___ 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] general design question
I am making a small application for sales and marketing reports in-house. Each user has a unique login/username in zope (via NtUserFolder) and they also have a unique employee_id in exisitng SQL database tables. Each page calls numerous SQL methods almost all of which need to know the employee_id number. I can make a small method getEmpID(request.AUTHENTICATED_USER) and map the logins to the employee_ids, but then I am calling that at least once every page. I could call getEmpID(request.AUTHENTICATED_USER) once when the user logs in and then set it in a cookie or a session variable but I am unsure of the possible security issues in doing that. Or I could start using the zope/NT login as the key in various sales and marketing tables. Just thought I'd *throw it out there* for any input, thanks. ___ 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 )
Re: [Zope] Newbie-question
On Thu, Jun 23, 2005 at 08:55:05PM +0200, Thomas Adams wrote: hi all, I have specific folder name art in Zope in which i installed a user folder, and a user with manager role. now i want anaonymous user to access i.e view the website ubeneath the folder art. Therefore i granted View Permission to the Anonymous Role at the folder level art, but that doesn't work. Then i came to the conclusion to grant that Permission at root level. But that doesn't work too. So my question is: What i have to do if: 1. i want only a manager user acces to the ZMI beneath the folder art It should be enough to give only to Manager the permission View management screens on that folder. 2. grant anonymous user acces to view the generated pages beneath this folder View and Access Contents Information usually do the trick. If not, google for VerboseSecurity - a great add-on product that will help debug security issues. -- Paul Winkler http://www.slinkp.com ___ 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 )
Re: [Zope] general design question
--On 23. Juni 2005 12:07:50 -0700 Erik Myllymaki [EMAIL PROTECTED] wrote: Just thought I'd *throw it out there* for any input, thanks. Anything other than a secure channel - means SSL - can be regarded as unsafe. It does not matter if you store information in cookies, http headers, URLs or whatever. If you want to make it safe, use SSL. -aj pgp9FZijxlNjh.pgp Description: PGP signature ___ 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 )
Re: [Zope] general design question
- Original Message - From: Erik Myllymaki [EMAIL PROTECTED] Each user has a unique login/username in zope (via NtUserFolder) and they also have a unique employee_id in exisitng SQL database tables. Each page calls numerous SQL methods almost all of which need to know the employee_id number. I can make a small method getEmpID(request.AUTHENTICATED_USER) and map the logins to the employee_ids, but then I am calling that at least once every page. I could call getEmpID(request.AUTHENTICATED_USER) once when the user logs in and then set it in a cookie or a session variable but I am unsure of the possible security issues in doing that. Or I could start using the zope/NT login as the key in various sales and marketing tables. How about storing a dictionary, as a property field on the local folder, which contains the mapping from AUTHENTICATED_USER to employee id? You would have to update the dictionary whenever you add/delete an employee (simple to do), but it would give you quick access to the employee id numbers. hth Jonathan ___ 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 )
Re: [Zope] merging the contents of two acl_users folders
Jim, It can be done, eg loop thru source.acl_users for each user object stuff REQUEST with name,password,confirm (password again) and roles, eg REQUEST.set('name',username), etc context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE) David In DTML: (via google) dtml-var expr="manage_addUserFolder()" dtml-call "REQUEST.set('name', username)" dtml-call "REQUEST.set('password', password)" dtml-call "REQUEST.set('confirm', password)" dtml-call "REQUEST.set('roles', ['Authenticated'])" dtml-call "acl_users.manage_users('Add',REQUEST,RESPONSE)" Jim Abramson wrote: merging the contents of two acl_users folders Can it be done? If not that, the ability to move selected users from one acl_users to another would be a decent plan B. This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved. Thanks for any help, Jim ___ 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 )
Re: [Zope] Re: Problem with keep-alive timeout
On Thursday 23 June 2005 19:33, Dieter Maurer - [EMAIL PROTECTED] wrote: It has nothing to do with a request timeout! So whats the reason that this f***ing browser using HTTP1.0? Zope understands large parts of HTTP 1.1, among others the Keep-Alive header, but it is not fully HTTP 1.1 compliant. Therefore, it uses HTTP 1.0 in its responses. That's probably the reason why your browser uses HTTP 1.0 for its requests... Ok as I understand, my solution to wait on a database report is not the best, because HTTP in general isn't designed to hold connections over a long time. But what could be a solution for such a problem? Writing the report values with a sessionid in the database, while the is looking at a page with an reload metatag until I have the results? Or writing code to store a values in a session? This is needing a lot of work and the resulting structure will be getting ugly. Is there a class or something else to make it easier? Btw. I'm using PostgreSQL with zpsycopgda 1.15 and Zope2.80, a very basic interface. I tried psycopg 2.00B3 but this version had problems with testing in the databaseadapter, so I decided to go back to 1.15. The hole databaselayer in Zope is very basic, you have to take care about things, that should be a part of a module. I.e. it could be a great thing to put in a databasedefinition plus handlingdefinition to get out a complete set of pages, including checks on fields. I'm worked in 1991 at a company that had a DB-RAD-System called Unique4GL (from Norway) that worked in a such manner with the output on a terminal. Since then I had never find a similar system. You had to describe the screen and the part of the used databasestructure and this was all. 1:n and join relations to display it on one screen regarding all constraints took not more then 10min. Could it be possible to make such a system with Zope, based on the logic of HTTP? ___ 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 )
Re: [Zope] merging the contents of two acl_users folders
Jim, David H didn't think thru his answer. I do not think you can acquire *passwords* the way I indicated. If so my suggestion will not work. The approach will work otherwise. Maybe someone that knows about this will pitch in. I'm reviewing User.py now... David . David H wrote: Jim, It can be done, eg loop thru source.acl_users for each user object stuff REQUEST with name,password,confirm (password again) and roles, eg REQUEST.set('name',username), etc context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE) David Jim Abramson wrote: merging the contents of two acl_users folders Can it be done? (programmically obtain data from one acl_users folder and merge into another) If not that, the ability to move selected users from one acl_users to another would be a decent plan B. This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved. Thanks for any help, Jim __ NOD32 1.1152 (20050623) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com ___ 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 ) __ NOD32 1.1152 (20050623) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com ___ 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 )
Re: [Zope] Re: ZODB error when trying to index object (Input/output error)
[Felix Ulrich-Oltean] ... I think I've found the culprits - there are 4 records which give errors like this: portal.portal_catalog.uncatalog_object('/sites/cw/data/urbanr') Traceback (most recent call last): File stdin, line 1, in ? File /usr/local/zope/lib/python/Products/ZCatalog/ZCatalog.py, line 558, in uncatalog_object self._catalog.uncatalogObject(uid) File /usr/local/zope/lib/python/Products/ZCatalog/Catalog.py, line 411, in uncatalogObject x.unindex_object(rid) File /usr/local/zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py, line 138, in unindex_object self._index[comp][level].remove(docid) File /usr/local/zope/lib/python/ZODB/Connection.py, line 597, in setstate p, serial = self._storage.load(oid, self._version) File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 689, in load return self._load(oid, version, self._index, self._file) File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 665, in _load raise CorruptedDataError, h ZODB.FileStorage.CorruptedDataError: and later: Just to follow up on the original problem, in case someone else has similar troubles. It turned out that the physical disk was broken - I couldn't even copy the files at the os level. Thank you for the followup! I follow reports of FileStorage corruption keenly, and they never have a thoroughly happy ending -- as it implies on http://zope.org/Wikis/ZODB/FileStorageBackup the only ones that have been resolved in my experience got pinned on HW problems, or catastrophic system software bugs. Often the original reporter doesn't follow up, and then we never know. In some of those cases, I heard later that the problem went away after they moved to a different machine. That's consistent with flaky HW, but not conclusive. I appreciate hearing how these turn out -- thank you. the ZODB guy ___ 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 )
Re: [Zope] Batch folder creation
Thanks David, That works fine although it is a little crude. What I'd like to be able to do is create folders with names and titles derived from an external File where each line contains the name and title, separated by a comma. Guess I need to find out how to get python to read lines from a Zope File object On Wed, Jun 22, 2005 at 10:49:07AM -0700, David H wrote: John Poltorak wrote: Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. John, Put this in a python script and test. for n in range(10): container.manage_addFolder(id= str(n)) David ___ 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 )
Re: [Zope] merging the contents of two acl_users folders
Jim, Alright, I found the way to get needed user information in order to merge (create users in a dest folder). You need an external script. Otherwise you will not be able to access acl_users _getPassword(). Local scripts enforce this for security reasons. So here is the external script that you can modify to your needs # #Zope/Extensions/getUserData.py # just pass in the *source* acl_users folder # def getUserData(self,acl_users): users = acl_users.getUsers() dict = {} for user in users: dict[user.getId()] = {'name' : user.getUserName(), 'password' : user._getPassword(), 'roles' : user.getRoles() } return dict Then call this with a local python script: request = context.REQUEST users = container.getPasswords(acl_users) for k in users: user = users[k] print k,user['password'],user['name'],user['roles'] # to test Hope this helps you reach the "tipping point" if you've not already gotten there. David Jim, David H didn't think thru his answer. I do not think you can acquire *passwords* the way I indicated. If so my suggestion will not work. The approach will work otherwise. Maybe someone that knows about this will pitch in. I'm reviewing User.py now... David . David H wrote: Jim, It can be done, eg loop thru source.acl_users for each user object stuff REQUEST with name,password,confirm (password again) and roles, eg REQUEST.set('name',username), etc context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE) David Jim Abramson wrote: merging the contents of two acl_users folders Can it be done? (programmically obtain data from one acl_users folder and merge into another) If not that, the ability to move selected users from one acl_users to another would be a decent plan B. This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved. Thanks for any help, Jim ___ 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] Reading lines from a Zope File object
What function is used to read lines from a Zope File object using Python? Is there any example of this anywhere? Doing a search for 'python read zope object' is just too generic to find any python code to do this. -- John ___ 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 )
Re: [Zope] Batch folder creation
John, Seems like external scripts and dictionaries are a theme today. You need to check python manuals for file handling. Its a simple implementation. Then you would parse out names and title and put them in a dictionary and return. then in replace range(1...10) as seen in earlier messages with something *like* for n in yourDictionary: container.manage_addFolder(id = n, title = yourDictionary[n]) David John Poltorak wrote: Thanks David, That works fine although it is a little crude. What I'd like to be able to do is create folders with names and titles derived from an external File where each line contains the name and title, separated by a comma. Guess I need to find out how to get python to read lines from a Zope File object On Wed, Jun 22, 2005 at 10:49:07AM -0700, David H wrote: John Poltorak wrote: Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. John, Put this in a python script and test. for n in range(10): container.manage_addFolder(id= str(n)) David ___ 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 )
Re: [Zope] Reading lines from a Zope File object
John Poltorak wrote: What function is used to read lines from a Zope File object using Python? Is there any example of this anywhere? Doing a search for 'python read zope object' is just too generic to find any python code to do this. You can get the main contents of a File with the 'data' attribute. It returns a string. You can ask a string 'splitlines' among other methods: http://python.org/doc/lib/string-methods.html You may also be interested in 'split'. --jcc -- Building Websites with Plone http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.com ___ 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 )
Re: [Zope] Batch folder creation
Hi David, I'm used to using the term 'file'. I guess it isn't appropriate in this case since I'm not actually handling a file but a Zope File object. I'm not sure where to look to see how Python handles this... John On Thu, Jun 23, 2005 at 04:30:07PM -0700, David H wrote: John, Seems like external scripts and dictionaries are a theme today. You need to check python manuals for file handling. Its a simple implementation. Then you would parse out names and title and put them in a dictionary and return. then in replace range(1...10) as seen in earlier messages with something *like* for n in yourDictionary: container.manage_addFolder(id = n, title = yourDictionary[n]) David John Poltorak wrote: Thanks David, That works fine although it is a little crude. What I'd like to be able to do is create folders with names and titles derived from an external File where each line contains the name and title, separated by a comma. Guess I need to find out how to get python to read lines from a Zope File object On Wed, Jun 22, 2005 at 10:49:07AM -0700, David H wrote: John Poltorak wrote: Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. John, Put this in a python script and test. for n in range(10): container.manage_addFolder(id= str(n)) David ___ 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 )
Re: [Zope] Reading lines from a Zope File object
Andy McKay wrote: J Cameron Cooper wrote: You can get the main contents of a File with the 'data' attribute. It returns a string. I think it actually returns an object (for large file support), if you want the data as a string you need to string it. So for small files: datastr = str(context.fileObject.data) Should work. Yes, forgot that caveat. For large files, 'data' can return a Pdata, a list of strings. For small files, it returns a string. Always doing 'str' is a good idea. --jcc -- Building Websites with Plone http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.com ___ 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 )
Re: [Zope] problems with testing (PloneMailBoxer)
thanks Dieter, Dieter Maurer wrote: robert rottermann wrote at 2005-6-23 09:16 +0200: ... Calling the method in a test case I allways get None. ... security.declareProtected('Access contents information', 'getValueFor') def getValueFor(self, key): # Returns value for property; # if available, a dynamic getter will be used # we can not use MailBoxers getValueFor since # it does not work with skin elements on the FS getter = self.getProperty('getter') I expect that your mail composer distorted indentation in the line above. As it stands here, it is a SyntaxError. if getter: getterHandler = self.unrestrictedTraverse(getter, default=None) if getterHandler is not None: try: result = getterHandler(key) if result is not None: return result except: pass # Our stored properties are the default return self.getProperty(key) It this function returns None, then self.getProperty(key) (among others) must return None. it does not. I checked I returns the name of an a skinned python script on the FS If unrestrictedTraverse returns None, remove the default= argument an look at the resulting exception... It complains that it does not find the objekt. This means that in the testing environment the skind element is not found. In the real enviroment however it is. But why? Robert ___ 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 )
Re: [Zope] Newbie-question
Paul Winkler schrieb: On Thu, Jun 23, 2005 at 08:55:05PM +0200, Thomas Adams wrote: hi all, I have specific folder name art in Zope in which i installed a user folder, and a user with manager role. now i want anaonymous user to access i.e view the website ubeneath the folder art. Therefore i granted View Permission to the Anonymous Role at the folder level art, but that doesn't work. Then i came to the conclusion to grant that Permission at root level. But that doesn't work too. So my question is: What i have to do if: 1. i want only a manager user acces to the ZMI beneath the folder art It should be enough to give only to Manager the permission View management screens on that folder. 2. grant anonymous user acces to view the generated pages beneath this folder View and Access Contents Information usually do the trick. If not, google for VerboseSecurity - a great add-on product that will help debug security issues. Unfortunately VerboseSecurity seems not to work on Zope 2.7.5-final. I think there are some security issues by my ZCLasses used within the above mentioned folder. Is there any hack to agin more information for security issues or for installing VerboseSecurity on this new Zope version. Thanks in advance Thomas Adams ___ 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 )
Re: [Zope-DB] Zope 2.8 and DCOracle2 Stored Procedures
Maciej Wisniowski wrote at 2005-6-23 10:28 +0200: ... Module Products.DCOracle2.SP, line 301, in __call__ TypeError: unbound method _lobConvert() must be called with DB instance as first argument (got list instance instead) On Zope 2.7.x everything is OK. Any ideas what is wrong?? Look at line 301 of DCOracle2/SP.py and check the implicated object and its type. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope 2.8 and DCOracle2 Stored Procedures
Look at line 301 of DCOracle2/SP.py and check the implicated object and its type. Thanks but I think I've already did the thing, and I've even written a post about this but... I've sent it only to myself, not to the group :D As I can see there http://cvs.zope.org/Products/DCOracle2/SP.py I'm using older version of DCOracle2 (before chrisw changes) I've changed SP.py: line: return self._lobConvert(results) to: return self._lobConvert(self._v_db, results) Then I've received attribute error about sortKey method. I've added method: def sortKey(self): Important for Zope 2.8 return 1 to Procedure class in SP.py (and to DB class in db.py - just in case) and it seems to work now :) Tomorrow I'll try with chrisw version too. -- Maciej Wisniowski ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db