[openrtm-commit:03380] r1039 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 11月 21日 (水) 14:05:36 JST


Author: miyamoto
Date: 2018-11-21 14:05:36 +0900 (Wed, 21 Nov 2018)
New Revision: 1039

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py
Log:
[compat, bugfix]

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2018-11-21 05:05:10 UTC (rev 1038)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2018-11-21 05:05:36 UTC (rev 1039)
@@ -3369,12 +3369,16 @@
     def __init__(self, name=None, factory=None, prop=None):
       if prop:
         self._name = prop.getProperty("instance_name")
-      if factory:
+      elif factory:
         self._name = factory.getInstanceName()
       elif name:
         self._name = name
+      else:
+        self._name = ""
 
     def __call__(self, comp):
+      if not self._name:
+        return False
       return self._name == comp.getInstanceName()
 
 

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py	2018-11-21 05:05:10 UTC (rev 1038)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py	2018-11-21 05:05:36 UTC (rev 1039)
@@ -797,8 +797,8 @@
     dirs = glob.glob(os.path.join(dir,"*"))
     for d in dirs:
         if os.path.isdir(d):
-            getFileList(d, ext, filelist)
+          getFileList(d, ext, filelist)
     files = glob.glob(os.path.join(dir,"*."+ext))
     for f in files:
-        if os.path.isfile(d):
-            filelist.append(f)
\ No newline at end of file
+        if os.path.isfile(f):
+          filelist.append(f)
\ No newline at end of file



openrtm-commit メーリングリストの案内