comparison uploader/dispatcher.py @ 12:f60ad139acc1

better error message
author egj@socialplanning.org
date Tue, 02 Feb 2010 17:58:00 +0000
parents d2990750e5d6
children 657e8df14187
comparison
equal deleted inserted replaced
11:40b76777a880 12:f60ad139acc1
16 'app': None} 16 'app': None}
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), "The base directory %s does not exist; uploader needs it!" % self.directory
22 if self.app: 22 if self.app:
23 assert hasattr(self.app, '__call__') 23 assert hasattr(self.app, '__call__')
24 self.auth = self.auth.lower() == 'true' 24 self.auth = self.auth.lower() == 'true'
25 self.subpath = self.subpath.lower() == 'true' 25 self.subpath = self.subpath.lower() == 'true'
26 if self.subpath: 26 if self.subpath: