SEESenv/web/hgbook/load_elements.py
author amit@thunder
Wed, 10 Mar 2010 17:39:26 +0530
changeset 45 b5bff924ef69
parent 2 52d12eb31c30
permissions -rwxr-xr-x
Some more changes to soup is made in final html also comment.html has been changed so the links don't appear

#!/usr/bin/env python
#
# This script updates the contents of the comments_element table.
# It's fugly, but a lot less painful than trying to use Django's
# fixtures system.

import os, sys
sys.path.append(os.path.dirname(__file__))
import dbutil

os.system('make -C ../../en all-ids.dat')

conn = dbutil.connect()
c = conn.cursor()
c.execute('''load data local infile "../../en/all-ids.dat" replace
             into table comments_element
             fields terminated by "|"''')
print 'Database updated'