[Twisted-Python] PicturePile

Jp Calderone exarkun at twistedmatrix.com
Sun Jul 13 13:28:07 MDT 2003


On Sun, Jul 13, 2003 at 11:23:43AM +0200, Philippe Lafoucri?re wrote:
> Hi
> 
> I'm trying to test to PicturePile files (from woven tutorial).
> I have always the same error :
> 
> 
> $ python picturepile.py /home/gravis/Images/
> Traceback (most recent call last):
>   File "picturepile.py", line 10, in ?
>     class DirectoryListing(page.Page):
>   File "picturepile.py", line 13, in DirectoryListing
>     templateDirectory = os.path.split(os.path.abspath(__file__))[0]
> NameError: name '__file__' is not defined
> 

  Run them with "twistd -y" instead of "python".

  I think the "if __name__ == '__main__':" checks should all be removed,
since clearly they won't work (file is never defined when that test is true).

  Jp

-- 
http://catandgirl.com/view.cgi?44
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20030713/1c7c71c2/attachment.sig>


More information about the Twisted-Python mailing list