[openrtm-commit:02494] r696 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python: resource/100/Doc/author resource/100/Doc/authorLong resource/100/Doc/full resource/100/Doc/refer resource/100/aist/AIST1 resource/100/aist/AIST2 resource/100/aist/AIST3 resource/100/aist/AIST4 resource/100/base/service1 resource/100/base/service2 resource/100/build/cmake1 resource/100/idltype/type2 resource/100/idltype/type3 resource/100/module/serviceM resource/100/module/serviceM2 src/jp/go/aist/rtm/rtcbuilder/python/manager
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 3月 5日 (日) 00:25:48 JST
Author: ga
Date: 2017-03-05 00:25:47 +0900 (Sun, 05 Mar 2017)
New Revision: 696
Modified:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/author/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/authorLong/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/refer/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST1/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST2/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST3/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST4/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service1/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service2/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/build/cmake1/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type2/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type3/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM2/idlcompile.bat
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonConverter.java
Log:
Modified Python import #3973
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/author/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/author/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/author/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/authorLong/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/authorLong/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/authorLong/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/refer/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/refer/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/refer/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST1/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST1/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST1/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST2/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST2/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST2/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST3/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST3/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST3/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST4/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST4/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST4/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service1/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service1/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service1/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service2/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service2/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/base/service2/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/build/cmake1/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/build/cmake1/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/build/cmake1/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type2/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type2/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type2/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type3/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type3/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/idltype/type3/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM2/idlcompile.bat
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM2/idlcompile.bat 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/module/serviceM2/idlcompile.bat 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,10 +1,2 @@
-echo off
-setlocal
-for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
-if exist %f% do (
- %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
-) else (
- echo "python.exe" can not be found.
- echo Please modify PATH environmental variable for python command.
-)
-endlocal
+ at echo off
+omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" idl/MyService.idl idl/DAQService.idl
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonConverter.java 2017-03-04 14:54:12 UTC (rev 695)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonConverter.java 2017-03-04 15:25:47 UTC (rev 696)
@@ -1,5 +1,6 @@
package jp.go.aist.rtm.rtcbuilder.python.manager;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -336,50 +337,63 @@
}
public String convModuleName(IdlFileParam source) {
- StringBuffer result = new StringBuffer();
+ List<String> addedList = new ArrayList<String>();
+ StringBuilder strWork;
+ StringBuilder result = new StringBuilder();
boolean existGlobal = false;
for(ServiceClassParam target : source.getServiceClassParams() ) {
+ strWork = new StringBuilder();
if(target.getName().contains("::")) {
int index = target.getName().lastIndexOf("::");
- result.append("import ");
- result.append(target.getName().substring(0, index));
- result.append(", ");
- result.append(target.getName().substring(0, index));
- result.append("__POA");
+ strWork.append("import ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append(", ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append("__POA");
} else {
if(!existGlobal) {
- result.append("import ");
- result.append("_GlobalIDL, _GlobalIDL__POA");
+ strWork.append("import ");
+ strWork.append("_GlobalIDL, _GlobalIDL__POA");
existGlobal = true;
}
}
+ //
+ if(addedList.contains(strWork.toString())==false) {
+ result.append(strWork.toString()).append(System.getProperty("line.separator"));
+ addedList.add(strWork.toString());
+ }
}
return result.toString();
}
public String convModuleNameAll(List<IdlFileParam> sourceList) {
- StringBuffer result = new StringBuffer();
+ List<String> addedList = new ArrayList<String>();
+ StringBuilder strWork;
+ StringBuilder result = new StringBuilder();
boolean existGlobal = false;
for(IdlFileParam source : sourceList) {
-
for(ServiceClassParam target : source.getServiceClassParams() ) {
+ strWork = new StringBuilder();
if(target.getName().contains("::")) {
int index = target.getName().lastIndexOf("::");
- result.append("import ");
- result.append(target.getName().substring(0, index));
- result.append(", ");
- result.append(target.getName().substring(0, index));
- result.append("__POA");
+ strWork.append("import ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append(", ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append("__POA");
} else {
if(!existGlobal) {
- result.append("import ");
- result.append("_GlobalIDL, _GlobalIDL__POA");
+ strWork.append("import ");
+ strWork.append("_GlobalIDL, _GlobalIDL__POA");
existGlobal = true;
}
}
- result.append("\r\n");
+ if(addedList.contains(strWork.toString())==false) {
+ result.append(strWork.toString()).append(System.getProperty("line.separator"));
+ addedList.add(strWork.toString());
+ }
}
}
return result.toString();
openrtm-commit メーリングリストの案内