X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=setup.py;h=939a7218a215c98921d608bc8cc4da21aed0b3fc;hb=3d86d323cd351d084dd21b4530d753298fe28502;hp=50b85c1048bd1eba5fe3c4601402d5ccf03d6acb;hpb=691525d47e162525a9f0a179c02dab493cbea940;p=lightcards.git diff --git a/setup.py b/setup.py index 50b85c1..939a721 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,37 @@ from setuptools import setup -from os import path +import os +import shutil -pwd = path.abspath(path.dirname(__file__)) -with open(path.join(pwd, "README.md"), encoding="utf-8") as f: +pwd = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(pwd, "README.md"), encoding="utf-8") as f: long_description = f.read() + +def mkdir(dir): + try: + os.makedirs(dir) + except FileExistsError: + pass + + +if os.geteuid() == 0: + mkdir("/etc/lightcards/") + shutil.copyfile("./config.py", "/etc/lightcards/config.py") +else: + xdg = os.environ.get("XDG_CONFIG_HOME") + home = os.path.expanduser("~") + + if xdg: + mkdir(f"{xdg}/lightcards") + shutil.copyfile("./config.py", f"{xdg}/lightcards/config.py") + else: + mkdir(f"{home}/.config/lightcards") + shutil.copyfile("./config.py", f"{home}/.config/lightcards/config.py") + + setup( name="lightcards", - version="0.2.0", + version="0.7.0", description="Terminal flashcards from Markdown", long_description=long_description, long_description_content_type="text/markdown", @@ -17,11 +41,17 @@ setup( license="MIT", packages=["lightcards"], install_requires=["beautifulsoup4", "markdown"], + data_files=[ + ("man/man1", ["man/lightcards.1"]), + ("man/man5", ["man/lightcards-config.5"]), + ], + entry_points={ + "console_scripts": ["lightcards=lightcards:main"], + }, classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Other Audience", + "Intended Audience :: Education", "Environment :: Console :: Curses", "License :: OSI Approved :: MIT License", - "Topic :: Utilities" + "Topic :: Education", ], )