~lifeless/meliae/db

« back to all changes in this revision

Viewing changes to json2sqlite.py

  • Committer: Robert Collins
  • Date: 2009-09-15 04:29:26 UTC
  • Revision ID: robertc@robertcollins.net-20090915042926-tet9vt8j3op6l056
bugfix iter_objs with no objs dict, flush new objects when there are many node references.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    def commit():
47
47
        sys.stderr.write('committing %8d                         \r' % pos)
48
48
        store.commit()
 
49
        sys.stderr.write('committed %8d                         \r' % pos)
49
50
    for pos, obj in enumerate(loader.iter_objs(source, show_prog=True)):
50
51
        store.import_obj(obj)
 
52
        # sys.stderr.write('dirty: %d alive: %d order: %d  ref_len %d seq: %d        \r' % (len(store._dirty), len(store._alive), len(store._order), len(obj.ref_list), store._sequence))
 
53
    
 
54
        #store.flush()
 
55
        # store.invalidate()
51
56
        if not pos & 0x1ff:
52
57
            # commit every 512 objects
53
58
            commit()