utils
Class info¶
🛈 DocStrings¶
create_asset_model
¶
create_asset_model(gitea_asset: Attachment) -> Asset
Create Asset model from Gitea asset object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_branch_model
¶
create_branch_model(gitea_branch: Branch) -> Branch
Create Branch model from Gitea branch object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_commit_model
¶
create_commit_model(commit: Commit) -> Commit
Create Commit model from Gitea commit object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_issue_model
¶
create_issue_model(issue: Issue) -> Issue
Create Issue model from Gitea issue object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_label_model
¶
create_label_model(gitea_label: Label) -> Label
Create Label model from Gitea label object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_pull_request_model
¶
create_pull_request_model(pr: PullRequest) -> PullRequest
Create PullRequest model from Gitea PR object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_release_model
¶
create_release_model(release: Release) -> Release
Create Release model from Gitea release object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_tag_model
¶
create_tag_model(gitea_tag: Tag) -> Tag
Create Tag model from Gitea tag object.
Source code in src/githarbor/providers/gitea_provider/utils.py
create_user_model
¶
create_user_model(gitea_user: User) -> User
create_user_model(gitea_user: User | None) -> User | None
Create User model from Gitea user object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gitea_user
|
User | None
|
Gitea user object to convert |
required |
Returns:
| Type | Description |
|---|---|
User | None
|
Converted User model or None if input is None |
Source code in src/githarbor/providers/gitea_provider/utils.py
handle_api_errors
¶
Decorator to handle Gitea API exceptions consistently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
error_msg
|
str
|
Base error message to use in exception |
required |