~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 21:30:53 UTC
  • Revision ID: git-v1:adec72eb3a3f154a85bce3e01e408b6e40b3d3da
Basic structure for database storage. Also added a start function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
information that has not been requested in a long time.
3
3
TODO: decide on how to store the data long term (persistent storage).
4
4
'''
 
5
import json
5
6
import hashlib
6
7
import libs.errors
7
8
import libs.events
35
36
        elif query.type == 'USK':
36
37
            if query.id in self.usks:
37
38
                return self.usks[query.id]
 
39
            
 
40
    def load(self, path):
 
41
        '''Load the database from a storage file.'''
 
42
        pass
 
43
        
 
44
    def save(self, path):
 
45
        '''Save the database to a storage file.'''
 
46
        pass
38
47
        
39
48
    # Event methods
40
49
    def got_message(self, data):
47
56
    def __init__(self, blocktype, id):
48
57
        self.type = blocktype
49
58
        self.id = id
50
 
        
 
 
b'\\ No newline at end of file'
 
59
        
 
60
 
 
61
def start():
 
62
    '''Create the storage database.'''
 
63
    database = StorageDB()
 
64
    libs.events.register_handler(database)