aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--rss_to_gitea/config.py2
-rw-r--r--rss_to_gitea/gitea.py2
-rw-r--r--rss_to_gitea/main.py13
-rwxr-xr-xsetup.py4
5 files changed, 15 insertions, 7 deletions
diff --git a/README.md b/README.md
deleted file mode 100644
index 42c90e4..0000000
--- a/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# rss-to-gitea
diff --git a/rss_to_gitea/config.py b/rss_to_gitea/config.py
index 1737a39..faf3350 100644
--- a/rss_to_gitea/config.py
+++ b/rss_to_gitea/config.py
@@ -94,7 +94,7 @@ class Config:
def load(self, _dict):
self.config = _dict
- def __getattr__(self, _attr) -> float | int | Config | None:
+ def __getattr__(self, _attr) -> str | Config | None:
if _attr not in self.config:
return None
diff --git a/rss_to_gitea/gitea.py b/rss_to_gitea/gitea.py
index fcc985c..e1aa62a 100644
--- a/rss_to_gitea/gitea.py
+++ b/rss_to_gitea/gitea.py
@@ -46,7 +46,7 @@ class GiteaAPI:
def createIssue(self, _owner, _repo, _title, _content, _assign, _labels):
data={
'assignee':_assign,
-# 'body':_content,
+ 'body':_content,
'labels':_labels,
'title':_title
}
diff --git a/rss_to_gitea/main.py b/rss_to_gitea/main.py
index c1a4a11..8d31197 100644
--- a/rss_to_gitea/main.py
+++ b/rss_to_gitea/main.py
@@ -16,10 +16,17 @@ USAGE:
def main():
if len(sys.argv) <= 1:
+ print_help()
return 1
config = Config(sys.argv[1])
- api = GiteaAPI("https://gitea.my.cum.re", config.token)
+
+ token = config.token
+ if str.startswith(token, 'env/'):
+ splt = token.split('/',1)
+ token = os.environ[splt[1]]
+
+ api = GiteaAPI(config.url, token)
label_id = api.getLabelId(config.owner, config.repo, config.label)
@@ -35,4 +42,6 @@ def main():
print(f'{issue_title} already exists. Skipping')
continue
- result = api.createIssue(config.owner, config.repo, issue_title, '', feed['assign'], [label_id])
+ print(feed)
+
+ result = api.createIssue(config.owner, config.repo, issue_title, latest['link'], feed['assign'], [label_id])
diff --git a/setup.py b/setup.py
index 689394b..1d3a4f7 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import setuptools
setup(
name='rsstogitea',
- version='0.0.0-dev',
+ version='0.1.0',
author="Jonas Gunz",
description="Create a Gitea Issue for new RSS entries",
packages=['rss_to_gitea'],
@@ -15,7 +15,7 @@ setup(
"pyyaml"
],
license='All rights reserved',
- long_description=open('README.md').read(),
+ long_description=open('Readme.md').read(),
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",