Langenfeld 2020-10-14 14:44:05 +02:00
rodzic e9d45515d9
commit 0acbdbe125
5 zmienionych plików z 22 dodań i 22 usunięć

Wyświetl plik

@ -10,4 +10,3 @@ from .gitea import (
Issue, Issue,
Milestone, Milestone,
) )

Wyświetl plik

@ -1,8 +1,7 @@
import logging
from .exceptions import ObjectIsInvalid from .exceptions import ObjectIsInvalid
class BasicGiteaApiObject:
class BasicGiteaApiObject:
GET_API_OBJECT = "FORMAT/STINING/{argument}" GET_API_OBJECT = "FORMAT/STINING/{argument}"
PATCH_API_OBJECT = "FORMAT/STINING/{argument}" PATCH_API_OBJECT = "FORMAT/STINING/{argument}"

Wyświetl plik

@ -1,11 +1,14 @@
class AlreadyExistsException(Exception): class AlreadyExistsException(Exception):
pass pass
class NotFoundException(Exception): class NotFoundException(Exception):
pass pass
class ObjectIsInvalid(Exception): class ObjectIsInvalid(Exception):
pass pass
class ConflictException(Exception): class ConflictException(Exception):
pass pass

Wyświetl plik

@ -299,6 +299,7 @@ class Comment(BasicGiteaApiObject):
patchable_fields = {"body"} patchable_fields = {"body"}
class Commit(GiteaApiObject): class Commit(GiteaApiObject):
def __init__(self, gitea, id: int): def __init__(self, gitea, id: int):
@ -308,7 +309,6 @@ class Commit(GiteaApiObject):
"author": lambda gitea, u: User.parse_response(gitea, u) "author": lambda gitea, u: User.parse_response(gitea, u)
} }
@classmethod @classmethod
def request(cls, gitea, owner, repo): def request(cls, gitea, owner, repo):
api_object = cls._request(gitea, {"owner": owner, "repo": repo}) api_object = cls._request(gitea, {"owner": owner, "repo": repo})

Wyświetl plik

@ -1,8 +1,7 @@
from .basicGiteaApiObject import BasicGiteaApiObject from .basicGiteaApiObject import BasicGiteaApiObject
import logging
class GiteaApiObject(BasicGiteaApiObject): class GiteaApiObject(BasicGiteaApiObject):
GET_API_OBJECT = "FORMAT/STINING/{argument}" GET_API_OBJECT = "FORMAT/STINING/{argument}"
PATCH_API_OBJECT = "FORMAT/STINING/{argument}" PATCH_API_OBJECT = "FORMAT/STINING/{argument}"