Esempio n. 1
0
def main():
    # Load config and get logger
    cfg = Config()
    logger = cfg.get_logger()

    # Let's go
    logger.info('Main:Session started')
    lastfm = LastFmPipe(cfg)
    lastfm.update_all()
    logger.info('Main:Session closed')
Esempio n. 2
0
    def __init__(self, cfg: Config) -> None:
        self.logger = cfg.get_logger()
        database = cfg.database.database
        user = cfg.database.user
        password = cfg.database.password
        host = cfg.database.host
        port = cfg.database.port

        self.conn = psycopg2.connect(host=host,
                                     port=port,
                                     dbname=database,
                                     user=user,
                                     password=password)
        self.cur = self.conn.cursor()
Esempio n. 3
0
 def __init__(self, cfg: Config):
     self.logger = cfg.get_logger()
     self.db = LastfmUpdater(cfg)
     self.api = LastFmRequester(cfg=cfg)