From c2c13034066508b54395ef2fadba804a4e20201b Mon Sep 17 00:00:00 2001 From: Langenfeld Date: Wed, 14 Nov 2018 13:53:24 +0100 Subject: [PATCH] proper module and naming --- example.py | 4 ++-- GITEA.py => gitea/Gitea.py | 5 +---- gitea/__init__.py | 5 +++++ gitea/requirements.txt | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) rename GITEA.py => gitea/Gitea.py (99%) create mode 100644 gitea/__init__.py create mode 100644 gitea/requirements.txt diff --git a/example.py b/example.py index e20891a..55045e5 100644 --- a/example.py +++ b/example.py @@ -1,6 +1,6 @@ -from GITEA import * +from gitea import * -gitea = GITEA("https://test-gitea.something", "api-token") +gitea = Gitea("https://test-gitea.something", "api-token") ##create Organization that does exist org = Organization(gitea, "existing-organization") diff --git a/GITEA.py b/gitea/Gitea.py similarity index 99% rename from GITEA.py rename to gitea/Gitea.py index ed85a87..b5c393a 100644 --- a/GITEA.py +++ b/gitea/Gitea.py @@ -2,9 +2,6 @@ import json import requests import logging -""" -based on https://github.com/m301/py-gitea -""" class Organization: @@ -102,7 +99,7 @@ class Repository: return Repository(gitea, repoOwner, repoName) -class GITEA(): +class Gitea(): """ @:param url: url of Gitea server without .../api/ diff --git a/gitea/__init__.py b/gitea/__init__.py new file mode 100644 index 0000000..735d632 --- /dev/null +++ b/gitea/__init__.py @@ -0,0 +1,5 @@ +from gitea.Gitea import Gitea +from gitea.Gitea import Repository +from gitea.Gitea import User +from gitea.Gitea import Organization + diff --git a/gitea/requirements.txt b/gitea/requirements.txt new file mode 100644 index 0000000..d514163 --- /dev/null +++ b/gitea/requirements.txt @@ -0,0 +1 @@ +requests==2.18.4 \ No newline at end of file