#!/usr/bin/env python

import os
import sqlite3

print 'Creating directories ...',

path = os.path.join('data')
try:
	os.stat(path)
except OSError:
	os.makedirs(path)
	print 'done'
else:
	print 'already done'

print 'Initialising database ...',

path = os.path.join('data', 'db.sqlite')
try:
	os.stat(path)
except OSError:
	c = sqlite3.connect(path)
	c.executescript(open('schema.sql').read())
	c.commit()
	c.close()
	print 'done'
else:
	print 'already done'

#!/usr/bin/env python

import os
import sqlite3

print 'Creating directories ...',

path = os.path.join('data')
try:
	os.stat(path)
except OSError:
	os.makedirs(path)
	print 'done'
else:
	print 'already done'

print 'Initialising database ...',

path = os.path.join('data', 'db.sqlite')
try:
	os.stat(path)
except OSError:
	c = sqlite3.connect(path)
	c.executescript(open('schema.sql').read())
	c.commit()
	c.close()
	print 'done'
else:
	print 'already done'

#!/usr/bin/env python