problems in a python script

pythonhda pythonhda at yahoo.com.replacepythonwithlinux
Tue Jul 29 09:41:39 EDT 2003


Whenever I get an syntax error after editing a file from someone else, it's usually because they used another indenting scheme than I do.

For example, I use spaces for indenting and some people use tabs. Check to see what indenting method they're using and make sure you use the same.

If you copied the code straight from the browser, make sure you don't have any extra spaces/tabs at the beginning of the line and make sure you use a good (programmer's) text editor to save your files.



On Tue, 29 Jul 2003 12:39:06 +0100
Mário Gamito <webmaster at dte.ua.pt> wrote:

> Hi,
> 
> I've downloaded the 30 days trial version of editize and followed the 
> instructions in http://plone.org/Members/tlynch/HowToIntegrateEditize
> to install it.
> 
> Everything runs smoothly  until the creation of munge.py as explained in 
> the above link. I get an error saying
> 
>   " Script line 4
>      inputvalue = inputvalue.replace("\r", "")
>      ^
> SyntaxError: invalid syntax"
> 
> A curious thing is that when i save it, not only i get the above error, 
> but also the lines begining with double cardinal (##) are gone!!!
> 
> Also the text refers to "Note: you might need to edit the line calling 
> munge in wysiwyg_support to reflect the name of your folder where all 
> the Editize stuff is stored."
> 
> Where is this is done ?
> 
> Thank you in advance for your time and patience.
> 
> Warm Regards,
> Mário Gamito
> 
> 
> 
> 
> munge.py
> -----------------------------------------------------
> ## Script (Python) "munge"
>     ##bind container=container
>     ##bind context=context
>     ##bind namespace=
>     ##bind script=script
>     ##bind subpath=traverse_subpath
>     ##parameters=inputvalue
>     ##title=
> 
>     # to guard against files that might contain only
>     # returns or linefeeds, we will delete each separately
>     # rather than trying: replace("\r\n", "")
>     inputvalue = inputvalue.replace("\r", "")
>     inputvalue = inputvalue.replace("\n", "")
>     inputvalue = inputvalue.replace("'", "'")
> 
>     return inputvalue
> ------------------------------------------------------------
> 
> 




More information about the Python-list mailing list