kopia lustrzana https://github.com/Langenfeld/py-gitea
pull/3/head
rodzic
e9d45515d9
commit
0acbdbe125
|
@ -10,4 +10,3 @@ from .gitea import (
|
||||||
Issue,
|
Issue,
|
||||||
Milestone,
|
Milestone,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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}"
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -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})
|
||||||
|
|
|
@ -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}"
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue