-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
68 lines (60 loc) · 3.2 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python
# _*_ coding: utf-8 _*_
from setuptools import setup, find_packages
import os
import imp
import shutil
banner = """
████████╗██╗ ██╗ █████╗ ███╗ ██╗██╗ ██╗███████╗ ██████╗ ██████╗ ██████╗
╚══██╔══╝██║ ██║██╔══██╗████╗ ██║██║ ██╔╝██╔════╝ ██╔════╝ ██╔═══██╗██╔══██╗
██║ ███████║███████║██╔██╗ ██║█████╔╝ ███████╗ ██║ ███╗██║ ██║██║ ██║
██║ ██╔══██║██╔══██║██║╚██╗██║██╔═██╗ ╚════██║ ██║ ██║██║ ██║██║ ██║
██║ ██║ ██║██║ ██║██║ ╚████║██║ ██╗███████║ ╚██████╔╝╚██████╔╝██████╔╝██╗
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝
"""
print banner
def non_python_files(path):
""" Return all non-python-file filenames in path """
result = []
all_results = []
module_suffixes = [info[0] for info in imp.get_suffixes()]
ignore_dirs = ['cvs']
for item in os.listdir(path):
name = os.path.join(path, item)
if (
os.path.isfile(name) and
os.path.splitext(item)[1] not in module_suffixes
):
result.append(name)
elif os.path.isdir(name) and item.lower() not in ignore_dirs:
all_results.extend(non_python_files(name))
if result:
all_results.append((path, result))
return all_results
data_files = non_python_files(os.path.join('synchrony', 'static'))
data_files.extend( non_python_files(os.path.join('synchrony', 'templates')))
try:
fd = open("requirements.txt")
REQUIREMENTS = fd.read()
fd.close()
except Exception, e:
print "Error opening requirements.txt: " + e.strerror
raise SystemExit
setup(name='Synchrony',
version="0.0.1",
description='A collaborative hyperdocument editor with distributed version control',
author='Luke Brooks',
author_email='luke@psybernetics.org.uk',
url='http://synchrony.link/',
download_url = 'https://github.com/Psybernetics/Synchrony/tarball/1.0.0',
data_files = data_files,
packages=['synchrony', 'synchrony.resources', 'synchrony.controllers', 'synchrony.views', 'synchrony.streams', 'synchrony.tests'],
include_package_data=True,
install_requires=REQUIREMENTS.split('\n'),
keywords=["p2p", "collaboration"]
)
print "Copying synchrony.py to /usr/bin/synchrony"
shutil.copyfile("./synchrony.py", "/usr/bin/synchrony")
print "Making /usr/bin/synchrony executable."
os.chmod("/usr/bin/synchrony", 0755)
print 'Check "synchrony --help" for options.'