From 27533359f2c39ddd7fa60968c5afb50f67b6b329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zcan=20O=C4=9Fuz?= Date: Mon, 24 Aug 2020 15:14:00 +0300 Subject: [PATCH] RC1: everything tested --- pfxposter/poster.py | 5 ++--- setup.py | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pfxposter/poster.py b/pfxposter/poster.py index cd6bc76..7e2f7b7 100644 --- a/pfxposter/poster.py +++ b/pfxposter/poster.py @@ -9,6 +9,8 @@ import requests import toml from mastodon import Mastodon +homedir = os.getenv("HOME") +config_file = "{}/.pfxposter".format(homedir) def create_config(config_file): conf_includes = textwrap.dedent(""" @@ -60,9 +62,6 @@ def syncronize(config_file, config, username, last_updated, mastodon): def main(): - homedir = os.getenv("HOME") - config_file = "{}/.pfxposter".format(homedir) - if not os.path.exists(config_file): create_config(config_file) diff --git a/setup.py b/setup.py index 0c9009f..aa9ef30 100755 --- a/setup.py +++ b/setup.py @@ -10,13 +10,10 @@ with open("README.md", "r") as fh: long_description = fh.read() def _post_install(): - conf_includes = 'updated = 2020-08-24 00:00:00+00:00\n\n[mastodon]\n mastodon_url = "https://oyd.social"\naccess_token = "your_access_token_here"\n\n[pixelfed]\npixelfed_url = "https://pixelfed.social"\nusername = "username"' cron_job = CronTab(user=os.getenv("USER")) autochecker = cron_job.new(command='pfxposter') autochecker.minute.every(1) cron_job.write() - with open("{}/.pfxposter".format(os.getenv("HOME")), "w") as conf: - conf.write(conf_includes) setup( name='pfxposter', @@ -46,7 +43,7 @@ setup( "Topic :: Internet", ], entry_points={"console_scripts": ["pfxposter = pfxposter.poster:main"]}, - data_files=[('/home/{}/.pfxposter'.format(os.getenv("USER")), ['data/config.toml'])], + #data_files=[('/home/{}/.pfxposter'.format(os.getenv("USER")), ['data/config.toml'])], python_requires=">=3.6", install_requires=['Mastodon.py>=1.5.1', 'atoma>=0.0.17', 'toml>=0.10.1', 'python-crontab>=2.5.1', 'requests'] )