| 
															 | 
															 | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															import os | 
															 | 
															 | 
															import os | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															import json | 
														
														
													
														
															 | 
															 | 
															import pygame | 
															 | 
															 | 
															import pygame | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  | 
														
														
													
												
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															    raise LoadError("Font subsystem not initialized before attempting to obtain resource.") | 
															 | 
															 | 
															    raise LoadError("Font subsystem not initialized before attempting to obtain resource.") | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															class DataContainer: | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															    def __init__(self, data): | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															        self._data = data | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															    @property | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															    def data(self): | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															        return self._data | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															
  | 
														
														
													
														
															 | 
															 | 
															def load_JSON(filename, params={}): | 
															 | 
															 | 
															def load_JSON(filename, params={}): | 
														
														
													
														
															 | 
															 | 
															    if not os.path.isfile(filename): | 
															 | 
															 | 
															    if not os.path.isfile(filename): | 
														
														
													
														
															 | 
															 | 
															        raise LoaderError("File '{}' is missing or not a file.".format(filename)) | 
															 | 
															 | 
															        raise LoaderError("File '{}' is missing or not a file.".format(filename)) | 
														
														
													
												
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															    try: | 
															 | 
															 | 
															    try: | 
														
														
													
														
															 | 
															 | 
															        with open(filename) as f: | 
															 | 
															 | 
															        with open(filename) as f: | 
														
														
													
														
															 | 
															 | 
															            data = json.load(f) | 
															 | 
															 | 
															            data = json.load(f) | 
														
														
													
														
															 | 
															 | 
															        return data | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															        return DataContainer(data) | 
														
														
													
														
															 | 
															 | 
															    except Exception as e: | 
															 | 
															 | 
															    except Exception as e: | 
														
														
													
														
															 | 
															 | 
															        raise e | 
															 | 
															 | 
															        raise e | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  |