# Path: de/hochschuletrier/jpy/jason/JSONBackupHandler.py
# class JSONBackupHandler:
# 	def __init__(self, file):
# 		self.file = file
# 
# 	def save(self, data):
# 		with open(self.file, 'w') as outfile:
# 			json.dump(data, outfile, default=SerializableCandidate.default)
# 
# 	def load(self):
# 		with open(self.file) as data_file:
# 			jsondata = json.load(data_file)
# 		return jsondata
# 
# Path: de/hochschuletrier/jpy/console/JPYLogger.py
# class JPYLogger:
# 	def __init__(self, caller):
# 		self.caller = caller.__class__.__name__
# 		self.color = self.getColor()
# 
# 	def log(self, message):
# 		print self.__class__.__name__ + "[LOG] >> " + self.caller + "\t--  " + message
# 
# 	def prompt(self, message):
# 		print self.color + self.__class__.__name__ + "[GAMEINFO] >> " + self.caller + "\t--  " + message + "\033[0m"
# 
# 	def getColor(self):
# 		if self.caller == "BackupManager":
# 			return "\033[0;;34m"
# 		elif self.caller == "JPYButton":
# 			return "\033[0;;35m"
# 		else:
# 			return ""


from de.hochschuletrier.jpy.jason.JSONBackupHandler import JSONBackupHandler
from de.hochschuletrier.jpy.console.JPYLogger import JPYLogger
__author__ = 'miko'


class BackupManager:
	def __init__(self, root):
		self.root = root
		self.usebackup = False
		self.dobackup = True
		self.logger = JPYLogger(self)
		self.fileName_candidates = "candidates_backup.json"
		self.fileName_questions = "questions_backup.json"
		self.jsonCandidatesHandler = JSONBackupHandler(self.fileName_candidates)

# Path: de/hochschuletrier/jpy/jason/JSONBackupHandler.py
# class JSONBackupHandler:
# 	def __init__(self, file):
# 		self.file = file
# 
# 	def save(self, data):
# 		with open(self.file, 'w') as outfile:
# 			json.dump(data, outfile, default=SerializableCandidate.default)
# 
# 	def load(self):
# 		with open(self.file) as data_file:
# 			jsondata = json.load(data_file)
# 		return jsondata
# 
# Path: de/hochschuletrier/jpy/console/JPYLogger.py
# class JPYLogger:
# 	def __init__(self, caller):
# 		self.caller = caller.__class__.__name__
# 		self.color = self.getColor()
# 
# 	def log(self, message):
# 		print self.__class__.__name__ + "[LOG] >> " + self.caller + "\t--  " + message
# 
# 	def prompt(self, message):
# 		print self.color + self.__class__.__name__ + "[GAMEINFO] >> " + self.caller + "\t--  " + message + "\033[0m"
# 
# 	def getColor(self):
# 		if self.caller == "BackupManager":
# 			return "\033[0;;34m"
# 		elif self.caller == "JPYButton":
# 			return "\033[0;;35m"
# 		else:
# 			return ""


# Path: de/hochschuletrier/jpy/backup/BackupManager.py
from de.hochschuletrier.jpy.jason.JSONBackupHandler import JSONBackupHandler
from de.hochschuletrier.jpy.console.JPYLogger import JPYLogger

__author__ = 'miko'


class BackupManager:
	def __init__(self, root):
		self.root = root
		self.usebackup = False
		self.dobackup = True
		self.logger = JPYLogger(self)
		self.fileName_candidates = "candidates_backup.json"
		self.fileName_questions = "questions_backup.json"
		self.jsonCandidatesHandler = JSONBackupHandler(self.fileName_candidates)

		self.jsonQuestionsHandler = JSONBackupHandler(self.fileName_questions)