-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
48 lines (39 loc) · 1.69 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import sys
import os
import shutil
setup(
name='loniak',
version='0.1',
packages=[
'loniak_module', 'loniak_module.clients', 'loniak_module.config', 'loniak_module.libs', 'loniak_module.libs.dateutil',
'loniak_module.loniak_exceptions', 'loniak_module.services', 'loniak_module.sources', 'loniak_module.tr', 'loniak_module.utils',
],
py_modules=[
'loniak_module', 'loniak_module.clients', 'loniak_module.config', 'loniak_module.libs', 'loniak_module.libs.dateutil',
'loniak_module.loniak_exceptions', 'loniak_module.services', 'loniak_module.sources', 'loniak_module.tr', 'loniak_module.utils',
],
scripts=['loniak.py',],
url='http://suwala.eu/',
author="Pawel Suwala",
author_email="[email protected]",
license='GPLv3',
long_description="Torrent fetching client.",
install_requires=['dateutils >= 0.6', 'docopt >= 0.6', 'feedparser >= 5'],
)
if sys.argv[1].lower() == 'install':
DEFAULT_CONFIG_DIRECTORY = '/etc/loniak/'
DEFAULT_CONFIG_LOCATION = '/etc/loniak/loniak.conf'
DEFAULT_DATA_LOCATION = '/etc/loniak/data.json'
if not os.path.exists(DEFAULT_CONFIG_DIRECTORY):
os.makedirs(DEFAULT_CONFIG_DIRECTORY)
if not os.path.exists(DEFAULT_CONFIG_LOCATION):
shutil.copyfile("example_config.conf", DEFAULT_CONFIG_LOCATION)
# by default we allow everyone to read/write config file.
os.chmod(DEFAULT_CONFIG_LOCATION, 0666)
if not os.path.exists(DEFAULT_DATA_LOCATION):
open(DEFAULT_DATA_LOCATION, 'w+').close()
os.chmod(DEFAULT_DATA_LOCATION, 0666)