1
0

Ruff
Some checks are pending
Run Python tests (through Pytest) / Test (push) Waiting to run
Verify Python project can be installed, loaded and have version checked / Test (push) Waiting to run

This commit is contained in:
Jon Michael Aanes 2025-05-21 00:58:37 +02:00
parent e26caaa98c
commit 5bfdb80dcf
2 changed files with 3 additions and 1 deletions

View File

@ -98,7 +98,7 @@ def get_cookiejar(use_cookiejar: bool):
if len(cookiejar) > 10: if len(cookiejar) > 10:
return cookiejar return cookiejar
browser_cookie3.firefox( browser_cookie3.firefox(
'/home/jmaa/.cachy/mbui5xg7.default-release/cookies.sqlite' '/home/jmaa/.cachy/mbui5xg7.default-release/cookies.sqlite',
) )
if len(cookiejar) > 10: if len(cookiejar) > 10:
return cookiejar return cookiejar

View File

@ -54,6 +54,7 @@ PACKAGE_DESCRIPTION_SHORT = """
This program collects several small data fetchers, for downloading personal This program collects several small data fetchers, for downloading personal
data spread around the internet.""".strip() data spread around the internet.""".strip()
def parse_version_file(text: str) -> str: def parse_version_file(text: str) -> str:
text = re.sub('^#.*', '', text, flags=re.MULTILINE) text = re.sub('^#.*', '', text, flags=re.MULTILINE)
match = re.match(r'^\s*__version__\s*=\s*(["\'])([\d\.]+)\1$', text) match = re.match(r'^\s*__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
@ -62,6 +63,7 @@ def parse_version_file(text: str) -> str:
raise Exception(msg) raise Exception(msg)
return match.group(2) return match.group(2)
with open(PACKAGE_NAME + '/_version.py') as f: with open(PACKAGE_NAME + '/_version.py') as f:
version = parse_version_file(f.read()) version = parse_version_file(f.read())