[Zope] Adding an external method

Thomas B. Passin tpassin@mitretek.org
Fri, 6 Jul 2001 10:48:02 -0400


You should always test an external method to make sure it works before
trying to use it in Zope.  One easy way is to make the file self-testing:

if __name__=='__main__':
    #place test code here
    # Run this file from the command line to perform the test.

If you don't do this, you can't tell if you have a Zope problem or a Python
problem.

Cheers,

Tom P

[Gitte Wange]

On Friday 06 July 2001 15:19, Oleg Broytmann wrote:
> On Fri, 6 Jul 2001, Gitte Wange wrote:
> >   File "monthRange.py", line 3
> >     def monthRange(self,dt):
> >     ^
> > SyntaxError: invalid syntax
>
>    Something wrong before the "def". For example, CRLF line endings on
> UNIX.
>
> Oleg.
> ----
>      Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
>            Programmers don't die, they just GOSUB without RETURN.

You were right ... I typed in the few lines of code again (instead of
copy/paste) and it added the external method without errors.

Thinking of it I should have thought of that - copy/paste from browsers
always fails for me :-)