mirror of
https://github.com/Balshgit/github_mirror.git
synced 2026-02-04 10:40:39 +03:00
replace kwargs for more clearly
This commit is contained in:
@@ -37,10 +37,10 @@ def create_parser() -> ArgumentParser:
|
||||
parser.add_argument('-g', '--group', required=False, type=int,
|
||||
help='Add group id it can be found under group name. Id must be integer')
|
||||
|
||||
parser.add_argument('-u', '--urls', nargs='+', help='Provide url or urls to mirror with it in format: '
|
||||
'https://github.com/s3rius/FastAPI-template.git. '
|
||||
'You can provide multiple urls separated by space. '
|
||||
'Names will generate automatically from links')
|
||||
parser.add_argument('-u', '--urls', nargs='+',
|
||||
help='Provide url or urls to mirror with it in format: '
|
||||
'https://github.com/s3rius/FastAPI-template.git. You can provide multiple urls '
|
||||
'separated by space. Names will generate automatically from links')
|
||||
|
||||
parser.add_argument('-f', '--file', help='Add file with urls. Each url on new line. Can be combined with '
|
||||
'--url option. Names will generate automatically from links')
|
||||
|
||||
@@ -92,13 +92,14 @@ class RepositoryCreator:
|
||||
elif request.status_code != self.HTTP_200_OK:
|
||||
logger.error(f'Error pull repository. Status code: {request.status_code}. Reason: {request.text}')
|
||||
|
||||
def create_repository_mirror(self, **kwargs):
|
||||
def create_repository_mirror(self, github_url: str, group_id: int):
|
||||
"""
|
||||
Base action for one thread. Creates repository, add mirror url and triggers pull at te end
|
||||
|
||||
:param kwargs: Can contain github url to mirror of, gitlab group ID
|
||||
:param github_url: Github url which will be mirrored
|
||||
:param group_id: Gitlab group id which contains created repository
|
||||
"""
|
||||
repo_id = self.__create_new_project(kwargs['url'], kwargs['group_id'])
|
||||
url = self.__add_pull_mirror(kwargs['url'], repo_id)
|
||||
repo_id = self.__create_new_project(github_url, group_id)
|
||||
url = self.__add_pull_mirror(github_url, repo_id)
|
||||
if url:
|
||||
self.__pull_github_repo(url, repo_id)
|
||||
|
||||
Reference in New Issue
Block a user