Compare commits

..

2 Commits

Author SHA1 Message Date
4c5d2b08fd Ruff
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 24s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 23s
2025-04-13 23:40:10 +02:00
94ecf8d526 feat: introduce AiderArgs dataclass for better argument handling 2025-04-13 23:40:05 +02:00
2 changed files with 18 additions and 8 deletions

View File

@ -7,12 +7,19 @@ It assumes that the default branch (default "main") exists and that you have a v
import argparse
import logging
import time
from dataclasses import dataclass
from . import handle_issues, secrets
from .gitea_client import GiteaClient
from .seen_issues_db import SeenIssuesDB
logger = logging.getLogger(__name__)
@dataclass
class AiderArgs:
gitea_url: str
owner: str
repo: str
base_branch: str
def parse_args():
@ -63,12 +70,13 @@ def main():
while True:
logger.info('Checking for new issues...')
for repo in repositories:
args_copy = argparse.Namespace()
args_copy.gitea_url = args.gitea_url
args_copy.owner = args.owner
args_copy.repo = repo
args_copy.base_branch = args.base_branch
handle_issues(args_copy, client, seen_issues_db)
aider_args = AiderArgs(
gitea_url=args.gitea_url,
owner=args.owner,
repo=repo,
base_branch=args.base_branch,
)
handle_issues(aider_args, client, seen_issues_db)
if not args.daemon:
break
logger.info('Sleeping for %d seconds...', args.interval)

View File

@ -109,7 +109,9 @@ class GiteaClient:
return issues
def iter_user_repositories(
self, owner: str, only_those_with_issues: bool = False,
self,
owner: str,
only_those_with_issues: bool = False,
) -> Iterator[str]:
"""
Get a list of repositories for a given user.