def process_file(self, filename): try: self.load_file(ccResourcePaths.get_keys() + filename) except: ccLogger.error('{} could not be loaded.'.format(filename)) raise RuntimeError('{} could not be loaded.'.format(filename)) self.__process_keys()
def process_file(self, filename): try: self.load_file(filename) except: ccLogger.error('{} could not be loaded.'.format(filename)) raise RuntimeError('{} could not be loaded.'.format(filename)) self.__process_config() self.__process_object_sections()
def set_anim(self, anim_name): if anim_name in self.anims: self.current_anim = ccSpriteManager.get_sprite(anim_name) self.current_anim_name = anim_name self.current_frame = self.current_anim.get_frame(0) self.active_sprite = self.current_frame.get_sprite() self.set_hitbox() else: ccLogger.error("Error: the following animation was not found: ", anim_name)
def package_check(): cache = apt.Cache() if cache['pylint'].is_installed and cache['graphviz'].is_installed: ccLogger.trace('Packages for UML creation are installed. Creating UML images.') return True else: ccLogger.error('Required packages not installed. Please execute the following: ' 'sudo apt-get install pylint, sudo apt-get install graphviz') return False
def load(self, anim_data): try: super().load(anim_data) if 'animations' in anim_data: temp = anim_data['animations'] for anim_name in anim_data['animations']: anim = ccSpriteManager.get_sprite(anim_name) self.anims[anim_name] = anim if 'start_anim' in anim_data: self.set_anim(anim_data['start_anim']) except: ccLogger.error('Sprite could not be loaded.: ') raise RuntimeError('Sprite could not be loaded.')
def step(self, time_passed): time = time_passed ccLogger.error("Error: step does not work at the moment.") error_message = ccLogger("Error: step does not work at the moment.")
def draw(self): ccLogger.error("Error: could not draw scene.") error_message = ccLogger("Error: could not draw scene.")
def load(self, filename): ccLogger.error("Error: file not loaded.") error_message = ccLogger("Error: file not loaded.")
def get_texture(self): if self.image is None: ccLogger.error("Error: there is no image stored.") return self.image
def get_height(self): if self.height == 0: ccLogger.error("Error: height is zero.") return self.height
def get_width(self): if self.width == 0: ccLogger.error("Error: width is zero.") return self.width
def get_sprite(cls, sprite_name): sprite = cls.sprites.get(sprite_name) if sprite: return sprite ccLogger.error(sprite_name + " not found.")
def get_texture(cls, texture_name): texture = cls.textures.get(texture_name) if texture: return texture ccLogger.error(texture_name + " not found.")
def draw(self, renderer): ccLogger.error( "ccObject is an abstract class, yon can't call the draw function!") raise NotImplementedError
def __init__(self): ccLogger.error("ccResourcePath is an abstract class, can't call __init__!") raise NotImplementedError