Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: UTF-8 -*-
- '''
- Created on 2011.06.26.
- @author: julius
- '''
- from user import cUserRepo
- from pickle import dump, load
- class UserRepoWrapper(object):
- '''
- classdocs
- '''
- dumpFilePath = 'users.dump'
- def __init__(self, usernames, comment_dict):
- '''
- Constructor
- '''
- try:
- dumpfile = open(self.dumpFilePath, 'rb')
- self.usrepo = load(dumpfile)
- dumpfile.close()
- except IOError:
- self.usrepo = cUserRepo(usernames, comment_dict)
- dumpfile = open(self.dumpFilePath, 'wb')
- dump(self.usrepo, dumpfile)
- dumpfile.close()
- def getResponses(self, tags):
- return self.usrepo.getResponses(tags)
- def __str__(self):
- return str(self.usrepo)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement