1 from setuptools import setup
5 pwd = os.path.abspath(os.path.dirname(__file__))
6 with open(os.path.join(pwd, "README.md"), encoding="utf-8") as f:
7 long_description = f.read()
13 except FileExistsError:
18 mkdir("/etc/lightcards/")
19 shutil.copyfile("./config.py", "/etc/lightcards/config.py")
21 xdg = os.environ.get("XDG_CONFIG_HOME")
22 xdg_dest = f"{xdg}/lightcards/config.py"
24 home = os.path.expanduser("~")
25 home_dest = f"{home}/.config/lightcards/config.py"
27 if xdg and not os.path.exists(xdg_dest):
28 mkdir(f"{xdg}/lightcards")
29 shutil.copyfile("./config.py", xdg_dest)
30 elif not os.path.exists(home_dest):
31 mkdir(f"{home}/.config/lightcards")
32 shutil.copyfile("./config.py", home_dest)
38 description="Terminal flashcards from Markdown",
39 long_description=long_description,
40 long_description_content_type="text/markdown",
41 url="https://sr.ht/~armaan/lightcards",
42 author="Armaan Bhojwani",
43 author_email="me@armaanb.net",
45 packages=["lightcards"],
46 install_requires=["beautifulsoup4", "markdown"],
48 ("man/man1", ["man/lightcards.1"]),
49 ("man/man5", ["man/lightcards-config.5"]),
52 "console_scripts": ["lightcards=lightcards:main"],
55 "Intended Audience :: Education",
56 "Environment :: Console :: Curses",
57 "License :: OSI Approved :: MIT License",