Added init_app

This commit is contained in:
Paul Cunningham
2015-06-09 13:45:27 +01:00
parent 2308624c12
commit bac14c4403
+7 -1
View File
@@ -131,7 +131,13 @@ class Whooshee(object):
_underscore_re2 = re.compile('([a-z0-9])([A-Z])')
whoosheers = []
def __init__(self, app):
def __init__(self, app=None):
if app:
self.init_app(app)
def init_app(self, app):
self.index_path_root = app.config.get('WHOOSHEE_DIR', '') or 'whooshee'
self.search_string_min_len = app.config.get('WHOSHEE_MIN_STRING_LEN', 3)
self.writer_timeout = app.config.get('WHOOSHEE_WRITER_TIMEOUT', 2)