comparison uploader/dispatcher.py @ 4:e5efa999911a

make sure self.app is actually callable
author k0s <k0scist@gmail.com>
date Sun, 27 Dec 2009 16:30:29 -0500
parents bb2d34fb5de4
children d2990750e5d6
comparison
equal deleted inserted replaced
3:bb2d34fb5de4 4:e5efa999911a
17 17
18 def __init__(self, **kw): 18 def __init__(self, **kw):
19 for key in self.defaults: 19 for key in self.defaults:
20 setattr(self, key, kw.get(key, self.defaults[key])) 20 setattr(self, key, kw.get(key, self.defaults[key]))
21 assert os.path.exists(self.directory) 21 assert os.path.exists(self.directory)
22 if self.app:
23 assert hasattr(self.app, '__call__')
22 self.auth = self.auth.lower() == 'true' 24 self.auth = self.auth.lower() == 'true'
23 self.subpath = self.subpath.lower() == 'true' 25 self.subpath = self.subpath.lower() == 'true'
24 if self.subpath: 26 if self.subpath:
25 if self.query_string: 27 if self.query_string:
26 self.handlers = [ SubpathGet, SubpathPost ] 28 self.handlers = [ SubpathGet, SubpathPost ]