diff options
author | 2010-07-15 21:37:27 +0300 | |
---|---|---|
committer | 2010-07-15 21:37:27 +0300 | |
commit | 2f2486ed4e037e7fd8fd32a53ef08e3463980f9b (patch) | |
tree | 7b62a5afc85da0198f0621dbdc3840e8abf34d5a /utils | |
parent | Added basic authentication support for tinderbox reports (diff) | |
download | gsoc2010-grumpy-2f2486ed4e037e7fd8fd32a53ef08e3463980f9b.tar.gz gsoc2010-grumpy-2f2486ed4e037e7fd8fd32a53ef08e3463980f9b.tar.bz2 gsoc2010-grumpy-2f2486ed4e037e7fd8fd32a53ef08e3463980f9b.zip |
Added db schema initialization script
Diffstat (limited to 'utils')
-rw-r--r-- | utils/grumpy_init_schema.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/grumpy_init_schema.py b/utils/grumpy_init_schema.py new file mode 100644 index 0000000..0bd96f6 --- /dev/null +++ b/utils/grumpy_init_schema.py @@ -0,0 +1,24 @@ +#! /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) +sys.path.insert(0, path) +del path + +from grumpy import app +from grumpy.models import db + +if __name__ == '__main__': + parser = OptionParser(usage="usage: %prog [options] CONFFILE") + (opts, args) = parser.parse_args() + 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() |