hgbook

view 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
line source
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.
7 import os, sys
8 sys.path.append(os.path.dirname(__file__))
9 import dbutil
11 os.system('make -C ../../en all-ids.dat')
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'