Skip to content

Commit 8cf826d

Browse files
David Connerfmessmer
authored andcommitted
merge PR FlexBE#74, 76, 77; tweak CI workflow
1 parent 587958e commit 8cf826d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/io/io_codegenerator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ IO.CodeGenerator = new (function() {
220220
}
221221
code += ws+ws+"# " + pos.join(", ") + "\n";
222222
if (sm.isConcurrent()) {
223-
code += ws+ws+ sm_name + " = ConcurrencyContainer(outcomes=['" + sm.getOutcomes().join("', '") + "']";
223+
code += ws+ws+ sm_name + " = ConcurrencyContainer(outcomes=[" + sm.getOutcomes().map(x => "'" + x + "'").join(", ") + "]";
224224
} else if (sm.isPriority()) {
225-
code += ws+ws+ sm_name + " = PriorityContainer(outcomes=['" + sm.getOutcomes().join("', '") + "']";
225+
code += ws+ws+ sm_name + " = PriorityContainer(outcomes=[" + sm.getOutcomes().map(x => "'" + x + "'").join(", ") + "]";
226226
} else {
227-
code += ws+ws+ sm_name + " = OperatableStateMachine(outcomes=['" + sm.getOutcomes().join("', '") + "']";
227+
code += ws+ws+ sm_name + " = OperatableStateMachine(outcomes=[" + sm.getOutcomes().map(x => "'" + x + "'").join(", ") + "]";
228228
}
229229
if (sm.getInputKeys().length > 0) {
230230
code += ", input_keys=['" + sm.getInputKeys().join("', '") + "']";

src/ros/ros.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,12 @@ rospy.spin()
9393

9494
that.getPackagePythonPath = function(package_name, callback) {
9595
var python_path = undefined;
96+
var temp_package_path = undefined;
9697
that.getPackageList((package_cache) => {
9798
for (var i=0; i<package_cache.length; i++) {
9899
if (package_cache[i]['name'] == package_name) {
99100
python_path = package_cache[i]['python_path'];
101+
temp_package_path = package_cache[i]['path'];
100102
break;
101103
}
102104
}
@@ -105,7 +107,7 @@ rospy.spin()
105107
callback(python_path);
106108
});
107109
} else {
108-
var proc = spawn(python, ['-c', `import importlib; print(importlib.import_module('` + package_name + `').__path__[-1])`]);
110+
var proc = spawn(python, ['-c', `import importlib; temp = importlib.import_module('` + package_name + `').__path__; path_index = next((i for i, x in enumerate(temp) if ('`+ temp_package_path +`' in x)), -1); print(temp[path_index])`]);
109111
var path_data = '';
110112
proc.stdout.on('data', data => {
111113
path_data += data;
@@ -143,4 +145,4 @@ rospy.spin()
143145
// });
144146
// }
145147

146-
}) ();
148+
}) ();

0 commit comments

Comments
 (0)