Add Redmine API token authentication

This commit is contained in:
Кокос Артем Николаевич
2026-05-22 17:18:30 +07:00
parent 7bc6e024c0
commit 8bc8181ce3
14 changed files with 190 additions and 43 deletions

View File

@@ -2,7 +2,6 @@ import os
import sys
import argparse
from typing import List, Optional
from redminelib.resources import Issue
from .config import Config
from .client import fetch_issues_with_spent_time
@@ -31,7 +30,9 @@ def main(argv: Optional[List[str]] = None) -> int:
help="Date range in format YYYY-MM-DD--YYYY-MM-DD (default from .env or %(default)s)",
)
parser.add_argument(
"--compact", action="store_true", help="Use compact plain-text output instead of table"
"--compact",
action="store_true",
help="Use compact plain-text output instead of table",
)
parser.add_argument(
"--output",
@@ -82,7 +83,10 @@ def main(argv: Optional[List[str]] = None) -> int:
return 1
formatter = get_formatter_by_extension(
output_ext, author=Config.get_author(args.author), from_date=from_date, to_date=to_date
output_ext,
author=Config.get_author(args.author),
from_date=from_date,
to_date=to_date,
)
if not formatter:
@@ -98,7 +102,10 @@ def main(argv: Optional[List[str]] = None) -> int:
print(f"✅ Report saved to {args.output}")
except ImportError as e:
if output_ext == ".odt":
print("❌ odfpy is not installed. Install with: pip install odfpy", file=sys.stderr)
print(
"❌ odfpy is not installed. Install with: pip install odfpy",
file=sys.stderr,
)
else:
print(f"❌ Import error: {e}", file=sys.stderr)
return 1