hgbook
annotate web/hgbook/load_elements.py @ 850:5bbebcdfb533
You wouldn't believe me if I told you.
author | gpiancastelli |
---|---|
date | Sat Aug 22 18:49:12 2009 +0200 (2009-08-22) |
parents | ad304b606163 |
children |
rev | line source |
---|---|
bos@574 | 1 #!/usr/bin/env python |
bos@574 | 2 # |
bos@574 | 3 # This script updates the contents of the comments_element table. |
bos@574 | 4 # It's fugly, but a lot less painful than trying to use Django's |
bos@574 | 5 # fixtures system. |
bos@574 | 6 |
bos@574 | 7 import os, sys |
bos@574 | 8 sys.path.append(os.path.dirname(__file__)) |
bos@574 | 9 import dbutil |
bos@574 | 10 |
bos@588 | 11 os.system('make -C ../../en all-ids.dat') |
bos@574 | 12 |
bos@574 | 13 conn = dbutil.connect() |
bos@574 | 14 c = conn.cursor() |
bos@574 | 15 c.execute('''load data local infile "../../en/all-ids.dat" replace |
bos@574 | 16 into table comments_element |
bos@574 | 17 fields terminated by "|"''') |
bos@574 | 18 print 'Database updated' |