8
if __name__ == "__main__":
10
print >> sys.stderr, "usage: %s filename ..." % sys.argv[0]
11
print >> sys.stderr, " insert the given filenames as exercises"
15
for fname in sys.argv[1:]:
16
if not os.access(fname, os.R_OK):
17
print >> sys.stderr, "No permission to read %s" % fname
19
spec = open(fname, "r").read()
21
fields = {'identifier':fname, 'spec':spec}
24
conn.insert(fields, 'problem', ['identifier', 'spec'])
26
print >> sys.stderr, "error inserting %s: %s" % (fname, repr(e))