-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathsetup.py
More file actions
70 lines (53 loc) · 1.64 KB
/
Copy pathsetup.py
File metadata and controls
70 lines (53 loc) · 1.64 KB
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
68
69
70
import os
from setuptools import setup
NAME = 'otter'
SCHEMA_DIR = 'schema'
def getPackages(base):
"""
Recursively find python packages.
"""
packages = []
def visit(arg, directory, files):
if '__init__.py' in files:
packages.append(directory.replace('/', '.'))
os.path.walk(base, visit, None)
return packages
packages = getPackages(NAME)
def getSchema(base):
"""
Recursively find cql files
"""
schemas = []
def visit(arg, directory, files):
schemas.append(
(directory.rstrip('/'),
[os.path.join(directory, filename)
for filename in files if filename.endswith('.cql')]))
os.path.walk(base, visit, None)
return schemas
data_files = getSchema(SCHEMA_DIR)
data_files.append(('otter/rest', ['otter/rest/otter_ascii.txt']))
# If a twisted/plugins directory exists make sure we install the
# twisted.plugins packages.
if os.path.exists('twisted/plugins'):
packages.append('twisted.plugins')
# This is an incomplete setup definition useful only for
# installation into a virtualenv with terrarium for deployment.
setup(
name=NAME,
version='0.0.0',
packages=packages,
license="Apache 2.0",
data_files=data_files,
scripts=['scripts/load_cql.py', 'scripts/trigger_convergence.py',
'scripts/cust_conf.py', 'scripts/load_zk.py']
)
# Make Twisted regenerate the dropin.cache, if possible. This is necessary
# because in a site-wide install, dropin.cache cannot be rewritten by
# normal users.
try:
from twisted.plugin import IPlugin, getPlugins
except ImportError:
pass
else:
list(getPlugins(IPlugin))