[Twisted-Python] Subclassing static.File

Christopher Armstrong radix at twistedmatrix.com
Tue Aug 5 04:20:27 EDT 2003

On Mon, Aug 04, 2003 at 08:10:22PM -0400, Rick Morrison wrote:
> class FileLogger(static.File):
>     def __init__(self, path, defaultType="text/html", ignoredExts=(), registry=None, allowExt=0):
>         static.File(self, path, defaultType, ignoredExts, registry, allowExt)

^^^ This should be "static.File.__init__(..)", not "static.File(..)"

>     def render(self, request):
>         static.File.render(self, request)

You need a "return".

Why are you subclassing static.File? It's usually inappropriate.

 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/

More information about the Twisted-Python mailing list