~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/libs/storage/manager.py

  • Committer: AJ00200
  • Date: 2011-11-25 22:33:16 UTC
  • Revision ID: git-v1:72df4f3fdd1f779adf7358468417dbcd7f9f59db
Every block we get is now stored.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
            self.uuks[block] = db_json[block]
58
58
        
59
59
    # Event methods
60
 
    def got_message(self, data):
61
 
        self.add_uuk(Block(data))
62
 
        
 
60
    def got_message(self, packet):
 
61
        message = packet.message
 
62
        self.add_uuk(Block(message))
 
63
        out_json = {}
 
64
        for block in self.uuks.values():
 
65
            out_json[block.hash] = block.data
 
66
        print(json.dumps(out_json, indent = 2))        
63
67
    def got_request(self, query):
64
68
        self.search(query)
65
69