Ejemplo n.º 1
0
def cleanup(username=None,
            mosaic_file=None,
            frame_directory=None,
            output_file=None,
            is_animated=True,
            frame_duration=0.1,
            mode='I'):
    if username is None:
        return
    if is_animated:
        mosaic_frames = prepend_to_path(frame_directory, 'Mosaic_of')
        stitcher = GifStitcher(mosaic_frames, output_file)
        stitcher.make_gif(frame_duration, mode)
        print('cleaning up directories with')
        for directory in [mosaic_frames, frame_directory]:
            if os.path.exists(directory):
                shutil.rmtree(directory)
        print(output_file)
        UserAccessor().create_gallery_item(username, mosaic_file)
        print('done')
Ejemplo n.º 2
0
 def __init__(self):
     self.accessor = UserAccessor()
     self.processor = MessageProcessor()
     self.logger = logging.getLogger(__name__)
Ejemplo n.º 3
0
 def __init__(self):
     self.logger = logging.getLogger()
     self.accessor = UserAccessor()
     self.secret = os.environ.get('SECRET_KEY')
 def __init__(self):
     self.logger = logging.getLogger()
     self.accessor = UserAccessor()
     self.secret = Environment().secret_key
Ejemplo n.º 5
0
 def __init__(self, api=None):
     super().__init__(api=api)
     self.accessor = UserAccessor()