mirror of https://github.com/ooguz/pfxposter
RC1: everything tested
This commit is contained in:
parent
d9ea75ddc0
commit
27533359f2
|
@ -9,6 +9,8 @@ import requests
|
||||||
import toml
|
import toml
|
||||||
from mastodon import Mastodon
|
from mastodon import Mastodon
|
||||||
|
|
||||||
|
homedir = os.getenv("HOME")
|
||||||
|
config_file = "{}/.pfxposter".format(homedir)
|
||||||
|
|
||||||
def create_config(config_file):
|
def create_config(config_file):
|
||||||
conf_includes = textwrap.dedent("""
|
conf_includes = textwrap.dedent("""
|
||||||
|
@ -60,9 +62,6 @@ def syncronize(config_file, config, username, last_updated, mastodon):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
homedir = os.getenv("HOME")
|
|
||||||
config_file = "{}/.pfxposter".format(homedir)
|
|
||||||
|
|
||||||
if not os.path.exists(config_file):
|
if not os.path.exists(config_file):
|
||||||
create_config(config_file)
|
create_config(config_file)
|
||||||
|
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -10,13 +10,10 @@ with open("README.md", "r") as fh:
|
||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
def _post_install():
|
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"))
|
cron_job = CronTab(user=os.getenv("USER"))
|
||||||
autochecker = cron_job.new(command='pfxposter')
|
autochecker = cron_job.new(command='pfxposter')
|
||||||
autochecker.minute.every(1)
|
autochecker.minute.every(1)
|
||||||
cron_job.write()
|
cron_job.write()
|
||||||
with open("{}/.pfxposter".format(os.getenv("HOME")), "w") as conf:
|
|
||||||
conf.write(conf_includes)
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='pfxposter',
|
name='pfxposter',
|
||||||
|
@ -46,7 +43,7 @@ setup(
|
||||||
"Topic :: Internet",
|
"Topic :: Internet",
|
||||||
],
|
],
|
||||||
entry_points={"console_scripts": ["pfxposter = pfxposter.poster:main"]},
|
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",
|
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']
|
install_requires=['Mastodon.py>=1.5.1', 'atoma>=0.0.17', 'toml>=0.10.1', 'python-crontab>=2.5.1', 'requests']
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue