Re: [Zope] Permissions, files and folders
Ah! Thanx! DocFinder will shore come very useful in time =) Btw, what editor would you recommend for writing python outside Zope. I've frequently used Eclipse with PyDev before, but it's a bit slow and heavy. I've looked around a bit on the free editors without finding anything I like so I'm thinking it might be worth trying a commercial editor. What do you guys use? /ErikOn 4/20/06, Stefan H. Holek [EMAIL PROTECTED] wrote: I recommend to install DocFinderTab. And there is something at http://api.plone.org/ for those who like such things ;-)StefanOn 18. Apr 2006, at 13:21, Erik Billing wrote: Is there any complete api reference avalible?--Anything that happens, happens.--Douglas 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] Permissions, files and folders
Erik Billing schrieb: Ah! Thanx! DocFinder will shore come very useful in time =) Btw, what editor would you recommend for writing python outside Zope. I've frequently used Eclipse with PyDev before, but it's a bit slow and heavy. I've looked around a bit on the free editors without finding anything I like so I'm thinking it might be worth trying a commercial editor. What do you guys use? Linux/KDE: kate and/or eric3 (nice because of seamless sftp/webdav) Linux: vim, some will use (x)emacs, pida Windows: hm. I've used the ide that comes with the win32 extensions from Marc Hammond. You bend some paths and get nice module view and hinting for zope classes too. Regards Tino ___ 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] Permissions, files and folders
On Friday 21 April 2006 10:15, Tino Wildenhain wrote: Erik Billing schrieb: Ah! Thanx! DocFinder will shore come very useful in time =) Btw, what editor would you recommend for writing python outside Zope. I've frequently used Eclipse with PyDev before, but it's a bit slow and heavy. I've looked around a bit on the free editors without finding anything I like so I'm thinking it might be worth trying a commercial editor. What do you guys use? Linux/KDE: kate and/or eric3 (nice because of seamless sftp/webdav) Linux: vim, some will use (x)emacs, pida Windows: hm. I've used the ide that comes with the win32 extensions from Marc Hammond. You bend some paths and get nice module view and hinting for zope classes too. I've used WingIDE a bit lately and am quite impressed by its feature set: * Good editor: Syntax coloring, folding, autocompletion, ... * Auto-lookup of documentation * Visual Debugger: watches, breakpoints, lots of goodies * Code / Class browser * Zope support Last but not least: great support staff. It uses quite a bit of resources though. Review of Python IDEs: http://spyced.blogspot.com/2005/09/review-of-6-python-ides.html peter. Regards Tino ___ 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] Permissions, files and folders
On Fri, Apr 21, 2006 at 09:54:15AM +0200, Erik Billing wrote: Btw, what editor would you recommend for writing python outside Zope. I've frequently used Eclipse with PyDev before, but it's a bit slow and heavy. I've looked around a bit on the free editors without finding anything I like so I'm thinking it might be worth trying a commercial editor. What do you guys use? Emacs :-) It takes a bit of work to get it set up nicely, but there are some really nice features like good pdb integration. e.g. try this: put a pdb.set_trace() somewhere in your code, and then run the program from a shell within emacs - e.g. you can start a shell by typing M-x shell, and then type the command to run your program. When you enter pdb, you can step around the code and emacs shows you where you are in another buffer, opening modules as you step into them. I've said it before: All hail Ken Manheimer! I'm sure plenty of IDEs can do stuff like that, but I'm surprised how many emacs users don't seem to know it's there. (dunno if all that works on Windows, never tried.) The code-completion support is pretty rudimentary, though. It seems to only be good for repeating symbols already in your source file. And no built-in browsing of documentation afaict. -- 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] Permissions, files and folders
I recommend to install DocFinderTab. And there is something at http:// api.plone.org/ for those who like such things ;-) Stefan On 18. Apr 2006, at 13:21, Erik Billing wrote: Is there any complete api reference avalible? -- Anything that happens, happens. --Douglas 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] Permissions, files and folders
(Tue, Apr 18, 2006 at 12:00:12PM -0400) [EMAIL PROTECTED] wrote/schrieb/egrapse: From: Erik Billing [EMAIL PROTECTED] Thank you, that worked nicely. But I was unable to call the LazyFilter from the DTML document, I figure I have to import the ZTUtils module first. Is there a special DTML-tag to do import? By the way? Is there some obvious documentation about the different modules that I have missed? As I mentioned in an earlier letter I'm new to Zope and I find it very hard to get an overview of all the different modules If you are new to Zope you should drop DTML like a hot potatoe and start doing your logic in python and your presentation in ZPT -- strictly parted. Also don't bother too much with implementing stuff with TTW means (through the web - the stuff you do from the ZMI). Better start doing filesystem python products. Read for example http://zopewiki.org/ZopeStarter - including the link to the new tutorial from upfrontsystems. The ZopeStarter page is a 5 minute read, but has good pointers to stuff that will get you started in the right directioin. Regards, Sascha ___ 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] Permissions, files and folders
This is what they should put on the documentation page on zope.org instead of a link to the zope book, thank your very much for telling me!/Erik On 4/19/06, Sascha Welter [EMAIL PROTECTED] wrote: (Tue, Apr 18, 2006 at 12:00:12PM -0400) [EMAIL PROTECTED] wrote/schrieb/egrapse: From: Erik Billing [EMAIL PROTECTED] Thank you, that worked nicely. But I was unable to call the LazyFilter from the DTML document, I figure I have to import the ZTUtils module first. Is there a special DTML-tag to do import? By the way? Is there some obvious documentation about the different modules that I have missed? As I mentioned in an earlier letter I'm new to Zope and I find it very hard to get an overview of all the different modules If you are new to Zope you should drop DTML like a hot potatoe and startdoing your logic in python and your presentation in ZPT -- strictlyparted.Also don't bother too much with implementing stuff with TTW means (through the web - the stuff you do from the ZMI). Better start doingfilesystem python products. Read for examplehttp://zopewiki.org/ZopeStarter - including the link to the new tutorial from upfrontsystems.The ZopeStarter page is a 5 minute read, but has good pointers to stuffthat will get you started in the right directioin.Regards,Sascha___ Zope maillist-Zope@zope.orghttp://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] Permissions, files and folders
Thank you, that worked nicely. But I was unable to call the LazyFilter from the DTML document, I figure I have to import the ZTUtils module first. Is there a special DTML-tag to do import? By the way? Is there some obvious documentation about the different modules that I have missed? As I mentioned in an earlier letter I'm new to Zope and I find it very hard to get an overview of all the different modules available. It seams to me that the API Reference on the zope home page does not cover the modules completely. For example, I found ZTUtils listed, but it only contains the Batch class, not the LazyFilter or any of the other classes in the module. I feel that this is the case with many of the modules.Is there any complete api reference avalible?Best regards /ErikOn 4/17/06, Dieter Maurer [EMAIL PROTECTED] wrote:Erik Billing wrote at 2006-4-16 18:55 +0200: ...Thanx, it worked fine when I allowed the unauthorized module, but I stillwonder if this is the way I *should* do it, is there no easier way that doesnot incorporate an python script (or a similar clumsy dtml solution). It just feels a little overkill to write a specific script just to access thefiles in a directory.You can use the LazyFilter from the ZTUtils package.In fact, it is defined in ZTUtils.Zope (but exported via ZTUtils)and you can look there for its signature.--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] Permissions, files and folders
Erik Billing wrote at 2006-4-18 11:42 +0200: Thank you, that worked nicely. But I was unable to call the LazyFilter from the DTML document, I figure I have to import the ZTUtils module first. Is there a special DTML-tag to do import? No, you have to go through a Python Script. But, you can make it generic, something like a filterUnauthorized script. ... Is there any complete api reference avalible? The Plone people have an epidoc documentation online (I do not have the url at hand, you have to search for it). Like any documentation generated automatically from the source (this is valid also for Java documentation), it is complete but contains more details than you might be interested in. -- 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] Permissions, files and folders
Ok. I didn't find any epidoc on plone at a first googleing, but I have a closer look and post the link here if I find it. I solved some of the API doc problem by starting a local pydoc server (ex. pydoc -p 8079) which cover even the zope modules when I put them in the python path. But I'm still somewhat surprised that there is no more complete documentation on Zope. I will post my comments about this in a new thread since it no longer has anything to do with permissions and stuff. Anyway, thank you very much for your help Dieter. Best regards /ErikOn 4/18/06, Dieter Maurer [EMAIL PROTECTED] wrote:Erik Billing wrote at 2006-4-18 11:42 +0200:Thank you, that worked nicely. But I was unable to call the LazyFilter from the DTML document, I figure I have to import the ZTUtils module first. Isthere a special DTML-tag to do import?No, you have to go through a Python Script.But, you can make it generic, something like a filterUnauthorized script. ...Is there any complete api reference avalible?The Plone people have an epidoc documentation online (I do nothave the url at hand, you have to search for it). Like any documentation generated automatically from the source(this is valid also for Java documentation), it is completebut contains more details than you might be interested in.--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] Permissions, files and folders
Erik Billing wrote at 2006-4-16 18:55 +0200: ... Thanx, it worked fine when I allowed the unauthorized module, but I still wonder if this is the way I *should* do it, is there no easier way that does not incorporate an python script (or a similar clumsy dtml solution). It just feels a little overkill to write a specific script just to access the files in a directory. You can use the LazyFilter from the ZTUtils package. In fact, it is defined in ZTUtils.Zope (but exported via ZTUtils) and you can look there for its signature. -- 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] Permissions, files and folders
On 4/11/06, Dieter Maurer [EMAIL PROTECTED] wrote: Erik Billing wrote at 2006-4-10 20:38 +0200: ...This works fine, except that it's a bit clumsy and has one big error; Icatch just any exception that arises from thefiles.append(fileIterator.next ())-call,and swallow it.In fact, you should *NEVER* do this.I totally agree I've tried catching only the Unauthorized-exception, but ananonymus user does not have access to the Unauthorized-exception, so I can'tspecify is in my except-declaration without getting a new authorization error.The README in Products/PythonScripts (unmong others) tellsyou how to allow the import of usually protected ressources.--Dieter Thanx, it worked fine when I allowed the unauthorized module, but I still wonder if this is the way I *should* do it, is there no easier way that does not incorporate an python script (or a similar clumsy dtml solution). It just feels a little overkill to write a specific script just to access the files in a directory. /Erik ___ 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] Permissions, files and folders
Erik Billing wrote at 2006-4-10 20:38 +0200: ... This works fine, except that it's a bit clumsy and has one big error; I catch just any exception that arises from the files.append(fileIterator.next())-call, and swallow it. In fact, you should *NEVER* do this. I've tried catching only the Unauthorized-exception, but an anonymus user does not have access to the Unauthorized-exception, so I can't specify is in my except-declaration without getting a new authorization error. The README in Products/PythonScripts (unmong others) tells you how to allow the import of usually protected ressources. -- 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] Permissions, files and folders
Hi!I just started looking at zope, so this might be a pretty nooby question, but I didnt find an answere anywhere, so...I want to create a DTML Method that lists the files in a folder that the current user has access to. Problem is that the objectValues-method returns all files simultaniously, so I get a AccessControl.unauthorized.Unauthorized exception when I call the method. I did a litle python script that iterates over the objectValues and catches the errors raised from unauthorized files as folows:files = [] fileIterator = iter(container.objectValues('File'))while True: try: files.append(fileIterator.next()) except Exception, e: if isinstance(e,StopIteration): break else: files.append(e)return files This works fine, except that it's a bit clumsy and has one big error; I catch just any exception that arises from the files.append(fileIterator.next())-call, and swallow it. I've tried catching only the Unauthorized-exception, but an anonymus user does not have access to the Unauthorized-exception, so I can't specify is in my except-declaration without getting a new authorization error. All thaw it works fine to catch all exceptions for a simple directory listing like this, its defiantly nothing I wanna put into a larger application. So my question is, how do I do this in a nicer way? Thanx /Erik ___ 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 )