diff options
Diffstat (limited to 'utils/grumpy_init_schema.py')
-rw-r--r-- | utils/grumpy_init_schema.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/utils/grumpy_init_schema.py b/utils/grumpy_init_schema.py index 0bd96f6..6720e68 100644 --- a/utils/grumpy_init_schema.py +++ b/utils/grumpy_init_schema.py @@ -1,9 +1,6 @@ #! /usr/bin/env python import os, sys -import urllib2 -from datetime import datetime -from lxml.html import fromstring from optparse import OptionParser path = os.path.join(os.path.dirname(__file__), os.path.pardir) @@ -19,6 +16,6 @@ if __name__ == '__main__': if len(args) != 1: parser.error("provide path to configuration file as first argument") sys.exit(1) - with app.test_request_context(): - app.config.from_pyfile(args[0]) - db.create_all() + app.test_request_context().push() + app.config.from_pyfile(args[0]) + db.create_all() |