[Zope-dev] information disclosure vulnerability
Hi, probably the HelpSys object shouldn't be available by default to non-authenticated users, because it gives too much information on the currently installed products. access any Zope site this way : http://your.zope.site/HelpSys and you'll learn what products are available on the server. This can't lead to a direct compromise, but this gives way too much information to anonymous users IMHO. Tested today on several low and very high profile sites. bye, Jerome Alet ___ 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] Problem with Zope 2.6.0 and ZShell
Hi, Someone has reported to me a problem when running ZShell's latest version (1.5) under Zope 2.6 CVS and Python 2.2.2 Here's the traceback : * Traceback (innermost last): Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Products.ExternalMethod.ExternalMethod, line 224, in __call__ - __traceback_info__: ((Application instance at b796560, ['man ls', 'ls'], None), {}, (None, None)) Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 3501, in zshell Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 701, in __init__ Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 1014, in execCommands Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 1081, in execCommand Module /home/zope/Zope/ZInstanceHome/Extensions/zshell.py, line 891, in ShellExpand Module rexec, line 429, in s_exec Module rexec, line 412, in s_apply Module rexec, line 308, in r_exec Module __main__, line 1, in ? Module rexec, line 339, in r_import Module ihooks, line 397, in import_module Module ihooks, line 433, in find_head_package Module ihooks, line 486, in import_it Module ihooks, line 325, in load_module Module glob, line 4, in ? Module rexec, line 339, in r_import Module ihooks, line 397, in import_module Module ihooks, line 433, in find_head_package Module ihooks, line 486, in import_it Module ihooks, line 325, in load_module Module fnmatch, line 13, in ? Module rexec, line 339, in r_import Module ihooks, line 397, in import_module Module ihooks, line 433, in find_head_package Module ihooks, line 486, in import_it Module ihooks, line 325, in load_module Module re, line 27, in ? Module rexec, line 339, in r_import Module ihooks, line 397, in import_module Module ihooks, line 433, in find_head_package Module ihooks, line 486, in import_it Module ihooks, line 325, in load_module Module sre, line 168, in ? AttributeError: 'module' object has no attribute 'hexversion' * This seems to be deep in Python standard library. Since I don't actually use Zope 2.6, does anyone have an idea on where the problem may come from ? Does any of you use ZShell with Zope 2.6 ? It works fine in 2.5.1 with Python 2.1.3, so something has changed somewhere which breaks it. ZShell's latest version is available from : http://www.librelogiciel.com/software Thanks in advance for any pointer. Jerome Alet ___ 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] Problem with Zope 2.6.0 and ZShell
Hi, On Tue, Nov 19, 2002 at 01:54:56PM -0500, Guido van Rossum wrote: Since I don't actually use Zope 2.6, does anyone have an idea on where the problem may come from ? You're using restricted mode (the rexec module) and this apparently doesn't provide sys.hexversion. This is a shallow bug; it's already fixed in Python 2.3 (CVS). ... Probably those versions of Python didn't have the test for sys.hexversion; it's testing whether this is Python 2.2 or higher. A workaround would be to set sys.hexversion to 0x0202 (or to 0 if you're not sure which Python version you're using) before importing sre for the first time. Thanks for your answer. Unfortunately I never import sre. I import re, then rexec in the main program, then in the restricted code I add the os and os.path modules, and the resticted code then import the glob modules and calls its glob method. So should I set sys.hexversion *before* my re and rexec imports in the main program, or add the sys module and a fake hexversion value in the restricted code ? thanks in advance Jerome Alet ___ 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] Using restricted code from within a python product
On Tue, Nov 05, 2002 at 12:19:06PM -0600, Brent Hendricks wrote: I have a method in a python Product that I'd like to have run as restricted code. Is there an easy way to do this? I was hoping for a PythonScriptFile() along the lines of PageTemplateFile(), but such a thing doesn't seem to exist. Why not use PythonScripts ? bye, Jerome Alet ___ 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] Using Zope from a console script
On Tue, Nov 05, 2002 at 09:46:03PM +0100, Gilles Lenfant wrote: But just want to run a console application, not running it from another Zope instance. xml-rpc should be the way to go. bye, Jerome Alet ___ 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] Using Zope from a console script
On Tue, Nov 05, 2002 at 10:25:23PM +0100, Gilles Lenfant wrote: That's the way I started to do the stuff but this requires too many Zope side xmlrpc handlers I should not need if accessing directly to the Zope objects. shamelessplug mode=again_and_again Did you try to manipulate your ZODB with ZShell ? You can also do it in a limited way through xml-rpc with the help of Andy McKay's ZShellCLI, but ZShell commands can manipulate several (**many**) objects at a time, so the slowdown would be minimal. depending on what you want to achieve this may be useful. get it from http://www.librelogiciel.com/software/ upcoming versions of ZShellScripts will provide easier xml-rpc access to ZShell functionnalities. /shamelessplug hth Jerome Alet ___ 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] Unix: Vanishing Group Ids associated with Zope process ?
On Fri, Oct 11, 2002 at 06:05:59PM +0200, Johan Carlsson [EasyPublisher] wrote: The way that Zope changes user under the start up sequence doesn't change the groups. man 2 setgroups should be called after (before?) the user id change in the Zope startup script. it is called for you by PAM when you log in, AFAIK, this is why it works from your command line hth Jerome Alet ___ 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] A Modest Proposal Concerning Monkey Patches
On Wed, Aug 14, 2002 at 05:08:21PM +0100, Adrian Hungate wrote: One question about zshell though, what is the box that is added left of the add product pulldown? Is it something that ABSOLUTELY has to be on the contents listing (i.e. something to do with creating or maintaining the objects listed?). Could it be backdoor'd into all_meta_types so that it, itself is listed in the pulldown, or could it have a ZMI tab of it's own (Both of these are easier than live patching the DTML)? About ZShell : IF and ONLY if you want to use ZShell from the right frame of the ZMI (manage_main) you currently have to modify manage_main to put a text input field somewhere on it. Then running ZShell from there applies ZShell commands to the current folderish object. (Of course you can in any case use ZShell by pointing your web browser to it) Of course ZShell could use a special tab, or another clever solution, but IMHO this is really NOT the problem here. The problem is not about ZShell, ExternalEditor, or any other Zope product, but if I understand correctly it is about extending, not replacing, the Zope's main management interface. Jim please correct me if I'm wrong. That's why I proposed to add three loops in manage_main, to loop over three different types of plugins. Each Zope product which wants to extend the ZMI should register itself once as a ZMI plugin of three sorts : - top ZMI plugin : displayed once at the top (ex : ZShell) - line ZMI plugin : displayed once for each object (ex : External Editor) - bottom ZMI plugin : displayed once at the bottom (ex : xxx) registering a ZMI plugin would be as simple as : root.registerZMIPlugin(top|line|bottom, self) or : root.registerTopZMIPlugin(self) root.registerLineZMIPlugin(self) root.registerBottomZMIPlugin(self) self represents the object which wants to register as a ZMI plugin. It would have to provide at least one of the three methods : TopZMIPlugin(self, obj) LineZMIPlugin(self, obj) BottomZMIPlugin(self, obj) these three methods would have to render some html snippet, e.g. a form with a text input field for ZShell, or a nice icon with a link for External Editor. obj would be the object on which the method applies, e.g. current folder, or current object in the object listing. This way manage_main could be rendered more powerful by just adding three dtml-in in it, and its aspect wouldn't even change in case no ZMI plugin would be registered (which is the case with a base Zope installation). any comment ? thx for reading Jerome Alet ___ 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] A Modest Proposal Concerning Monkey Patches
On Wed, Aug 14, 2002 at 09:33:02PM +0200, Jerome Alet wrote: registering a ZMI plugin would be as simple as : root.registerZMIPlugin(top|line|bottom, self) or : root.registerTopZMIPlugin(self) root.registerLineZMIPlugin(self) root.registerBottomZMIPlugin(self) self represents the object which wants to register as a ZMI plugin. I forgot to add that root in this case means any unique Zope object which we are certain is always present (e.g. the root object or the ControlPanel), which would register all plugins as its own properties and could list all plugins (that's why the ControlPanel is a good idea, but I don't know if it would support this functionnality easily). hoping this gets clearer now Jerome Alet ___ 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] Write in a file.
Hi, On Mon, Jul 01, 2002 at 10:13:25PM +0200, Juliette Colmant wrote: I have a Python script that has to write a string in a file. When I launch it from Zope, I have an error message from Zope telling me I can't write in my file. Is there a way to write in a file from Zope or not? Is that a problem a rights? Do I change something about the security in Zope? You should use an external method to do that, because Python Scripts are very restricted. Just put your script in zope/Extensions and add an external method which points to this script in the ZMI. you should use the [EMAIL PROTECTED] mailing list instead of this one to ask such questions. zope-dev is dedicated to the development of Zope. bye, Jerome Alet ___ 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] multiple monkeypatches
On Thu, Jun 06, 2002 at 09:24:58AM -0400, Casey Duncan wrote: I am going to experiment with ExternalEditor to see if I can dynamically patch manage_main reliably rather than replacing it outright. If I work out a reliable scheme, I'll write a how-to on it. Then maybe other products can then use the same technique. Couldn't there be a plugin mechanism for the management interface ? I can see three sort of plugins : Top plugin : * will be displayed once at the top of the ZMI (below tabs) e.g. ZShell Line plugin : * will be displayed once for each object (on each line) e.g. ExternalEditor Bottom plugin : * will be displayed once on the buttons line e.g. Your_product_of_choice Then every product would just have to register itself as a ZMITopPlugin, ZMILinePlugin, or ZMIBottomPlugin, or both. then the ZMI (main.dtml in fact) would just have to loop for each list of registered plugins whenever its needed : once at the top, once for each line listing objects, and once for the bottom. and if ZMILinePlugins could set a filter to be called only for some metatypes this would be really cool ! Any comment ? BTW Casey and others, if you need some help then I'd be pleased to do whatever I can, with a small amount of free time though... The problem is somewhat easier to solve for methods since you can detect whether they have already been replaced (with func_globals) and you can do the old run my code and call the old one trick. agreed, unfortunately... bye, Jerome Alet ___ 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] multiple monkeypatches
On Wed, Jun 05, 2002 at 05:15:10PM +, Florent Guillaume wrote: Jim Penny [EMAIL PROTECTED] wrote: Is there a safe way to handle multiple monkeypatches? Without an existing framework (I haven't looked at Adrian's PatchKit), it's the same old problem as intercepting interrupts on good old 8-bit computers. You just have to save and call the previous one. What I do is this: # 1. define my method def manage_main(...): # ... ... res = self._myproduct_old_manage_main(...) Yes, I remember ;-) except that what we want to patch there is the user interface HTML code itself. I think parsing the HTML code to insert some tags where needed would do it, but this seems somewhat complicated to do for a simple thing like that. Would be fine if the main.dtml file would allow a plugin system... bye, Jerome Alet ___ 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] [PATCH] to Zope's Management Interface
Hi the attached patch to apply to zope/lib/python/OFS/dtml/main.dtml allows people who want to use ZShell to type ZShell commands directly from the Zope's Management Interface. It should be transparent for people who don't want to use ZShell at all. to use this patch, you have to : - download ZShell v1.42 from : http://www.librelogiciel.com/software/ This is mandatory to stay in the ZMI when running commands, otherwise, with older ZShell versions you'll enter ZShell user interface after entering a command. - extract it in your home directory - cd to the Zope's home, e.g. /usr/lib/zope - type the following command (as root) : patch -p0 ~myusername/zshell-1.42/main.dtml.patch - restart Zope Enjoy !!! (At least you should) This was tested against Zope 2.5.0-4 (Debian package) but applying the patch manually to other versions if needed is very easy. As always any comment is very welcome. PS : This procedure and the patch are now included in the ZShell 1.42 package. Jerome Alet --- lib/python/OFS/dtml/main.dtml.orig Mon Apr 29 12:18:12 2002 +++ lib/python/OFS/dtml/main.dtml Mon Apr 29 12:38:34 2002 -60,6 +60,15 /table /dtml-if +dtml-if _.hasattr(this(), 'zshell') + form action=zshell method=GET +input type=text name=zshellscript:string width=60 / +input type=hidden name=zshellredirect:string value=dtml-URL0; / +nbsp; +input type=submit name=zshellbutton value=ZShell! / + /form +/dtml-if + form action=dtml-URL1;/ name=objectItems method=post dtml-if objectItems table width=100% cellspacing=0 cellpadding=2 border=0
[Zope-dev] Re: [Zope] [PATCH] to Zope's Management Interface
NB : not CCed to [EMAIL PROTECTED] On 29 Apr 2002, Hannu Krosing wrote: On Mon, 2002-04-29 at 13:21, Jerome Alet wrote: the attached patch to apply to zope/lib/python/OFS/dtml/main.dtml allows people who want to use ZShell to type ZShell commands directly from the Zope's Management Interface. It should be transparent for people who don't want to use ZShell at all. Have you thougth of making this a Hotfix instead of patch ? No. I often don't think a lot, especially considering that the idea to do this 4 lines patch only came to my mind this morning... Is there a howto somewhere ? thanks in advance. Jerome Alet ___ 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] [PATCH] to Zope's Management Interface
On Mon, 29 Apr 2002, Steve Alexander wrote: Hannu Krosing wrote: As always any comment is very welcome. Have you thougth of making this a Hotfix instead of patch ? Please don't call this a hotfix. That term is reserved for products that fix important bugs (especially security bugs) in Zope. A product can dynamically patch things, using the same mechanism as a Hotfix. However, use of this mechanism does not qualify a product as a Hotfix. The terms monkeypatch and dynamic patch have been used to describe this mechanism. Please use one of these in preference to Hotfix. Perhaps you could tell me if I have to use the App.Hotfixes interface or not when doing such a not-Hotfix thing. Thanks in advance. Jerome Alet ___ 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] [PATCH] to Zope's Management Interface
On Mon, 29 Apr 2002, Steve Alexander wrote: You should certainly not use the App.Hotfixes interface for this. The App.Hotfixes interface is for registering dynamic patches that will become part of Zope in a future release, at which point the dynamic patch can be removed. ok, so if I understand correctly all I have to do to make a not-hotfix product is just do an unconditionnal assignment of my new complete main.dtml file to ObjectManager.ObjectManager.manage_main in my product's __init__.py file ? am I right ? While you are dynamically extending Zope, I don't think there are any plans to incorporate this into the core Zope distribution. :-) bye, Jerome Alet ___ 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] [PATCH] to Zope's Management Interface
On Mon, 29 Apr 2002, Steve Alexander wrote: Jerome Alet wrote: ok, so if I understand correctly all I have to do to make a not-hotfix product is just do an unconditionnal assignment of my new complete main.dtml file to ObjectManager.ObjectManager.manage_main in my product's __init__.py file ? If the ObjectManager class has already been initialized, then its security declarations will have been applied to the preexisting main DTMLFile object. In which case, you'll have to re-initialise the class, or process your own security declarations, or something like that. Ok, for now I will go with the patch, and I'll think more about this for the next version. thanks for the help. Jerome Alet ___ 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: [Zope] [PATCH] to Zope's Management Interface
On Mon, 29 Apr 2002, Roel Van den Bergh wrote: The download file at http://www.librelogiciel.com/software/ZShell/tarballs/zshell-1.42.tar.gz cannot be opened on W2K with Winzip 8.0 (tested on several different machines) could you download it again ? I've tested here (no windows, sorry) and it's ok, file size is 46686 bytes and md5sum is : 6efb9c10e532d534fb843354ac28c5bb maybe it was corrupted during the download phase. hth. Jerome Alet ___ 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] RFC : AnyScripts
Hi, I'm finally toying, after having stalled a too long time, with the creation of ZShellScripts, which would be for ZShell commands what PythonScripts are for Python... The current, not yet available, incarnation is very highly based on PythonScripts, however I wondered if something better couldn't be done, because it seems to me to be an unneeded repetition of most of the PythonScripts' code : AnyScripts AnyScripts would have a mandatory first line similar to the one of any Unix shell script. By unix shell script I mean any script which can be launched directly under Unix, not only bash or csh scripts, but also perl, tcl, etc... So an AnyScript would contain a first line like : #! /scripts/interpreter And the execution of this script in the context on which it is applied would be delegated to another object present in the path which was set on this very first line, i.e. /scripts/interpreter So you could put any interpreter object of your choice in for example the /scripts folder (no path would mean search the interpreter object within the acquisition path) For example PythonScripts would contain something like : #! /builtins/python or something like that. Out of my mind I can already think of a ZShell interpreter object, but why not other types of interpreter objects : perl tcl C (the language ! Why not after all) etc... Each interpreter object would have at least two methods : compile() = returns a code object from source code, if meaningful (otherwise returns the source unchanged), to be stored in the AnyScript object which calls the compile() method. execute() = executes the above code object. This method of the Interpreter object would be called by the AnyScript object at run time, passing it the code object obtained with compile() Of course all of this come straight out of my mind, and there would probably be some problems I'm not able to understand yet... Bound variables would be like for PythonScripts, with the exception of their content would be the best format for the Interpreter in question, so each Interpreter object would probably also have a bind() method which would bind vars in the preferred format for the AnyScript object which calls this method, and would be accessible using the preferred syntax of the langage in question, e.g. : for PythonScripts, vars like context would be Zope Objects, like they currently are. for ZShell AnyScripts, vars like context, would be paths to Zope Objects, and accessible with names like $context for example. for C AnyScripts, vars would probably be something like PyObjects pointers. etc... So AnyScripts objects would interact with their interpreter object of choice to compile their source code, bind their vars, then finally execute the code and get the result back. What do you all think about this idea ? Are any of you interested ? I admit I don't know anything about the feasability of such a project with other languages than ZShell, however if a single implementation could be done, then anyone could add his own interpreter later... PS : I'll do ZShellScripts anyway... bye, Jerome Alet ___ 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] multiple database connections
Hi, First I have to say I've not tried what is discussed below, I'm just thinking about how this could be done... Say I have several relationnal databases, both have an identical structure. Since these databases are identical, all my ZSQL methods can be used with any of them. So I plan to architecture my Folder tree like that : Level0 | +-- ZSQLMethod1 +-- ZSQLMethod2 +-- ... +-- Level1-1 | | | +-- DAConnection | +-- ... some stuf specific to this database ... | +-- Level1-2 | +-- DAConnection +-- ... some stuff specific to this database ... Each DAConnection connects to a different database, but the id is identical in order for the ZSQL methods to find it in whichever folder they are called. Now the problem is : one can't create a ZSQL method if there's no DAConnection at the same level or above. I suppose that creating all my ZSQL methods in for example Level1-1, then cuttingpasting them in Level0 could work, but I find this very counter intuitive. And if this would work, then the ZSQL methods wouldn't be editable anymore since at Level0 there's no DA... So my question is : why the hell can't developpers create ZSQL methods as they see fit, and be allowed to type-in the name of a possibly not-yet-existing Database Connection ? After all, creating ZSQL methods isn't for end users, so maybe Zope could trust developpers in knowing exactly what they want to do... Adding a free text field and allowing a Free entry in the drop-down list in the ZSQL method creation form would help. The Test tab form could also be modified to allow the developper to choose any DA at test time. Any comment or a solution to do this the right way ? thanks in advance. Jerome Alet - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] WebDAV locks disappearing...
Hi, I've just tested webDAV access for the very first time using cadaver, so maybe this is a known problem. I've locked some objects using cadaver's lock command, and then opened a browser keeping cadaver's connection opened. then I've searched for this locks using the ZMI and also a method of my own. All worked fine, the locks were found. Then some time later I've retried to find the locks, and both the ZMI and my method returned no lock. However in cadaver the locks still seemed to be there... Then I've unlocked the objects and relocked them in cadaver and retried, this time the locks were found again... I hadn't the time to do some more testing but I find this surprising. Does anyone have seen the same problem ? FYI Zope 2.5.0 + Python 2.1.2 both up-to-date Debian Woody packages. bye, Jerome Alet ___ 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] multiple database connections
On Thu, Mar 07, 2002 at 03:28:28AM -0800, kapil thangavelu wrote: On Thursday 07 March 2002 02:34 am, you wrote: not-yet-existing Database Connection ? After all, creating ZSQL methods isn't for end users, so maybe Zope could trust developpers in knowing exactly what they want to do... that said, zope doesn't stop a *developer* from doing it themselves. Thanks! Jerome Alet ___ 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] WebDAV locks disappearing...
On Thu, Mar 07, 2002 at 01:55:45PM -0500, Andreas Jung wrote: From: Jerome Alet [EMAIL PROTECTED] All worked fine, the locks were found. Then some time later I've retried to find the locks, and both the ZMI and my method returned no lock. However in cadaver the locks still seemed to be there... perhaps a problem with the lock timeout ? i think webdav clients can specify a timeout for locks. I don't think so since the client still saw the locks. The Zope server however showed that they had disappeared, as seen from the ZMI and from my method's result. for further investigations you can use the WebDAVLogger product to capture webdav related traffic. Ok I'll try to do this. thanks for the tip ! bye, Jerome Alet ___ 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] Zope 2.6 planning - call for contributors!
On Wed, 6 Mar 2002, Joachim Werner wrote: - All the basic API (like store, delete, edit, ...) must be free of HTTP specifics, so that I can modifiy content either over a web frontend or over WebDAV, FTP, ... - and even via a fat client application like a wxPython application. Currently that one is a mess. +5 Jerome ___ 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] syslog
On Wed, 3 Oct 2001, Toby Dickenson wrote: On Mon, 1 Oct 2001 20:53:00 +0200, Jerome Alet [EMAIL PROTECTED] wrote: It may prove to be useful when you want to do remote logging: you send all to the local syslog which in fact forwards it to a remote syslog server. I understand the interest for remote logging of events - thats what I am using syslog for. Does the same apply to access logs too? (that is, the entries which also get written to var/Z2.log) Sorry, I don't know. In fact I don't use syslog with Zope, this was just a general answer. Because Apache is often used in front of Zope, it's probably even better (quicker) to let Apache do the access logging and disable it entirely from Zope. bye, Jerome Alet ___ 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] syslog
On Mon, Oct 01, 2001 at 04:14:47PM +0100, Toby Dickenson wrote: A question for all syslog users; is it ever useful to send access logs to syslog? (I can't think of good reason, but my syslog zen quotient is still low). Is anyone else even using syslog? It may prove to be useful when you want to do remote logging: you send all to the local syslog which in fact forwards it to a remote syslog server. hth. Jerome Alet ___ 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] Vulnerability in Zope
On Sun, Sep 23, 2001 at 10:36:33AM -0400, Paul Everitt wrote: Do others consider this a vulnerability? While it reveals more information than people might want, I'm curious about scenarios under which it could be exploited. If any of you know of something *specific*, meaning it's a genuinely exploitable vulnerability, please email me or Brian Lloyd ([EMAIL PROTECTED]) directly, rather than explain to the world how to do it. ... ... Bobo-Exception-File: /usr/local/base/Zope-2.3.2-modified/lib/python/OFS/Property Think about social engeniering. Knowing this sort of things, while this is not a vulnerability in itself, allows everybody to remotely know were Data.fs is. bye, Jerome Alet ___ 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] Weird message from Python Scripts
Hi, On Wed, 4 Jul 2001, Chris Withers wrote: Shane Hathaway wrote: It's behaving correctly. Visit the scripts and click Save changes to compile. (You don't have too many, do you?) 30-40 :-( What short python script would do this for me? I'm guessign something like: for s in context.ZopeFind(spec=['Python Script']): s.edit() ...or something? I think ZShell could do that, probably with its call command. get it from: http://cortex.unice.fr/~jerome/zshell and remember: the man command is your best friend. bye, Jerome Alet ___ 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] ZPL and GPL
On Mon, Jun 25, 2001 at 12:22:32PM -0700, Michael R. Bernstein wrote: Other than keeping the door open for this eventuality, is there any other reason to choose a BSD style license over the GPL? ... Unless I've misunderstood something (which is certainly possible), DC doesn't seem to have anything to lose by switching from a BSD style license to the GPL (or a GPL style license with an additional optional attribution clause), and quite a bit to gain. I personnally would love to see both Python and Zope be GPLed. However we should take into consideration the fact that this would mandate that any Zope product should be GPLed too, since in the FSF view we link them to Zope. The same for Python C extensions, we would link them to a GPLed software (Python), so they would have to be GPLed too. That's why I'm pretty sure that unfortunately both Zope and Python would loose supporters if they were GPLed. bye, Jerome Alet ___ 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: command-line zope.org product upload ?
Hi, Simon Michael wrote: Morten W. Petersen [EMAIL PROTECTED] writes: Cool. And maybe some apt-get functionality? Like 'zope-apt-get dist-upgrade'? :-) uh, Jerome ? Hey, uh, me and the folks on the list think there's this one little extra that would make zshell perfect.. :) Sorry for being late, I hadn't yet subscribed to this list. I'd love to do this, however it seems to be very difficult until a standard Zope package file format exists. See my posts on this subject on [EMAIL PROTECTED] However I think a shell command could help, e.g. in ZShell dialog box you'd type something like: shell apt-get update shell apt-get upgrade This would do it, but you'll need to have an apt-get wrapper which would have to be setuid root, so this would be very dangerous. the best solution is of course to standardize on one file format, and tweak Distutils to do what we want, then adding zope-apt-get to ZShell (or why not directly to Zope) will be trivial. bye, Jerome Alet ___ 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] Problem with Cut and Paste
Hi, First I'm sorry if this message was already received in this list, but I'm sure I've not received it to confirm, so I send it again, sorry for the inconvenience. I'm trying to modify OFS/dtml/main.dtml and OFS/CopySupport.py in order to create a shortcut button to cut an object and paste it in the parent object in one click, because I think this may save lots of boring clicks, at least for me. When I call the following method from the management interface (OFS/dtml/main.dtml) then I receive this error: "The data in the clipboard could not be read, possibly due to cookie data being truncated by your web browser. Try copying fewer objects." But when I call if from a PythonScript it works fine. My method, bound to a MoveUp button of my own: --CUT--- def manage_moveupObjects(self, ids=None, REQUEST=None): """Moves the selected objects to the parent objets (e.g. Folder)""" if ids is None and REQUEST is not None: return eNoItemsSpecified elif ids is None: raise ValueError, 'ids must be specified' if type(ids) is type(''): ids=[ids] if hasattr(self, 'aq_parent') and hasattr(self.aq_parent, 'manage_pasteObjects') : cb_copy_data = self.manage_cutObjects(ids, REQUEST) return self.aq_parent.manage_pasteObjects(cb_copy_data, REQUEST) ---CUT--- If I call self.aq_parent.manage_pasteObjects with None as the first parameter then it works fine from the management interface but not from a PythonScript: I receive a "No clipboard data found" error. Please could someone explain me what the problem is ? (I want it to work both from the management interface and from Python) Thanks in advance. Jerome Alet ___ 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] Problem with Cut and Paste
On Tue, Jan 30, 2001 at 11:13:52AM -0500, Brian Lloyd wrote: I'm trying to modify OFS/dtml/main.dtml and OFS/CopySupport.py in order to create a shortcut button to cut an object and paste it in the parent object in one click, because I think this may save lots of boring clicks, at least for me. When I call the following method from the management interface (OFS/dtml/main.dtml) then I receive this error: "The data in the clipboard could not be read, possibly due to cookie data being truncated by your web browser. Try copying fewer objects."] Jerome - most Web browsers have a maximum limit to the amount of cookie data that they will preserve from a given site (usually around 4k as I recall, though this may vary from browser to browser). If you have a lot of cookies from this site already, your browser may be silently truncating the cookie data sent. You could check this by looking at the length of the data you get from manage_cutObjects as cb_copy_data. I've done this modification on a fresh 2.3.0-final installation with no other products installed, on localhost, and no special content other than a folder and an index_html document to test my modifications. However I've tested what you suggested, after deleting my Netscape 4.75 cookies file under Linux (2.2.18 kernel), the problem remains. If I check the cb_copy_data length then it returns: 16765 under Netscape and 14xxx under Lynx With Lynx I've got the time to see a message saying "500: Internal Server Error" but then it disappears and the message about the cookie length appears. Please could you test my method and see if it works for you because I sincerely don't know why it doesn't work here ? Thanks in advance for your time. Jerome Alet ___ 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] BUG? was Re: [Zope] Problem with Cut and Paste
Good evening again, On Tue, Jan 30, 2001 at 08:45:06PM +0100, Jerome Alet wrote: On Tue, Jan 30, 2001 at 02:24:50PM -0500, Brian Lloyd wrote: This is your problem - Netscape allows a maximum of 4k of cookie data for a given site (and silently truncates the rest). I'm sorry but AFAIK there's nothing sending cookies to my browser from this installation. More than that, if I manually cut then paste the same object with the Cut and Paste buttons in the management interface it works perfectly, and in this situation the cookie data should be exactly the same, correct me if I'm wrong. I think I've found where the problem comes from, it has nothing to do with browsers or cookies (or me) AFAICT. When manage_cutObjects() is called with REQUEST != None (i.e. when used from the management interface) then instead of the cut objects it returns the value returned by manage_main(), this explains why my cb_copy_data was bad. I've sligthly modified manage_cutObjects() to confirm that's the problem: I've added a fourth parameter called noredirect to this method, this parameter is a named one and defaults to 0, then at the end of this method, I've just done: if not noredirect : return self.manage_main(REQUEST) return cp Now it works fine both from my new management interface (Zope's modified one) and from python scripts, with a method which does essentially the following: cb_copy_data = self.manage_cutObjects(ids, REQUEST, noredirect = 1) return self.aq_parent.manage_pasteObjects(cb_copy_data, REQUEST) In other terms manage_cutObjects() wasn't designed to be immediately followed by a call to another method when used from the management interface. Not sure if this is a bug, however it seems this is a common problem in Zope manage_() methods. hoping this will help bye, Jerome Alet ___ 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] License
On Mon, 29 Jan 2001, Chris Withers wrote: And the reason I asked is 'cos, as I understand it, if I use a GPL-licensed product in a product/solution I provide, then I have to do that for free and open source it too, which often isn't an option :-( Of course you DON'T have to do your work for free !!! How could someone make a living. The GPL says clearly that you are perfectly allowed to sell your work. However if your soft is GPLed or uses some GPLed code then you must distribute (sell) your code along with all its sources, or the sources should be made available for all at a minimal fee covering the reproduction costs (a CDR probably) The point is you should sell your service instead of your code. hoping this will help your better undersstand what the GPL is all about. bye, Jerome Alet ___ 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] ANNOUNCE: please have a look at ZDatabaseTool
On Mon, 29 Jan 2001, Andreas Heckel wrote: BTW: Why I'm not surprised the trouble starts with Win ;-) Oh, please !!! Please don't start a new flamewar here ;-)) bye, Jerome Alet ___ 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] BUG: Typo in CopySupport.py in 2.3.0 final
Hi, Line 282 of lib/python/OFS/CopySupport.py of 2.3.0 final reads: raise 'BadRequst','Please rename each listed object.' Instead this should probably be: raise 'BadRequest','Please rename each listed object.' since all the other .py in this directory raise 'BadRequest' no patch this time. hoping this will help. bye, Jerome Alet ___ 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] BUG with a patch
Hi, the way the manage_renameObjects() method was coded made it impossible to exchange two objects ids in one pass, e.g. rename Obj1 to Obj2 and Obj2 to Obj1. The attached patch seems to correct this problem, however a better temporary id construction method is needed. I've tried to submit it to the colector but I don't know if it succeeded. hoping this will help Jerome Alet --- CopySupport.py.2.3.0-final Sat Jan 27 10:04:42 2001 +++ CopySupport.py Sat Jan 27 10:10:48 2001 @@ -280,9 +280,20 @@ """Rename several sub-objects""" if len(ids) != len(new_ids): raise 'BadRequst','Please rename each listed object.' +conflicts = [] for i in range(len(ids)): if ids[i] != new_ids[i]: +if new_ids[i] not in ids : # may a conflict occur ? self.manage_renameObject(ids[i], new_ids[i], REQUEST) +else : +tempo = ".temporary_%i_" % i +self.manage_renameObject(ids[i], tempo) +conflicts.append((tempo, new_ids[i])) + +# now we rename conflictuous objects +for (old, new) in conflicts : +self.manage_renameObject(old, new) + if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) return None
Re: [Zope] Add this and possible bug, was Re: [Zope] Add this to Wish list
On Thu, 25 Jan 2001, Jerome Alet wrote: [PARENT] = which moves the selected objects up to the parent folder. Of course this is just a convenience for Cut Paste, but saves some clicks. bye, Jerome Alet ___ 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] Add this to Wish list
Hi, Maybe I've not seen the easy way to do it, if so tell me I'm stupid, but one thing would be very nice in the future version of Zope: A way to download Python Script's sources Now I cut and paste but it's horrible. Please could you include a button "Download Source" to the Python Script edition form ? Thanks in advance. Jerome Alet - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] PythonScripts editable through FTP?
On Wed, 24 Jan 2001, Chris Withers wrote: Jerome Alet wrote: Maybe I've not seen the easy way to do it, if so tell me I'm stupid, but one thing would be very nice in the future version of Zope: A way to download Python Script's sources Now I cut and paste but it's horrible. Can't you use FTP to edit them? I sincerely don't know because I've disabled FTP here. I've faced the problem because I wanted to print a Python Script but Netscape 4.76 (under Linux) hasn't printed the frame correctly. bye, Jerome Alet ___ 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] PythonScripts editable through FTP?
On Wed, 24 Jan 2001, Chris Withers wrote: Jerome Alet wrote: I sincerely don't know because I've disabled FTP here. How come? What about WebDAV? don't use it either. I want to use my own text editor (JERED), not because it's the best to develop (far from that in fact) but because it works exactly like I want it to work (which is normal since I've written it). Unfortunately it doesn't handle WebDAV or any other Internet protocol... Anyway, thanks for all. Jerome Alet ___ 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] Add this and possible bug, was Re: [Zope] Add this to Wish list
On Wed, 24 Jan 2001, Evan Simpson wrote: From: Jerome Alet [EMAIL PROTECTED] Please could you include a button "Download Source" to the Python Script edition form ? Already done; There's a link in the paragraph below the text area, and above the upload form (in CVS). Thanks a lot ! Now please another wish: I've done what I describe below for my own work, but I think this might be interesting to integrate it in Zope's core: Wouldn't it be fine if you added three buttons on the same line as Rename Cut Copy Delete Import/Export in the manage_main page. These three buttons would be: [PARENT] = which moves the selected objects up to the parent folder. [UP] and [DOWN] = which rename objects the following way: Let's say I've got the following folder content: MyFolder |--Object1 (Title1) |--Object2 (Title2) |--Object3 (Title3) |--Object4 (Title4) Then pressing on the [UP] button having Object3 selected I'll obtain: MyFolder |--Object1 (Title1) |--Object2 (Title3) |--Object3 (Title2) |--Object4 (Title4) and the same for the [DOWN] button. This might prove to be useful if you want to keep a certain structuration based on the objects' ids, but be able to change their order without modifying the ids. I hope what I ask is clear and someone else sees an utility for that. Doing that I've found a possible bug (maybe bug isn't the appropriate word) with the manage_renameObjects() method: this method accepts ids and new_ids as its arguments, ids is a list of the old ids to rename, and new_ids the new ones. If you want to exchange 2 ids (e.g. rename Object1 to Object2 and Object2 to Object1 which both exists) then there's an exception saying that one of the ids already exist. So instead of one call to manage_renameObjects() to rename both objects in one pass, you have to call it three times: one time to rename Object1 to a temporary id, one time to rename Object2 to Object1 and one time to rename "tempid" to Object2. My question is: Could you do something about this "small" problem ? bye, and thanks for all ! Jerome Alet - http://cortex.unice.fr/~jerome ___ 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] exchanging ids in a single transaction
Hi, I'm currently thinking about a project in which I'd want to be able to exchange 2 objects ids. My plan is to save the first one's id then rename the first one with the second's id then rename the second with the first's id which is very classical. I've got no code yet, but I want to know if there's a method to do all this in a single transaction: if any error occur then I don't want any id to be changed Is it possible and How ? Should I use the UNDO machinery to do that or is it possible with another way ? When I rename an object will my Data.fs grow (some objects may be 5 MBytes large, but rarely) ? Any tip will be appreciated. Jerome Alet - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] : Postgre installation problem
On Tue, 23 Jan 2001, K H Subrahmanyan wrote: I have installed postgre SQL in my linux server. I have installed ZpopyDA to my zope installation. but when I run the server I get the following error. ZPoPyDA Import Traceback raise "The PoPy module is not installed" The PoPy module is not installed This is very clear. You don't have installed the PoPy module PoPy is needed by ZPoPyDA PoPy is the layer between PostgreSQL and ZPoPyDA: PostgreSQL -- PoPy -- ZPoPyDA -- Zope hoping this will help bye, Jerome Alet ___ 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] ZWiki -- MS Word
On Tue, 16 Jan 2001, peter bengtson wrote: I'm looking for some tool to convert ZWiki text to MS Word. Reason being that my boss wants it in MS Word, and I do all my typing as ZWiki's. Why don't you save the content as plain text with a .doc extension (eventually adding the CR befoe each LF character). Your boss will then be able to read it from Word directly. I bet your boss won't see anything, and it's very easy to do (at least I suppose) hoping this will help. bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] Downloading All Zope products
On Thu, 11 Jan 2001, ethan mindlace fremen wrote: Jerome Alet wrote: You can find it at http://www.zope.org/Members/jerome/ZCPL This is not a dreadful thing, but how is it different from: http://www.zope.org/Products/all_products?batch_size%3Aint%3Arequired=265 It is VERY different because your page isn't easily suckable with Wget or other similar tools: it contains lot of links which will pollute your downloaded directory: the goal is to suck all products in one Wget run. My page is more ressembling Martijn's one at http://www.zope.org/Members/mj/AllProds In fact these two pages are almost exactly the same, because I wasn't aware of Martijn's one existence What I don't like is people using wget to suck the entire site and then hitting (for example) the "tree" version of the Zope Quick Reference and expanding *every single node*. ;-) bye, Jerome Alet ___ 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] Downloading All Zope products
On Thu, 11 Jan 2001, Marcin Kasperski wrote: Very nice, thanks. Nevertheless, I still dream about some categorized Zope products directory, which could be downloaded with one step and put on the CD-ROM (I mean sth like your page but with content categorized - like the zope products page on zope.org do - and annotated with recent change date and required zope version). I've done it. Look at the new version at http://www.zope.org/Members/jerome/ZCPL Comments are welcome. bye, Jerome Alet ___ 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] Downloading All Zope products
Hi, I was bored by the current search interface for downloading Zope products: you have to spend hours just clicking to download lots of products. I want to put Zope and the maximum number of available products on a CDROM to be able to do demos and so on to people not connected to the Net. I've decided to do something to solve this problem, so I've created the "Zope Complete Products List for easy batch download". You can find it at http://www.zope.org/Members/jerome/ZCPL This document dynamically lists all available Zope products (from zope.org) and for every product put one and a single link to its latest version archive. It also explains how to download all Zope products available in one Wget run, but please consider not making this an habit because the DC folks don't seem to like that (see http://www.zope.org/robots.txt). DC folks, if you find this document should be destroyed now then just do it, I don't want to put your servers on their knees. Hoping this will help someone else. Any comment is very welcome. bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] Downloading All Zope products
On Thu, 11 Jan 2001, Martijn Pieters wrote: BTW, did you knw I made a page for the exact same purpose a while ago? http://www.zope.org/Members/mj/AllProds Of course not, otherwise I hadn't made it by myself. I thought it was a cool idea (and above all it was very easy to do), unfortunately someone else thought the same before ;-) Perhaps putting a link to your own page on the "All Products" page at zope.org would be useful ? Anyway thanks for all. Jerome Alet ___ 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] permissions problem upgrading to 2.3.0a1 from 2.1.6
Hi, I've been using 2.1.6 for a long time without any problem, using a home compiled python 1.5.2 Yesterday I've tried to upgrade to 2.3.0a1 the following way: export each and every home made sites and products (ZClasses) from 2.1.6 stop 2.1.6 install 2.3.0a1 and start it import each and every exported sites and products (I've not tried using the same Data.fs as 2.1.6) In all instances of a ZClass I've made, I used to (in 2.1.6) call a DTML method from my browser which was protected in a way to display the authentication box, allowing me to enter my username and password. The username and password should give me a role created in the ZClass instance constructor, this role is allowed to create and modify some subobjects (another ZClass) Since I've installed 2.3.0a1 then when I tell my browser to "call" the DTML method the authentication box appears but I'm not able to authenticate myself: it always give me an unauthorized exception. Looking at zope log it gives me a 401 error on the DTML method. If I modify this method to do nothing but return plain text the problem persists. I've checked several times the username and password and I'm sure I've typed them correctly. In one instance of my ZClass I've tried to give all permissions to the created role, but with no luck. I've finally stopped 2.3.0a1 and relaunched the 2.1.6. Does someone have any idea of where the problem may come from ? Should I try to use the same Data.fs of 2.1.6 ? Should I try to use 2.2.5 instead of 2.3.0a1 (I'd like to be able to use PythonScripts) ? Thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] permissions problem upgrading to 2.3.0a1 from 2.1.6
On Wed, Jan 10, 2001 at 09:49:53PM +0100, Dieter Maurer wrote: Jerome Alet writes: ... permission problem upgrading ZClasses from 2.1.6 to 2.3a1 ... Are your ZClasses pure Zope ZClasses or do they contain Python based products? They contain some PythonMethods (not Scripts !), external methods, but the method which poses a problem is pure DTML. There was a big shift in security policy during Zope 2.1.x to Zope 2.2.x. Many Python based products need to be changed in order to be compatible with the new security policy. This is excellently explained in a paper from Brian: "... Upgrading to Zope 2.2 ..." I thought I've already read it IIRC, but I'll reread it more carefully ASAP. Thanks for your help. Jerome Alet ___ 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] Creating product with Python
On Wed, 20 Dec 2000, Ivan Somov wrote: Missing doc string at: http://localhost:8080/a/manage_addProduct/Boring/manage_addBoring I tried to change "manage_addBoring" method, and compared my product with other working products, by there was no results from my attemptions. What that Error message means? This is self explanatory: each of your methods needs a docstring, e.g.: def mymethod(self, ...) : """My doc string""" ... otherwise Zope don't like them hoping this will help Jerome Alet ___ 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] Best Zope way to split a textfield on 2000 char increments
On Fri, 15 Dec 2000, Steve Drees wrote: somestring[:1999] is the first 2000 characters of somestring. Not to be a poseur but: somestring[:1999] is the first 1999 characters of somestring, because in Python indices begin at 0, e.g.: a="0123" print a[:3] gives "012" which are the first 3 characters from a. bye, Jerome Alet ___ 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] Re: [Zope] IE5 / Medusa bug?
On Thu, 14 Dec 2000, Evan Simpson wrote: From: seb bacon [EMAIL PROTECTED] I imagine the fact that I can make it work by adding index_html is the most telling point, but it's not telling me anything ;) Leaving off index_html causes Zope to add a base href to the head. That's WHOW ! base href is exactly 11 bytes long. Couldn't it be that the content-length is computed by Zope before you automatically add this tag ? just my 0.02 euros Jerome Alet ___ 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] How to debug access denials?
On Thu, 14 Dec 2000, Chris Withers wrote: Stephane Bortzmeyer wrote: Is there a way to get an extended log, such as "anonymous user denied because index_html called standard_html_header which called getData and getData is a database connection and they don't have permission to use database connections"? If you hit cancel when the dialog box pops up, you'll get an error message. If you view the HTML source of that error message, there'll be a python traceback in there which should provide the information you're looking for... May I add: "... in an incredibly unreadable and hardly understandable format." ? What Stephane asks for would be very nice, IMHO. bye, Jerome Alet ___ 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] IE5 / Medusa bug?
On Thu, 14 Dec 2000, Evan Simpson wrote: From: seb bacon [EMAIL PROTECTED] I imagine the fact that I can make it work by adding index_html is the most telling point, but it's not telling me anything ;) Leaving off index_html causes Zope to add a base href to the head. That's WHOW ! base href is exactly 11 bytes long. Couldn't it be that the content-length is computed by Zope before you automatically add this tag ? just my 0.02 euros Jerome Alet ___ 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] adding roles to Zope in Product.initialize()
On Wed, 29 Nov 2000, Randall Kern wrote: By "use local roles", you mean do it manually, through the web ui? I don't see how I could create a local role from code either, since none of my objects have been created yet. You can do it in the manage_afterAdd() method of your class: ---CUT--- def manage_afterAdd(self, item, container) : # create the role only if it doesn't exist (acquisition) if "yourrole" not in container.valid_roles() : self._addRole("yourrole") # # here you may need to call the manage_afetrAdd() method # of you base class # e.g.: Folder.manage_afterAdd(self, item, container) ---CUT--- So the role will be created in your instance during its creation, but only if doesn't exist yet (or can't be acquired from the above level). hoping this will help. Jerome Alet ___ 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] seeking zope success stories in higher education
Hi, We are planning to choose a platform to build a portal for distance learning, with which we want to Build and Serve online multimedia courses, online exams, calendars, keep track of students work and results, forums, etc... I've got a list of criterias the platform must fill to be chosen, and at first glance Zope fills at least 90% of them, and probably more if I look more closely at the Zope products already available. This is a big project, and some people have already done some work using WebCT. I've read in the zope-edu wicki the comment on WebCT, I already know that many people (at least 35) are interested byt his subject because they are referenced as contributors in this wicki, so I naively conclude I'm right in thinking that Zope is the good choice for us. So I have to write a document explaining the pros (and cons) of choosing Zope, and I want some references of Zope uses in higher education if possible. Please could someone send me any testimonial on the (successful or not, and why) use of Zope in higher education, the products which might help us (we will at least need SquishDot, the LDAP adapter, the Oracle adapter, the KnowledgeBase product, etc...). I'm also interested in testimonials about the use of WebCT or similar products. Thank you very much. PS: As always this is urgent :-( Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] The Calendar Tag
On Mon, 20 Nov 2000, Kaeidinejad, Shahram wrote: How can give me more information about product "The Calendar Tag"? Is may be to use "The Calendar Tag" with MS-Outlook? The CalendarTag's purpose is to render calendars in html (or dtml ;-) documents. The webmaster only has to code the rendering of one cell (day), and the CalendarTag does the rest. Since MS-Outlook isn't a web browser I doubt you can use it, however in a day cell you can do whatever you want, so maybe you can send mails whenever someone sees this day, and receive the mails in Outlook. Maybe someone else has got a better idea. bye, and good luck. Jerome Alet ___ 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] Re: DateTime
On Fri, 10 Nov 2000, Chris Withers wrote: mxDateTime is _not_ the DateTime in Zope. If only it was It's voting season, so I vote +10 for this one. bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] Single html checkbox as list?
just do something like: input type="checkbox" name="yourname:list" good luck Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE On Mon, 25 Sep 2000 [EMAIL PROTECTED] wrote: Hi, since I didn't find anything on that topic, the solution might be obvious but I ran into the following problem: I have a html form with several checkboxes. If one checkbox is selected, the variable containing the result is represented by a string, if two or more checkboxes are selected the variable is represented by a list. Is there a way to force the variable to be a list, even if only one checkbox is selected? greetings clamor ___ 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 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] Should I use ZODB or not ?
On Tue, 19 Sep 2000, Jason Cunliffe wrote: I am curious how do you all think LocalFS would perform for such a big multimedia application.? http://www.zope.org/Members/jfarr/Products/LocalFS Use Zope for managing meta-data, or mayeb even better Zope + a fast DB tool for the metadata part. Let Zope do its holy best for the 'virtual-object interfacing' jobs, let the others do their thing.. This may very well be the best solution, as far as I understand what LocalFS is (I've not used it for now, however), because this may allow us to set per-domain (Medicine, Maths, etc...) permissions under Zope, and do all the presentation in Zope, while not being attached to Zope if we want to easily dump our datas somewhere else. Thanks to all. Now all I have to do is just kill these PHP guys there ;-)) bye, Jerome Alet ___ 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] How best to restart Zope?
On Tue, 19 Sep 2000, J. Atwood wrote: Put this in your 'start' script -Z /home/local/zope/var/Z2.pid It watches the PID and if it fails will restart it. Ok, my script covered a very different problem: Zope instances were still active and running, but unable to serve requests. My script tries to detect this situation because in this case -Z would be inefficient, and tries to restart Zope after a timeout. Sorry if it didn't answered your question. bye, Jerome Alet ___ 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 and the GPL poison pill
On 13 Sep 2000, Erik Enge wrote: And if it really is Products (as in lib/python/Products), does this mean that if I make a GNU GPL licensed application for a client, I can't actually distribute Zope with it? I have to install them separately? Maybe this is stupid, but I'm sure it would clarify the situation for all of us if DC and the FSF could get in touch, talk about all this, and give us a final explanation, agreed by both, explaining exactly what we can and can't do regarding this licensing problem. bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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 and the GPL poison pill
On Wed, 13 Sep 2000, Andrew Kenneth Milton wrote: The second reason is that GPL attracts fanatics. Just look at any discussion forums where the issue comes up. You cannot have a calm discussion and mention the GPL. Sorry, but until I've received your previous message, and the one about napalm, I've found this discussion very calm and interesting, now IMHO all we have to do is to wait for something from DC and the FSF. Jerome ALET - GPL Fanatic, and proud of it. ___ 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] Your feedback: what should DateTime strftime() behavior be?
my vote is: +1 Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] Re: Probably Zope Bug (was: Re: [Zope] all DTML Methods of current folder and subfolder)
On Wed, 26 Jul 2000, Dieter Maurer wrote: I analysed this strange behavior in Zope 2.1.6 and have a partial explanation. Hi, thank you very much for your time, your explanations and your workaround. I'll test this ASAP and tell you the result. thanks again. bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] problem with manage_permission
Hi, I'm currently trying to create a python product. I've got a class named MyClass, and in the __init__ method I've got the following code: self.manage_addFolder(id="data", title="MyClass instance's datas") self._addRole('admin') self.manage_permission(permission_to_manage = "Access contents information" , roles = [ 'Manager', 'admin' ]) MyClass inherits from Folder. I want to programmatically create a 'data' Folder and an 'admin' role in each new instance of MyClass, and give this role and Manager (but not Anonymous) the "Access contents information" permission. The manage_addFolder and _addRole work fine, but the manage_permission call gives me the following traceback: Error Type: AttributeError Error Value: aq_acquire Traceback (innermost last): File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/local/zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /usr/local/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_addMyClass) File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_addMyClass) File /usr/local/zope/lib/python/Products/MyClass/MyClass.py, line 45, in manage_addMyClass File /usr/local/zope/lib/python/Products/MyClass/MyClass.py, line 153, in __init__ (Object: ElementWithAttributes) File /usr/local/zope/lib/python/AccessControl/Role.py, line 208, in manage_permission (Object: ElementWithAttributes) File /usr/local/zope/lib/python/AccessControl/Role.py, line 136, in ac_inherited_permissions (Object: ElementWithAttributes) File /usr/local/zope/lib/python/OFS/ObjectManager.py, line 173, in _subobject_permissions (Object: ElementWithAttributes) AttributeError: (see above) Surprisingly, if I delete the manage_permission line, restart Zope, re-add an instance of MyClass (it works), then try to manually modify the permissions using the MyClass instance's security tab, then it works flawlessly. Does anyone have got an idea about where the problem may come from ? thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] all DTML Methods of current folder and subfolder
Hi, now I'm at work I've tested your solution, read below. On Sun, 23 Jul 2000, Dieter Maurer wrote: Jerome ALET writes: I want to do the following loop in Zope 2.1.6: dtml-in "ZopeFind(this(), obj_metatypes=['Folder'], search_sub=1, obj_expr=XXX" where XXX is "not objectValues(['Folder'])" What is the correct syntax (', " and """ nesting) for that ? You can use: ... obj_expr='''not objectValues(['Folder'])''' ... or ... obj_epxr='not objectValues[\'Folder\']=' ... Thanks to you, the syntax you gave me is accepted by the dtml parser, but both dtml-in "ZopeFind(this(), obj_metatypes=['Folder'], obj_expr='''not objectValues(['Folder'])''', search_sub=1)" and dtml-in "ZopeFind(this(), obj_metatypes=['Folder'], obj_expr='not objectValues([\'Folder\'])', search_sub=1)" have given me an empty list. If I don't use obj_expr then I've got the full recursive list of all subfolders from the current folder. Knowing that the Zope Search Interface allows me to type this expression in the obj_expr field and gives me the correct result, what could be the problem I encounter ? I know I could build a correct list by putting a test inside my dtml-in loop, but I really prefer to understand why this doesn't work, and all I can say now is: I don't understand at all. Does anyone have an idea about where the problem comes from ? thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] looping through objectValues, how to get methods?
On Wed, 19 Jul 2000, ed colmar wrote: I have a method that looks through "objectValues". Using "hasattr" and "getattr" I can see the variables contained in the object. How do I get the values generated from an object's method in a similar fashion? For example: if hasattr(i, 'djname'): #get djname variable if hasattr(i, 'mixing_for()'): #try to get mixing_for() method did you try removing the parenthesis, like: if hasattr(i, 'mixing_for') good luck Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] hard dtml syntax problem
On Wed, 12 Jul 2000, ethan mindlace fremen wrote: Jerome Alet wrote: Hi want to call ZopeFind to find all folders in the current folder which doesn't have got any subfolder. the following query works but returns all folders, even those which have got subfolders: dtml-let myresult="ZopeFind(this(), obj_metatypes=['Folder'], search_sub=1)" dtml-in myresult ... /dtml-in Couldn't you just do a nested dtml-in? It's kind of hacky, but... dtml-in "objectValues(['Folder']" dtml-in "objectValues(['Folder']" No this can't help because I don't know how deep is my hierarchy: I've delegated folder creations to at least ten persons. I'm sure I can do it with ZopeFind, because Zope do it in the Find (Advanced) tab, but don't know the exact syntax of: """ obj_expr = "not objectValues(['Folder'])" """ (which doesn't work because of nested " and ') Actually I've put a dtml-if inside of my dtml-in loop, but it limits my possibilities, especially because my result length is overestimated (all folders vs only folders with no subfolders). thanks anyway for your answer. bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] hard dtml syntax problem
On Thu, 13 Jul 2000, Bill Anderson wrote: Jerome Alet wrote: Hi want to call ZopeFind to find all folders in the current folder which doesn't have got any subfolder. Sorry, I should have added : recursively !!! I'm confused. You said you only were concerned about the _current_ directory's subdirectories not having sub-directories, right? IOW You have: ROOT FolderA -FolderA1 -FolderA2 /FolderA2A FolderB FolderC And in ROOT, you only want to see : FolderB FolderC And in FolderA: FolderA1 Right? No, what I want is the following list (with your example): ['FolderA1', 'FolderA2A', 'FolderB', 'FolderC'] I'm sure I can do it with ZopeFind, because Zope do it in the Find (Advanced) tab, but don't know the exact syntax of: """ obj_expr = "not objectValues(['Folder'])" """ (which doesn't work because of nested " and ') Actually I've put a dtml-if inside of my dtml-in loop, but it limits my possibilities, especially because my result length is overestimated (all folders vs only folders with no subfolders). Maybe I read it wrong, but I thought you said you wanted only folders with subfolders _in the current directory_. Maybe you need to rephrase your question? Yes I'm sorry: From a Folder, I want to recursively search for all "terminal" folders (leaves) and build a list of these folders. bye "terminal" folder, I mean a folder with no subfolder. The following should give me exactly the result I want, if only I knew how to write it in a way accepted by the dtml parser: dtml-let myresult="ZopeFind(this(), obj_metatypes=['Folder'], search_sub=1, obj_expr=""" not objectValues(['Folder']) """ )" ... /dtml-let My actual solution is to do : dtml-let myresult="ZopeFind(this(), obj_metatypes=['Folder'], search_sub=1)" dtml-if "not objectValues(['Folder'])" ... /dtml-if /dtml-let but this solution is not good because if I need len(myresult) it returns me the total number of folders, not the number of "terminal" folders, and I find it stupid to have to build a new list in a dtml-in and then loop over the new list in a second dtml-in because I know ZopeFind is the solution: can do it, I've tested it with the Find tab. My only problem is: What is that f... syntax ? Any DTML Syntax guru out there ? thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] hard dtml syntax problem
Hi want to call ZopeFind to find all folders in the current folder which doesn't have got any subfolder. the following query works but returns all folders, even those which have got subfolders: dtml-let myresult="ZopeFind(this(), obj_metatypes=['Folder'], search_sub=1)" dtml-in myresult ... /dtml-in So I play a little with the Zope Search Interface and I find that if I type in "not objectValues(['Folder']" (without the double quotes) in the obj_expr (Expression) field then this solves my problem. my question is: How to rewrite my ZopeFind with obj_expr="not objectValues(['Folder'])" ? I've tried with or without quotes (single, double and even triple ones), but with no luck: I've always got a Document Template Parse Error. What is the correct syntax please ? Actually I've added a test inside my dtml-in loop but I think it's stupid because I need the exact result length and I don't want to rebuild a list of matching results since the Zope Search Interface can do it. thanks in advance for any answer. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] Stupid Question Time
On Tue, Jul 11, 2000 at 04:00:26PM -0400, Terry Babbey wrote: I think if I can get an answer to a stupid question it may go along way to opening my eyes to Zope. I need to understand the use of ',",(),[]. I think when you use single quote ' - it means to take as literal - don't interpret. all of these come directly from the Python language. you should read the Python tutorial (find it on python.org) and you'll understand them all. in short: ' and " are equivalent () are for functions or methods [] are for arrays (aka list, aka tables) or dictionnaries (aka mappings) bye, Jerome Alet ___ 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] a product with external methods
Hi, 1st question: I'm currently creating a ZClass based product which includes some external methods. If I want to distribute this product, do I have to distribute my product AND my external methods for it to work correctly elsewhere, or just distributing the product is sufficient ? 2nd question about ZCatalog and Zope 2.1.6: When I instanciate a folderish ZClass of my own, I want to automatically create a ZCatalog instance, then I add the following line to MyZClass_add method: dtml-call "manage_addZCatalog('Catalog', 'My Catalog')" and when I create an instance of my class I've got the following NameError : !-- Traceback (innermost last): File /usr/local/zope/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/local/zope/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/local/zope/Zope-2.1.6/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/zope/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 165, in publish File /usr/local/zope/Zope-2.1.6/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: MyZClass_add) File /usr/local/zope/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: MyZClass_add) File /usr/local/zope/Zope-2.1.6/lib/python/OFS/DTMLMethod.py, line 150, in __call__ (Object: MyZClass_add) File ./DT_String.py, line 504, in __call__ (Object: MyZClass_add) File /usr/local/zope/Zope-2.1.6/lib/python/DocumentTemplate/DT_With.py, line 148, in render (Object: MyZClass.createInObjectManager(REQUEST['id'], REQUEST)) File /usr/local/zope/Zope-2.1.6/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval (Object: manage_addZCatalog('Catalog', 'My Catalog')) (Info: manage_addZCatalog) File string, line 0, in ? NameError: (see above) -- If I don't call manage_addZCAtalog in my add method but instead add the ZCatalog from Zope management interface it works fine. I think I've called this method correctly according to the ZQR, so I can't understand why it doesn't work. I've searched on this list archives on egroups about "adding ZCatalog" or "add ZCatalog" and I've not found anything useful. then I've searched for manage_addZCatalog and I've applied the patch sent by Dieter Maurer on May 28th to ZCatalog.py and restarted Zope but with no luck. please could someone help me ? thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] questions on creating a ZClass
I'm currently trying to create a ZClass (based on ObjectManager) from a Folder I've got. This folder contains a ZCatalog named Catalog. If I copy and paste all existing methods and objects into my ZClass, do what must be done (adapt the addForm and add method, define a propertysheet, set the Views, etc...), and create an instance of my new ZClass somewhere it works but I can't view my instance: if I choose View I've got an Unauthorized error about Catalog. If I create the same ZClass without including the Catalog, then instanciate the ZClass, then add the Catalog manually to the instance, then it works fine ! Please could someone explain me ? thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] problem with ZopeFind and objectValues
I can now answer in part: On Mon, 3 Jul 2000, Jerome Alet wrote: dtml-in "ZopeFind(this(), obj_metatypes=['Folder'])" dtml-var id - dtml-var title /dtml-in gives me the following error: """Unauthorized You are not authorized to access id.""" If I set a proxy role of manager to this dtml-method that doesn't change anything, it still doesn't work. In fact if I give this method a proxy role of Manager then it works fine if I access directly to this method from my browser. However if I call this method from inside another dtml method then it seems that the method loose its proxy role of manager. e.g.: say mymethod has a proxy role of manager and a method called anothermethod contains somewhere: dtml-var mymethod then if anothermethod has no proxy role at all: browsing: http://myserver/myfolder/mymethod works fine. browsing: http://myserver/myfolder/anothermethod doesn't work (Unauthorized). I have to give the proxy role of Manager to anothermethod too if I want both to work correctly. Is it a feature or a bug ? thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] Question from ZopeNewbies poster. . .
On Fri, Jun 30, 2000 at 10:13:37AM -0500, [EMAIL PROTECTED] wrote: problem is I can't insert the image at the insert form, and worse of all I don't know how to start. define your HTML form as: form action="your_dtml_method" method="POST" enctype="multipart/form-data" Filename: input type="file" name="myfile" /form then in your_dtml_method REQUEST['file'] should contain your file contents IIRC. good luck Jerome Alet ___ 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] Is there a bug in Zope ? (was Re: [Zope] problem testing permissions)
On Tue, 27 Jun 2000, Jerome Alet wrote: If I log in as a user I've created in one of the subfolders then my test seems to be wrong (see below). here's my code which should create an html link to the add form if the logged in user is a manager for the subfolder (e.g. jerome for Courses), or just display the day number if not ---CUT--- dtml-calendar !-- I begin to create a link to the add form if the user is -- !-- a manager for the subfolder -- dtml-with URL1 dtml-if AUTHENTICATED_USER.has_role('manager')" a href="manage_addProduct/GenericEvent/GenEvent_addForm?date=dtml-var date"dtml-var "date.dd()"/a dtml-else dtml-var "date.dd()" /dtml-if /dtml-with if I replace this with: ---CUT--- dtml-if "(('Manager' in AUTHENTICATED_USER.getRoles()) or ('manage' in AUTHENTICATED_USER.getRoles()))" a href="manage_addProduct/GenericEvent/GenEvent_addForm?date=dtml-var date"dtml-var "date.dd()"/a dtml-else a href="dtml-var "linkDate(date)""dtml-var "date.dd()"/a /dtml-if ---CUT--- then it works fine !!! If I display AUTHENTICATED_USER.getRoles() then when logged in as superuser it returns "('manage',)" and when logged in as jerome in a subfolder (see my previous message) then it returns "['Manager']" Please could someone explain me what's the problem ? I suppose I AM the problem ;-) PS: I run Zope 2.1.6 with patches. thanks in advance. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] Wrong mime type sent by Zope on every page
On Thu, 8 Jun 2000, Andrew Diller wrote: Server: Zope/Zope 2.1.6 (source release, python 1.5.2, linux2) ZServer/1.1b1 Why does Server: return linux2? This is an Compaq Alpha running Tru64!?! No. That's what you are told it is. In fact it's an i386 under GNU/Linux ;-)) bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] ZClass question
Hi, I'm currently trying to store all of the Medicine School (I work for) events in Zope, using the Calendar product to store them. I've created from my browser a Zclass which has a propertysheet and some properties in it, and some DTML methods. I've called this class GenericEvent. I want to create 4 or five other Zclasses which only differ from the first one by their meta type and the value (not the name) of one of their properties. For example I want to create ExamEvents, CoursesEvents, and so on... Then I want to give permissions to some people to add some type of events in the database. For example I want John to be able to add (and delete) both GenericEvents and ExamEvents, while I want Jane to only be allowed to add CoursesEvents, and not be allowed to delete CoursesEvents she hasn't created. I've created my GenericEvent ZClass and it works fine, thanks to Jason Spisak, but now when I try to create other ZClasses deriving from this ZClass I can't choose it as the base class for the new classes. Can I do that from my browser (How ?) or must I do it in python ? If it's not possible I plan to add the event type as a property of GenericEvent, but then how can I deal with the different permissions I need ? thanks in advance for any hint. Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ 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] a patch for the calendar tag 0.9.10
Hi there, here's a patch for the Calendar 0.9.10 product. This version allows people to define their own day or month names instead of the default english names. This is very useful if you want to setup a web calendar in another language than English. In French, some month names contain accented letters, represented in HTML by character entities like eacute; for example. The Calendar product doesn't cut the month names correctly in regard to these entities, especially in week mode when a week was between two months. Here's a patch to correct the problem. hope this helps. bye, Jerome Alet --- CalendarTag.py.orig Sun Jun 4 11:09:54 2000 +++ CalendarTag.py Sun Jun 4 11:08:43 2000 @@ -114,6 +114,22 @@ self.week_sday = int(weekdays[0]) self.week_ndays = int(weekdays[1]) +def __cutmonthname(self, name, length) : +"""Cuts the month name at length characters, counting +character entities for only one character""" +entityfound = 0 +for i in range(len(name)) : +if name[i] == '' : +entityfound = 1 +elif name[i] == ';' : +entityfound = 0 + +if not entityfound : +length = length - 1 +if not length : +break +return name[:i + 1] + def render(self, md): ##time_start = time() @@ -233,8 +249,8 @@ elif self.mode == 'week': sdow = date - date.dow() edow = sdow + 6 -smonthname = v['monthnames'][sdow.month() - 1][:3] -emonthname = v['monthnames'][edow.month() - 1][:3] +smonthname = self.__cutmonthname(v['monthnames'][sdow.month() - 1], 3) +emonthname = self.__cutmonthname(v['monthnames'][edow.month() - 1], 3) left = '%s %d' % (emonthname, edow.year()) if sdow.aMonth() != edow.aMonth():
Re: [Zope] a patch for the calendar tag 0.9.10
Sorry, I've created a new patch, because in my previous one I've forgotten to correct the day mode too. The problem happens in day mode as well as in week mode, even if the week wasn't between two months. Sorry for the incoveninence, you'll find the new patch attached to this message. bye, Jerome Alet On Sun, Jun 04, 2000 at 11:20:34AM +0200, Jerome ALET wrote: here's a patch for the Calendar 0.9.10 product. ... The Calendar product doesn't cut the month names correctly in regard to these entities, especially in week mode when a week was between two months. --- CalendarTag.py.orig Sun Jun 4 11:09:54 2000 +++ CalendarTag.py Sun Jun 4 13:18:40 2000 @@ -114,6 +114,22 @@ self.week_sday = int(weekdays[0]) self.week_ndays = int(weekdays[1]) +def __cutmonthname(self, name, length) : +"""Cuts the month name at length characters, counting +character entities for only one character""" +entityfound = 0 +for i in range(len(name)) : +if name[i] == '' : +entityfound = 1 +elif name[i] == ';' : +entityfound = 0 + +if not entityfound : +length = length - 1 +if not length : +break +return name[:i + 1] + def render(self, md): ##time_start = time() @@ -226,15 +242,15 @@ v['next_url_'] = self.linkDate_(d, mode) else: if self.mode == 'day': -monthname = v['monthnames'][date.month() - 1][:3] +monthname = self.__cutmonthname(v['monthnames'][date.month() - 1], 3) left = '%s %d, %d' % (monthname, date.day(), date.year()) v['day_img_'] = 'sday' v['daynames'] = None elif self.mode == 'week': sdow = date - date.dow() edow = sdow + 6 -smonthname = v['monthnames'][sdow.month() - 1][:3] -emonthname = v['monthnames'][edow.month() - 1][:3] +smonthname = self.__cutmonthname(v['monthnames'][sdow.month() - 1], 3) +emonthname = self.__cutmonthname(v['monthnames'][edow.month() - 1], 3) left = '%s %d' % (emonthname, edow.year()) if sdow.aMonth() != edow.aMonth():