-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
36 lines (31 loc) · 1.07 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
#!/usr/bin/env python
from distutils.core import setup
try:
# Groovy and above
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup()
except:
# For Fuerte
def getText(nodelist):
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc)
import xml.dom.minidom
file = open('stack.xml', 'r')
dom = xml.dom.minidom.parseString(file.read())
d = {}
for tag_type in ['author', 'maintainer']:
d[tag_type] = []
for element in dom.getElementsByTagName(tag_type):
d[tag_type].append(getText(element.childNodes))
d[tag_type] = ', '.join(d[tag_type])
for tag_type in ['name', 'license', 'url', 'version', 'description']:
d[tag_type] = getText(dom.getElementsByTagName(tag_type)[0].childNodes)
d['maintainer_email'] = '[email protected]'
d['keywords'] = ['ROS']
d['packages'] = ['ecto_daft']
d['package_dir'] = {'': 'python'}
d['install_requires'] = []
setup(**d)