Re: [Zope] Using Chinese Characters
At 2000-09-07 21:18 +0200, Tino Wildenhain [EMAIL PROTECTED] wrote: Hi Kelvin, Kelvin Cheong wrote: i was wondering how i can use chinese characters with Zpe on Linux. does anyone know how? According to my "mild" research so far, i found out that Big5is a 2-byte code and is a part of ISO-10646/Unicode. It also seems to be the de-facto for traditional chinese characters. There're also Unicode CJK and GB. But GB is for China, which uses simplified chinese characters. And CJK includes both Big5 and GB. classic zope is built on python 1.52 and does not naturally support unicode. But there is a light on the horizont: http://www.zope.org/Members/htrd/wstring I have a vision of everything working together for localizing and internationalisation ;-) It's good to finally see some Unicode support coming through. I'm a bit surprised that Guido didn't mandate Unicode support from the beginning, given that Python is a relative newcomer to the programming scene. I imagine Python 2 will have full Unicode support, right? Or is it already in Python 1.6? Bad news is that Unicode is not good enough. It allows for about 64k characters, yet Chinese alone (Han ideographs) has over 75,000 (maybe a lot more, but that includes old, rare and uncommon characters). When will we see support for UCS (Universal Character System, ISO 10646) which uses (up to) 32 bit (31 bit?) characters. As far as I know, at present the only UCS characters currently defined are those defined by Unicode (about 40,000 of them), but we should be supporting it now in readiness for the future. Food for thought. Zai jian! (Too bad email is plain ASCII or I could use the proper characters!) David Trudgett ___ 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] Localtime logging
Does anyone happen to know if Zope can be made to log in local time instead of UTC? David Trudgett ___ 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-dev] Looping through a folder's contents...
At 2000-08-20 23:06 -0700, [EMAIL PROTECTED] wrote: I would like to loop through the contents of a folder, and the contents of the subfolders of that folder. I know I can do this to a singular level by doing something like: dtml-in "subfolder.objectValues('Folder')" dtml-var title /dtml-in Should give me a list of the titles of all the subfolders of the folder called "subfolder". So, once I get there, how do I loop through the subobjects of each of those folders? In other words, I have a subfolder inside of the folder called "subfolder" and I want to see the contents of that folder. How do I do it? -- I've used code similar to the following in an external method before: thisitem = self.getFirstChild() while thisitem is not None: if thisitem.meta_type == 'DTML Document': ... thisitem = thisitem.getNextSibling() I haven't tried to do it in DTML. David Trudgett ___ 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] Hotfixes: serious suggestion
At 2000-08-15 10:18 +0200, "Frank Tegtmeyer" [EMAIL PROTECTED] wrote: The current format is Hotfix_08_09_2000, my proposed format is Hotfix_2000-08-09. This is the ISO 8601 format (abbreviated form). Reasoning: First of all Zope is a product of a north american company but is used worldwide. Not all countries use the american form of dates, so it would be nice to have a standardized one (in my opinion this applies also to the standard date functions in Zope). The reasons for establishing ISO 8601 apply here as well: - ordering of month and day are different in Europe and America, this leads to difficulties interpreting date values - ISO dates are sortable by string functions - ISO dates are easy to parse by humans AND programs Opinions? I agree. If everyone standardised on ISO 8601 in written date and time formats, the world would be a saner place. Writing MM-DD-YY(YY) is just silly in my opinion, no matter how you like to say it out loud. It may have been acceptable in times past (like when the Internet was not nearly globally ubiquitous), but these days it's just an anachronism (as is DD-MM-YY, because it is easily mistaken for MM-DD-YY). Likewise for 12 hour time. There's only one 14:00 in the day, and that's the way I like it! ;-) David Trudgett ___ 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] OT: UTC
At 2000-08-16 01:54 +, Curtis Maloney [EMAIL PROTECTED] wrote: So, when are you joining me in working in UTC? I mean, really. We deal with people globally on a daily basis. Why bother with all this timezone nonsens? So I get up and out of bed at 2100, get to work at a fresh and early 2300, You get up late! Myself, I'm up and at 'em at a brisk 2000 (in theory). :-) Cheers. David Trudgett ___ 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] Removing tracebacks from error message
At 2000-08-14 13:33 +0100, Chris Withers [EMAIL PROTECTED] wrote: Martijn Pieters wrote: On Thu, Aug 10, 2000 at 03:30:00PM -1000, David Trudgett wrote: I thought I solved this problem a while ago, but if so I can't remember how. I have a custom error page in Zope (2.1.6), but Zope wants to put the traceback information into an HTML comment at the foot of the page (which I don't want to have there). I set BOBO_DEBUG_MODE=0 and exported it in the "start" script, and also removed the "-D" from the command line that launches Z2.py. I thought that was all there was to it, but there must be something else that I've forgotten. Just removing the -D flag should do it. It may be that just having 'BOBO_DEBUG_MODE' defined (whatever the value you set it to) triggers debug mode, so defining 'BOBO_DEBUG_MODE=0' may well set Debug Mode on :) I think what David means is that, when not in debug mode, Zope appends the error in HTML comments to the end of the HTML stream. There was a thread on this not long ago and, IIRC, this was found to be hard coded into Zope. OK, looks like some Zope hacking to do... :-( My own view is that Zope shouldn't stick any error messages into or on the end of error reports. At best, it's bad HTML, at worst it's a security risk (the python traceback includes the full paths of the files on the machine...) If you want an error report/traceback, you should specifically include it in standard_error_message. Agreed. It's just plain dumb (not to mention embarrassingly unprofessional) to put content after the /html tag. My main concern, though, is the security aspect. The less potential crackers know, the better. At the very least, a traceback like that says: "Hey, this is a Zope site." To which the wiley cracker replies, "Great. Now lets try all the known Zope vulnerabilities." Obviously, security by obscurity is not a good idea, but obscurity is not a bad idea, either :-) Apart from all of that, there is the issue of content being added that wasn't requested. That's a bit impolite, I think. Has anyone put this in the collector, or is it more suited to dev.zope.org? I'd classify it as a bug for the collector, myself... I think there's also a related issue of a hard-coded error message page in the guts of Zope somewhere, because the user-defined error page is not used in every case... cheers, Chris Sorry for the whinge, guys and gals! Zope is still great! Bye for now. David Trudgett ___ 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] Speeding up Zope by disabling logging of hits
I'm using zope behind a front-end server and don't require any logging of hits. Is there a way to disable Zserver hit logging to increase speed and decrease disk utilisation? (I suppose I can send output to /dev/null, but that doesn't stop the logging code from being executed, and I would also lose error logging.) Even better would be the ability to disable logging based on IP address of the requester. Thanks. David Trudgett ___ 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] gvib InterBase DA, undefined symbol crypt
At 2000-07-21 00:40 -0400, Jeff Hoffman [EMAIL PROTECTED] wrote: On Thu, 20 Jul 2000, David Trudgett wrote: Hi all, After having successfully installed the gvib InterBase DA on a test machine running Red Hat Linux 6.1, I'm not having the same luck on the production box running RH 6.0. Here's what happens: $ python import gvib Traceback (innermost last): File "stdin", line 1, in ? File "/usr/local/Zope-2.1.6/lib/python/Products/gvibDA/gvib/gvib.py", line 46, in ? import gvibBase ImportError: /usr/lib/libgds.so: undefined symbol: crypt I'm perplexed. The only time I've run into this problem was when I forgot to link with libcrypt. Deja didn't turn up anything useful, either. I hate to point out the obvious, but, by default the Linux section in Setup.in reads: # # Use this on Linux. # #gvibBase gvibBase.c -D$(GVDEF) -I$(PYDIR) -L$(IBLIB) -lgds -lcrypt Note the comment. You need to comment the Solaris line, and uncomment the Linux line. In reality, the link with libcrypt is the only thing differentiating the two. Unfortunately, the compile will still succeed without -lcrypt being specified. You won't see the problem until you try to import the module, as seen above. so is there anyone here who can suggest how I might fix this? (By the way, the compile went through without a problem, and there was a -lcrypt on the appropriate Setup.in line). One other thought. The first time you run: make -f Makefile.pre.in boot a Setup file is created. If you then change Setup.in, you need to delete Setup and re-execute the above line. Otherwise, the changes won't be reflected. Jeff hit the nail on the head with that one. I've replied to him personally and thanked him. What I had done was inadvertently run the make -f before I had edited the Setup.in file. I then edited the file as I should have and re-ran make -f without realising I had to delete the file called "Setup". Ignorance is a curse. Anyway, this little tip will no doubt help someone else in the future. David Trudgett ___ 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] gvib InterBase DA, undefined symbol crypt
Hi all, After having successfully installed the gvib InterBase DA on a test machine running Red Hat Linux 6.1, I'm not having the same luck on the production box running RH 6.0. Here's what happens: $ python import gvib Traceback (innermost last): File "stdin", line 1, in ? File "/usr/local/Zope-2.1.6/lib/python/Products/gvibDA/gvib/gvib.py", line 46, in ? import gvibBase ImportError: /usr/lib/libgds.so: undefined symbol: crypt I've tried mucking around with updating libraries and so on, but so far without success. No doubt this problem has happened to someone else before, so is there anyone here who can suggest how I might fix this? (By the way, the compile went through without a problem, and there was a -lcrypt on the appropriate Setup.in line). I've also emailed the author of the package, but I thought it's probably more likely a generic setup problem, rather than anything to do with the product itself. Thanks. David Trudgett ___ 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] newbie questions
At 2000-07-06 22:23 -0400, Chris McDonough [EMAIL PROTECTED] wrote: To back up the ZODB, just copy the Data.fs file in the var directory. You may safely do this while Zope is running. To restore, reinstall Zope and all the products you're using and copy the Data.fs into the var directory. I don't understand this advice. Couldn't the file change while being read? Wouldn't a better way be to pack the database and use the Data.fs.old file as the backup? David Trudgett ___ 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] Stability - can you give us some advice?
At 2000-07-07 01:50 -0300, [EMAIL PROTECTED] wrote: Hi, I'm new to this list (to Zope too!)and I'm really impressed with its traffic. This show us that this project is in active development. In our company we are currently working to create a Web site with lots of dynamic content, database access, webmail, etc.. so we decided to try Zope. Although it's lack of documentation ( this would not be fair, with a search engine we can dig out lots of useful info from the web) we experienced a very fast development cycle. Now we're concerned about its stability. We are almost finishing the first stage of project and some times Zope hangs. It was working ok, and then, all of a sudden, it just stops answers requests. Last time it happend we changed a DTML Method to a DTML Document and it worked again (if you like i'll try to tell you exactly what was happenning). So, I'd like some advice to make it more stable. ( or tell me what i might be doing wrong) Funny you should mention that. We just had a similar thing happen to us this morning. We have an installation of Zope 2.1.6 running on Red Hat Linux 6.0 on an old 486/66 machine (a prototype serving some intranet content). We aren't doing any database connections on it (through Zope, that is), but we are running Squishdot (which is the main application in terms of usage on this particular machine). Zope is running behind Apache 1.3.9, and I noticed that multiple instances of Zope.cgi started up to service incoming requests, but apparently Zope wasn't responding. I just restarted Apache and everything was fine again. Is this a known problem with Zope that has been addressed in 2.2? Thanks. David Trudgett ___ 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: Traversal of ZODB
At 2000-07-04 20:32 +0100, Steve Alexander [EMAIL PROTECTED] wrote: On Fri, 30 Jun 2000, David Trudgett wrote: I wonder if anyone has a sample Python script that traverses the ZODB to query or perform arbitrary operations on the objects found in it? My present requirement is to write a script that goes through and does some automated updating of several dozen DTML documents. Hi David, I just posted something similar to Zope-Dev: http://lists.zope.org/pipermail/zope-dev/2000-July/005744.html Thanks for that. I actually worked out a fairly similar hack myself, which only did one folder (which was OK for the particular task that I wanted it to do). Your recursive method has no doubt saved me quite a bit of time in generalising it. There are still a couple of little question marks in my mind, though. But before I get to them, I'll just post a sample of what I came up with (minus most of the gory details of the actual processing I wanted to do: def processDTML(self): """Process DTML documents within a folder.""" import re myregex = re.compile(r"(H1.*?/H1)") thisdoc = self.getFirstChild() while thisdoc is not None: if hasattr(thisdoc, 'meta_type'): if thisdoc.meta_type == 'DTML Document': # Do processing stuff here doctext = thisdoc.raw doctext = myregex.sub(r"\1\n\nH2Profile/H2\n", doctext) thisdoc.raw = doctext thisdoc = thisdoc.getNextSibling() return 'Complete!' Just for easy reference, this was what you came up with: import re def convert_dtml(self): """Convert DTML Methods and DTML Documents from old syntax to new syntax. Warning: recursive! This assumes that DTML Method and DTML Document haven't been subclassed. """ print 'convert_dtml: id=%s' % self.title_and_id() if hasattr(self, 'meta_type') and \ (self.meta_type == 'DTML Method' or \ self.meta_type == 'DTML Document'): convert(self) # should this be "isPrincipiaFolderish"? if hasattr(self, 'isAnObjectManager') and self.isAnObjectManager: for v in self.objectValues(): v.convert_dtml() _convert_regex = re.compile('''!--#(/?)(([^"-]+?|"[^"]*?"|'[^']*?'|-[^-])+?)--''') def convert(dtml_item): print 'converting...' title = dtml_item.title # like document_src, but doesn't require RESPONSE data = dtml_item.PrincipiaSearchSource() print 'data' print data newdata = _convert_regex.sub('\g1dtml-\g2', data) print 'newdata' print newdata print 'end' dtml_item.manage_edit(newdata, title) Some questions I have in my mind: 1. I used "raw" and you used "PrincipiaSearchSource()" . The reason I used raw was because I wanted to be sure that what I got wasn't munged in any way, and that what I put back reflects what was actually there before. 2. You used the "manage_edit()" method, whereas I just assigned to the "raw" property. My way seems to work OK, but I'm not sure how yours works: I assume it brings up an edit page in the browser for each document? 3. I don't like resorting to testing the "meta_type" for a particular string value. As you noted in your code, it doesn't allow for subclassing, so it's not fully general. 4. I was surprised that the import statement (not to mention "re.compile()") could be put outside of the method definition, considering that Zope's external methods grab on to individual methods within a Python module. David Trudgett ___ 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] Traversal of ZODB
I wonder if anyone has a sample Python script that traverses the ZODB to query or perform arbitrary operations on the objects found in it? My present requirement is to write a script that goes through and does some automated updating of several dozen DTML documents. Thanks. David Trudgett ___ 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] Search Interface
I'm having some trouble setting up a search interface into a ZCatalog. I want to create a text index on the contents of my DTML documents, but I can't seem to get it to work. It search on title just fine. I think my problem is that I don't know how to create the right index, and what to call it (how the body or text of a DTML document is referenced). Can anyone enlighten me about this? I might be going blind, but I haven't come across anything in the documentation so far that answers my question. I'm about to resort to reading the Zope source! (which I think I will need to do sooner or later anyway, to get a better understanding of how it all works). Thanks for any assistance. David Trudgett ___ 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] (no subject)
At 2000-06-06 09:44 -0300, you wrote: You both had the same problem I have now: make Oracle 8i (in my case, Oracle 8.1.6) work with Zope. DCOracle is working well (Makefile attached to this message) but ZOracle isn't running yet. We are posting e-mails about it on the list for a while and nobody answered, so I must think that nobody on Zope universe is using Oracle 8i (neither NT nor Linux Oracle 8i client). There isn't any detailed documentation about it. The ZOracle installation instructions are simple but, in my opinion, incomplete. To solve this situation, I'm making a call to everybody that uses or wants to use Zope with Oracle 8i. My goal is finally document the installation process and make it work properly. Please contact me ASAP. Hello Alexandre. We intend to use Oracle 8i (8.1.5) with Zope (on another machine). We haven't done anything about it yet, though. That will hopefully change in the near future. I'd be interested to know what problems you had... David Trudgett ___ 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] Using FTP to connect to Zope server from (g)VIM
At 2000-06-02 15:51 +0100, Phil Harris wrote: Hi all, My intellect was piqued recently by a discussion on the list about editors for Zope etc. I remember some people saynig that VIM was good, to which my response was, 'Yeah but there's no FTP built in'. Someone then responded with a few scripts to do it. Well I thought they were a bit cumbersome, so I wrote my own. That's great, Phil! I think I'll find those scripts very handy. Thanks. David Trudgett ___ 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] KeyError since installing Squishdot 0.4.0
Since I installed Squishdot 0.4.0 (yesterday) on Zope 2.1.6 (under Red Hat Linux) I've been getting KeyErrors when clicking on an article's topic image, which uses an URL like this: http://myserver/Zope/testsquish/search?subject=Squishdotop=articles In Squishdot 0.3.2, the errors didn't occur. I applied the fixes mentioned by Michel Pelletier in his (Zope-dev] message ("The Mysterious Key Error and Unrelated Searc Result Bug"), and updated the ZCatalog. This didn't fix the problem. Here is the stack trace: Traceback (innermost last): File /data/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /data/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 179, in publish File /data/Zope-2.1.6/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ElementWithAttributes) File /data/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 165, in publish File /data/Zope-2.1.6/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: search) File /data/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: search) File /data/Zope-2.1.6/lib/python/Products/Squishdot/Squishdot.py, line 954, in search (Object: ElementWithAttributes) File /data/Zope-2.1.6/lib/python/ZPublisher/HTTPRequest.py, line 760, in __getitem__ KeyError: (see above) Does anyone have any ideas on how to fix this? Thanks. David Trudgett ___ 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 Chat
At 03:40 2000-05-30 -0600, ethan mindlace fremen wrote: Jim and Paul are going to be availiable for a chat about Zope, Perl Methods, and more. Please join us Wednesday, May 31, 1:00PM EST on irc.openprojects.net , on the #zope channel. Sorry for my ignorance, but what's that in UTC? Thanks. David Trudgett ___ 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 )