reverted naming

pull/3/head
Langenfeld 2021-01-12 11:10:32 +01:00
rodzic c8ebd7e1e6
commit a198a5382c
7 zmienionych plików z 11 dodań i 11 usunięć

Wyświetl plik

@ -327,7 +327,7 @@ class Repository(GiteaApiObject):
def create_gitea_hook(self, hook_url: str, events: List[str]): def create_gitea_hook(self, hook_url: str, events: List[str]):
url = f"/repos/{self.owner.username}/{self.name}/hooks" url = f"/repos/{self.owner.username}/{self.name}/hooks"
data = { data = {
"type": "py-gitea", "type": "gitea",
"config": {"content_type": "json", "url": hook_url}, "config": {"content_type": "json", "url": hook_url},
"events": events, "events": events,
"active": True, "active": True,
@ -445,7 +445,7 @@ class Commit(GiteaApiObject):
@classmethod @classmethod
def parse_response(cls, gitea, result): def parse_response(cls, gitea, result):
id = result["sha"] id = result["sha"]
# py-gitea.logger.debug("Found api object of type %s (id: %s)" % (type(cls), id)) # gitea.logger.debug("Found api object of type %s (id: %s)" % (type(cls), id))
api_object = cls(gitea, id=id) api_object = cls(gitea, id=id)
cls._initialize(gitea, api_object, result) cls._initialize(gitea, api_object, result)
# HACK # HACK
@ -961,7 +961,7 @@ class Gitea:
self.logger.debug("Gitea response: %s", result) self.logger.debug("Gitea response: %s", result)
else: else:
self.logger.error(result["message"]) self.logger.error(result["message"])
raise Exception("User not created... (py-gitea: %s)" % result["message"]) raise Exception("User not created... (gitea: %s)" % result["message"])
user = User.parse_response(self, result) user = User.parse_response(self, result)
return user return user
@ -1003,7 +1003,7 @@ class Gitea:
self.logger.info("Successfully created Repository %s " % result["name"]) self.logger.info("Successfully created Repository %s " % result["name"])
else: else:
self.logger.error(result["message"]) self.logger.error(result["message"])
raise Exception("Repository not created... (py-gitea: %s)" % result["message"]) raise Exception("Repository not created... (gitea: %s)" % result["message"])
return Repository.parse_response(self, result) return Repository.parse_response(self, result)
def create_org( def create_org(
@ -1032,11 +1032,11 @@ class Gitea:
) )
else: else:
self.logger.error( self.logger.error(
"Organization not created... (py-gitea: %s)" % result["message"] "Organization not created... (gitea: %s)" % result["message"]
) )
self.logger.error(result["message"]) self.logger.error(result["message"])
raise Exception( raise Exception(
"Organization not created... (py-gitea: %s)" % result["message"] "Organization not created... (gitea: %s)" % result["message"]
) )
return Organization.parse_response(self, result) return Organization.parse_response(self, result)
@ -1076,11 +1076,11 @@ class Gitea:
if "id" in result: if "id" in result:
self.logger.info("Successfully created Team %s" % result["name"]) self.logger.info("Successfully created Team %s" % result["name"])
else: else:
self.logger.error("Team not created... (py-gitea: %s)" % result["message"]) self.logger.error("Team not created... (gitea: %s)" % result["message"])
self.logger.error(result["message"]) self.logger.error(result["message"])
raise Exception("Team not created... (py-gitea: %s)" % result["message"]) raise Exception("Team not created... (gitea: %s)" % result["message"])
api_object = Team.parse_response(self, result) api_object = Team.parse_response(self, result)
setattr( setattr(
api_object, "_organization", org api_object, "_organization", org
) # fixes strange behaviour of py-gitea not returning a valid organization here. ) # fixes strange behaviour of gitea not returning a valid organization here.
return api_object return api_object

Wyświetl plik

@ -5,7 +5,7 @@ with open('README.md') as readme_file:
setup_args = dict( setup_args = dict(
name='py-gitea', name='py-gitea',
version='0.1.1', version='0.1.2',
description='A python wrapper for the Gitea API', description='A python wrapper for the Gitea API',
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
long_description=README, long_description=README,

Wyświetl plik

@ -4,7 +4,7 @@ import uuid
from gitea import Gitea, User, Organization, Team, Repository, Issue from gitea import Gitea, User, Organization, Team, Repository, Issue
from gitea import NotFoundException, AlreadyExistsException from gitea import NotFoundException, AlreadyExistsException
# put a ".token" file into your directory containg only the token for py-gitea # put a ".token" file into your directory containg only the token for gitea
@pytest.fixture @pytest.fixture
def instance(scope="module"): def instance(scope="module"):
try: try: