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 Wrappers for calling an processing return values from rospack and rosstack
38 """
39
40 import os
41 import subprocess
42 import roslib.exceptions
43 import roslib.rosenv
44
46 """
47 @return: result of executing rospack command (via subprocess). string will be strip()ed.
48 @rtype: str
49 @raise roslib.exceptions.ROSLibException: if rospack command fails
50 """
51 rospack_bin = os.path.join(roslib.rosenv.get_ros_root(), 'bin', 'rospack')
52 val = (subprocess.Popen([rospack_bin] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] or '').strip()
53 if val.startswith('rospack:'):
54 raise roslib.exceptions.ROSLibException(val)
55 return val
56
58 """
59 @param pkg: package name
60 @type pkg: str
61 @return: A list of the names of the packages which depend directly on pkg
62 @rtype: list
63 """
64 return rospackexec(['depends-on1', pkg]).split()
65
67 """
68 @param pkg: package name
69 @type pkg: str
70 @return: A list of the names of the packages which depend on pkg
71 @rtype: list
72 """
73 return rospackexec(['depends-on', pkg]).split()
74
76 """
77 @param pkg: package name
78 @type pkg: str
79 @return: A list of the names of the packages which pkg directly depends on
80 @rtype: list
81 """
82 return rospackexec(['deps1', pkg]).split()
83
85 """
86 @param pkg: package name
87 @type pkg: str
88 @return: A list of the names of the packages which pkg depends on
89 @rtype: list
90 """
91 return rospackexec(['deps', pkg]).split()
92
94 """
95 @param pkg: package name
96 @type pkg: str
97 @return: A list of the names of the packages which provide a plugin for pkg
98 @rtype: list
99 """
100 val = rospackexec(['plugins', '--attrib=plugin', pkg])
101 if val:
102 return [tuple(x.split(' ')) for x in val.split('\n')]
103 else:
104 return []
105
107 """
108 @return: result of executing rosstack command (via subprocess). string will be strip()ed.
109 @rtype: str
110 @raise roslib.exceptions.ROSLibException: if rosstack command fails
111 """
112 rosstack_bin = os.path.join(roslib.rosenv.get_ros_root(), 'bin', 'rosstack')
113 val = (subprocess.Popen([rosstack_bin] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] or '').strip()
114 if val.startswith('rosstack:'):
115 raise roslib.exceptions.ROSLibException(val)
116 return val
117
119 """
120 @param s: stack name
121 @type s: str
122 @return: A list of the names of the stacks which depend on s
123 @rtype: list
124 """
125 return rosstackexec(['depends-on', s]).split()
126
128 """
129 @param s: stack name
130 @type s: str
131 @return: A list of the names of the stacks which depend directly on s
132 @rtype: list
133 """
134 return rosstackexec(['depends-on1', s]).split()
135
137 """
138 @param s: stack name
139 @type s: str
140 @return: A list of the names of the stacks which s depends on
141 @rtype: list
142 """
143 return rosstackexec(['depends', s]).split()
144
146 """
147 @param s: stack name
148 @type s: str
149 @return: A list of the names of the stacks which s depends on directly
150 @rtype: list
151 """
152 return rosstackexec(['depends1', s]).split()
153