-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·41 lines (33 loc) · 1.25 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# TODO: Carlos, Mikel, Rafa: Create desktop icon for linux. (and maybe Windows)
from os import name
from subprocess import Popen, PIPE
from setuptools import setup
from slcl_server.app.gen_ssl import create_self_signed_cert
from slcl_server.app.config.constants import app_path
print("[*] Setting up...")
setup(name="SlothCloud", version="0.1",
description="RESTful access media server made using Python 3 and Flask",
author="Ninia",
author_email="[email protected]",
url="https://github.com/Ninia/SlothCloud",
install_requires=["flask", "Flask-AutoIndex", "pyopenssl"])
if name == "posix":
print("[*] Generating alias for slcl...")
try:
with open("$HOME/.bashrc", 'a') as bashrc:
bashrc.write("alias slcl='%s/run.py'" % app_path)
print("[*] Done.")
except FileNotFoundError:
print("[*] Error. Couldn't create alias")
print("[*] updating terminal...")
out, err = Popen("source ~/.bashrc", shell=True,
stdout=PIPE, stderr=PIPE).communicate()
if err:
print(err)
else:
print("[*] Done.")
print("[*] Generating SSL Certificate:")
create_self_signed_cert()
print("[*] Done with SSL Certificate.")