blob: 0bd96f6935ccae2269cd921e896c892ede66e5d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()
|