1
2 """Generates the khipu-numbers.txt/yaml files, which list the numbers
3 (possibly) encoded in each khipu in the database."""
4
5 from __future__ import division, with_statement
6 import os, StringIO, traceback, warnings, re
7 import json, sys
8
9
10 sys.path.append('..')
11 import KhipuDB
12
13 sortedSet = False
14 results = {}
15
24
26 import sys
27 db = KhipuDB.KhipuDB ()
28 if sys.argv[1] == 'all':
29 for khipu in db:
30 try:
31 doone(khipu)
32 except KhipuDB.MissingPrimaryCord:
33
34 print '*** PROBLEM WITH ' + khipu.investigator_num + ' ***'
35 with open('khipu-numbers.yaml','w') as f:
36 f.write(json.write(results))
37 else:
38 doone(db.khipu_with_investigator_num (sys.argv[1]))
39 db.save_cache()
40
41 if __name__ == '__main__': main ()
42