Mercurial > hgbook
comparison web/hgbook/load_elements.py @ 673:ad304b606163
Initial cut at web comment system import
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 10 Mar 2009 21:42:19 -0700 |
parents | |
children | 188efaefe001 |
comparison
equal
deleted
inserted
replaced
672:40025381bded | 673:ad304b606163 |
---|---|
1 #!/usr/bin/env python | |
2 # | |
3 # This script updates the contents of the comments_element table. | |
4 # It's fugly, but a lot less painful than trying to use Django's | |
5 # fixtures system. | |
6 | |
7 import os, sys | |
8 sys.path.append(os.path.dirname(__file__)) | |
9 import dbutil | |
10 | |
11 os.system('make -C ../../en ids') | |
12 | |
13 conn = dbutil.connect() | |
14 c = conn.cursor() | |
15 c.execute('''load data local infile "../../en/all-ids.dat" replace | |
16 into table comments_element | |
17 fields terminated by "|"''') | |
18 print 'Database updated' |