From df326fb87bedc28fe69c570bdf21c34e4b4f4850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zcan=20O=C4=9Fuz?= Date: Mon, 24 Aug 2020 12:17:21 +0300 Subject: [PATCH] 0.1.0 --- pfxposter/__init__.py | 2 +- pfxposter/pfxposter.py | 2 +- requirements.txt | 2 +- setup.py | 12 +++++++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pfxposter/__init__.py b/pfxposter/__init__.py index bfd2bf4..3edc1fe 100644 --- a/pfxposter/__init__.py +++ b/pfxposter/__init__.py @@ -2,6 +2,6 @@ from .pfxposter import * -__version__ = '0.0.1' +__version__ = '0.1.0' diff --git a/pfxposter/pfxposter.py b/pfxposter/pfxposter.py index 398b2ed..d3ca153 100644 --- a/pfxposter/pfxposter.py +++ b/pfxposter/pfxposter.py @@ -41,7 +41,7 @@ def main(): get_image = requests.get(image_url) tmp.write(get_image.content) mastodon_media = mastodon.media_post(tmp.name) - #mastodon.status_post(image_name, media_ids=mastodon_media['id']) + mastodon.status_post(image_name, media_ids=mastodon_media['id']) print("Status posted: ", image_name) tmp.close() if __name__ == "__main__": diff --git a/requirements.txt b/requirements.txt index 2c15ad2..6044b60 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ twine Mastodon.py>=1.5.1 atoma>=0.0.17 toml>=0.10.1 - +python-crontab>=2.5.1 diff --git a/setup.py b/setup.py index 84d978a..e314ae2 100755 --- a/setup.py +++ b/setup.py @@ -4,10 +4,16 @@ from setuptools import setup from setuptools import find_packages import os import pfxposter +from crontab import CronTab with open("README.md", "r") as fh: long_description = fh.read() +def _post_install(): + cron_job = CronTab(user=os.getenv("USER")) + autochecker = cron_job.new(command='pfxposter') + autochecker.minute.every(1) + cron_job.write() setup( name='pfxposter', @@ -21,6 +27,7 @@ setup( license='GLWTS(Good Luck With That Shit) Public License', packages=find_packages(), zip_safe=False, + include_package_data=True, project_urls={ "Bug Tracker": "https://github.com/ooguz/pfxposter/issues", "Source Code": "https://github.com/ooguz/pfxposter", @@ -35,7 +42,10 @@ setup( "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet", ], + entry_points={"console_scripts": ["pfxposter = pfxposter.pfxposter:main"]}, data_files=[('/home/{}/.pfxposter', ['data/config.toml'])], python_requires=">=3.6", - install_requires=['Mastodon.py>=1.5.1', 'atoma>=0.0.17', 'toml>=0.10.1'] + install_requires=['Mastodon.py>=1.5.1', 'atoma>=0.0.17', 'toml>=0.10.1', 'python-crontab>=2.5.1'] ) + +_post_install()