#!/usr/bin/env python

import sys

def usage():
    print 'Usage: %s <disk>' % sys.argv[0]
    print '\t<disk> = 0, 1, or 2'
    sys.exit(1)

try:
    disk=sys.argv[1]
except IndexError:
    usage()
if disk not in ['0', '1', '2']:
    usage()

letters = '0123456789abcdef'

template = ""
templateFile = open('sql/CreateTablesTemplate.sql')
for line in templateFile:
    template = "%s%s" % (template, line)
templateFile.close()

for letter1 in letters:
    for letter2 in letters:
        directory = '%s%s' % (letter1, letter2)
        print template.replace('@DIRECTORY@', 
                               directory).replace('@DISK@',
                                                  disk)
