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')
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()
def __init__(self, cfg: Config): self.logger = cfg.get_logger() self.db = LastfmUpdater(cfg) self.api = LastFmRequester(cfg=cfg)