[Zope] ZCTextIndex and word position

2006-08-11 Thread Eric Fernandez
Hi, I am using a ZCTextIndex to index and search text files. I use a search form to retrieve the objects that match a search. I would like to know if it is possible to retrieve more details about the search, in particular the line numbers (or the word position in the file) where a match has

[Zope] PUT_factory and File object?

2006-08-10 Thread Eric Fernandez
Hi, I am trying to upload text files as File objects instead of DTML documents to avoid HTML escaping. What is the type of the File object in Zope ? The example in the Zope book are ZopePageTemplate and PythonScript objects,, but I just want a File object. This does not work: def

Re: [Zope] PUT_factory and File object?

2006-08-10 Thread Eric Fernandez
Eric Fernandez wrote: Hi, I am trying to upload text files as File objects instead of DTML documents to avoid HTML escaping. What is the type of the File object in Zope ? The example in the Zope book are ZopePageTemplate and PythonScript objects,, but I just want a File object. This does

Re: [Zope] PUT_factory and File object?

2006-08-10 Thread Eric Fernandez
Stefan H. Holek wrote: On 10. Aug 2006, at 13:52, Eric Fernandez wrote: def PUT_factory( self, name, typ, body ): ob = None if typ.startswith('text'): ob = File(name, '', body, content_type=typ) return ob However, I cannot upload jpg files anymore... What am I doing

[Zope] uploading text file by FTP: encoding problem?

2006-08-09 Thread Eric Fernandez
Hi, I have a problem when I upload an ASCII text file into a zope2 folder. I have a plain-text file with double quotes and line breaks. However, once uploaded, double quotes become quot and line breaks become \n. Even if I change the property into text/plain or text/xml, I get the same

Re: [Zope] Reading and parsing a text file object

2006-07-20 Thread Eric Fernandez
Roberto Benitez wrote: The following worked for me: with a file object containing the following text: line one of test file line two of test file line three of test file I was table to parse lines w/ following code: file=%s % context.textfile num=1 for line in file.split(\n): print

Re: [Zope] Reading and parsing a text file object

2006-07-20 Thread Eric Fernandez
[EMAIL PROTECTED] wrote: Roberto Benitez wrote: file=%s % context.textfile Huh? Isn't that just a weird and probably inefficient way of writing file=str(context.textfile)? Sso I was mistaken when I said \n were removed... I can indeed split by '\n' the result of