How to change view of all *.txt?
Hi, Is there a way to assign a handler to some objects based on type or name, similar to what Apache allows? For example, I want to have all *.txt files be processed by a certain external method. Is there any way to do this? Currently, I'm doing it by generating links to my .txt objects that are actually calls directly to my method with the object name as a paramter... It works, but it's a hack. Thanks, Robb
Robb, Can you give some more info? My first reaction is that it would make more sense to define new object types that hold the data (which hold their own methods to do stuff to the data). But maybe this isn't realistic... what are you actually trying to do? Robb Shecter wrote:
Hi,
Is there a way to assign a handler to some objects based on type or name, similar to what Apache allows? For example, I want to have all *.txt files be processed by a certain external method.
Is there any way to do this? Currently, I'm doing it by generating links to my .txt objects that are actually calls directly to my method with the object name as a paramter... It works, but it's a hack.
Thanks, Robb
_______________________________________________ Zope maillist - Zope@zope.org 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 )
-- Chris McDonough - Digital Creations, Inc. Publishers of Zope - http://www.zope.org
Chris McDonough wrote:
Robb,
Can you give some more info? My first reaction is that it would make more sense to define new object types that hold the data (which hold their own methods to do stuff to the data). But maybe this isn't realistic... what are you actually trying to do?
OK, concretely: I've got a bunch of plain text files with ".txt" extensions on the names in a folder. A lot of them have formatting, though, where the text runs off the side of the screen, because there's no line breaks in the paragraphs. What I want is to wrap long lines when a user views one of these files. What I've got so far is: * An external Python method that will reformat a text file to a particular line length So, I'm just wondering what the cleanest way to process these .txt files on the fly. Thanks, Robb
On Tue, 15 Feb 2000, Robb Shecter wrote:
* An external Python method that will reformat a text file to a particular line length
This one - its what I do. Useful for displaying text input in a textarea as preformatted amongst other things. I've attached one I use for posterity. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
participants (3)
-
Chris McDonough -
Robb Shecter -
Stuart 'Zen' Bishop