From the Control Panel:
Zope version: Zope 2.0.0 (binary release, python 1.5.2, win32-x86) Python version: 1.5.2 (#0, Jul 30 1999, 09:52:18) [MSC 32 bit (Intel)] System Platform: win32 Process ID: (removed) Running for: 1 hour 31 min 54 sec First of all, I am using the "How-To:Using External Methods" How-to Created by Brian (thanks Brian). Second, Am I using the right zope feature to do what I want or should I choose another route? I am trying to change all " to "" so that MySQL will not truncate text coming from a form to be stored in a text field that has a quote in the text which it now truncates. I am trying to use a python External method. MySQL will accept "" or \" (maybe /"). I have written a python file that works as written ( at least on my pc) to change " to "". This is my directory structure: ZopeSite - bin - doc - Extensions - quote2dblquote.py - Graphics - inst - lib - MidiFiles - pcgi - utilities - var - Zserver I created the Extensions directory because there was none and restarted the server, even tried putting an Extensions directory under Zserver and restart it (got same error). Here's the sequence i go through: -------- from Add External Method ------------- Id: q2dq Title: set one double quote to two double quotes for MySQL Function name: quote2dblquote Python module file:quote2dblquote -------- end add method -------------------- ----------- Zope error ----------------------- Zope Error Zope has encountered an error while publishing this resource. Error Type: IOError Error Value: [Errno 2] No such file or directory: '-S' Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you ---------- end zope error msg ------------------ ----- html source from error page -------------- <TITLE>Missing Post reply data</TITLE> <H1>Data Missing</H1> This document resulted from a POST operation and has expired from the cache. If you wish you can repost the form data to recreate the document by pressing the <b>reload</b> button. ------- end html source ------------------------- ---------- python script----------- import fileinput import string def quote2dblquote(): text="" for line in fileinput.input(): line = string.replace(line,"\"","\"\"") text = text + string.join(line,"") print text # for testing # return (text) # do I need this quote2dblquote() ------- end python script ---------- Okay, here goes, I'm sending this, Thomas ps - once I can use the object q2dq how do I tell it the argument, like this? <dtml-var q2dq(<dtml-var question>)> where question is the parameter coming from the form. -------------------------------------------------------------------- Rock and Rule Zope Rocks -- http://www.zope.org Python Rules -- http://www.python.org -------------------------------------------------------------------- Thomas McMillan Grant Bennett Appalachian State University Computer Consultant II University Library bennettt@am.appstate.edu http://www.library.appstate.edu/webmaster/ Voice: 828 262 6587 FAX: 828 262 3001 Windows 95 is a 32-bit extension to a 16-bit patch for an 8-bit operating system that was originally coded for a 4-bit microprocessor. - Chris Dunphy Boot Magazine
participants (1)
-
TMGB