]> git.phdru.name Git - bookmarks_db.git/blob - Storage/bkmk_stpickle.py
Implemented keywords in Mozilla bookmarks.
[bookmarks_db.git] / Storage / bkmk_stpickle.py
1 """
2    Bookmarks storage manager - pickle; certainly the most simple and elegant :)
3
4    Written by BroytMann, Feb 2000 - Mar 2000. Copyright (C) 2000 PhiloSoft Design
5 """
6
7
8 try:
9    import cPickle
10    pickle = cPickle
11
12 except ImportError:
13    import pickle
14
15
16 class storage_pickle:
17    filename = "bookmarks_db.pickle"
18
19
20    def store(self, root_folder):
21       outfile = open(self.filename, 'wb')
22       pickle.dump(root_folder, outfile, 1)
23       outfile.close()
24
25
26    def load(self):
27       infile = open(self.filename, 'rb')
28       root_folder = pickle.load(infile)
29       infile.close()
30
31       return root_folder