Ruff
This commit is contained in:
parent
51baddc8f2
commit
35ae8fa2a9
|
@ -1,22 +1,21 @@
|
|||
import dataclasses
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
import urllib.parse
|
||||
from collections.abc import Iterator
|
||||
|
||||
import bs4
|
||||
|
||||
from clients.myanimelist import MyAnimeListClient, MyAnimeListAnime, MyAnimeListSong
|
||||
from clients import init_client
|
||||
from clients.myanimelist import MyAnimeListAnime, MyAnimeListClient, MyAnimeListSong
|
||||
|
||||
from personal_data.data import DeduplicateMode, Scraper
|
||||
|
||||
from .. import secrets
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def client(session):
|
||||
return init_client(MyAnimeListClient, session, secrets.secrets, throws=True)
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class MyAnimeList(Scraper):
|
||||
dataset_name = 'myanimelist_anime'
|
||||
|
|
|
@ -2,6 +2,7 @@ from secret_loader import SecretLoader
|
|||
|
||||
secrets = SecretLoader(env_key_prefix='CF_PD')
|
||||
|
||||
|
||||
def load_lazy(key: str):
|
||||
return lambda: secrets.load_or_fail(key)
|
||||
|
||||
|
@ -15,15 +16,15 @@ ffxiv_character_id = load_lazy('FFXIV_CHARACTER_ID')
|
|||
|
||||
|
||||
# Playstation
|
||||
playstation_psn_id= load_lazy('PLAYSTATION_PSN_ID')
|
||||
playstation_psn_id = load_lazy('PLAYSTATION_PSN_ID')
|
||||
|
||||
|
||||
# Partisia Blockchain
|
||||
pbc_account_address= load_lazy('PBC_ACCOUNT_ADDRESS')
|
||||
pbc_account_address = load_lazy('PBC_ACCOUNT_ADDRESS')
|
||||
|
||||
|
||||
# Steam
|
||||
steam_username= load_lazy('STEAM_USERNAME')
|
||||
steam_username = load_lazy('STEAM_USERNAME')
|
||||
|
||||
|
||||
# Gitea
|
||||
|
@ -31,20 +32,20 @@ gitea_access_token = load_lazy('GITEA_ACCESS_TOKEN')
|
|||
|
||||
|
||||
# Kucoin
|
||||
kucoin_key= load_lazy('KUCOIN_KEY')
|
||||
kucoin_key = load_lazy('KUCOIN_KEY')
|
||||
|
||||
|
||||
kucoin_secret= load_lazy('KUCOIN_SECRET')
|
||||
kucoin_secret = load_lazy('KUCOIN_SECRET')
|
||||
|
||||
|
||||
kucoin_pass= load_lazy('KUCOIN_PASS')
|
||||
kucoin_pass = load_lazy('KUCOIN_PASS')
|
||||
|
||||
|
||||
# Kraken
|
||||
kraken_key= load_lazy('KRAKEN_KEY')
|
||||
kraken_key = load_lazy('KRAKEN_KEY')
|
||||
|
||||
|
||||
kraken_secret= load_lazy('KRAKEN_SECRET')
|
||||
kraken_secret = load_lazy('KRAKEN_SECRET')
|
||||
|
||||
|
||||
# Home Assistant
|
||||
|
|
2
setup.py
2
setup.py
|
@ -54,6 +54,7 @@ PACKAGE_DESCRIPTION_SHORT = """
|
|||
This program collects several small data fetchers, for downloading personal
|
||||
data spread around the internet.""".strip()
|
||||
|
||||
|
||||
def parse_version_file(text: str) -> str:
|
||||
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
|
||||
if match is None:
|
||||
|
@ -61,6 +62,7 @@ def parse_version_file(text: str) -> str:
|
|||
raise Exception(msg)
|
||||
return match.group(2)
|
||||
|
||||
|
||||
with open(PACKAGE_NAME + '/_version.py') as f:
|
||||
version = parse_version_file(f.read())
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user