feat: introduce AiderArgs dataclass for better argument handling
This commit is contained in:
parent
ffd5fbb662
commit
94ecf8d526
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user