[openrtm-commit:02236] r781 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 1月 17日 (火) 16:51:01 JST


Author: miyamoto
Date: 2017-01-17 16:51:01 +0900 (Tue, 17 Jan 2017)
New Revision: 781

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
Log:
[compat,bugfix,->RELENG_1_2] fixed bug.

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-01-17 02:08:04 UTC (rev 780)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-01-17 07:51:01 UTC (rev 781)
@@ -651,19 +651,18 @@
   # @endif
   def registerFactory(self, profile, new_func, delete_func):
     self._rtcout.RTC_TRACE("Manager.registerFactory(%s)", profile.getProperty("type_name"))
-    try:
-      policy_name = self._config.getProperty("manager.components.naming_policy")
+    #try:
+    policy_name = self._config.getProperty("manager.components.naming_policy","process_unique")
       
-      if not policy_name:
-        policy_name = "process_unique"
-      policy = OpenRTM_aist.NumberingPolicyFactory.instance().createObject(policy_name)
       
-      factory = OpenRTM_aist.FactoryPython(profile, new_func, delete_func, policy)
-      self._factory.registerObject(factory)
-      return True
-    except:
-      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
-      return False
+    policy = OpenRTM_aist.NumberingPolicyFactory.instance().createObject(policy_name)
+      
+    factory = OpenRTM_aist.FactoryPython(profile, new_func, delete_func, policy)
+    return self._factory.registerObject(factory)
+    #  return True
+    #except:
+    #  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
+    #  return False
 
     
 
@@ -716,13 +715,15 @@
   # @endif
   def registerECFactory(self, name, new_func, delete_func):
     self._rtcout.RTC_TRACE("Manager.registerECFactory(%s)", name)
-    try:
-      OpenRTM_aist.ExecutionContextFactory.instance().addFactory(name,
+    #try:
+    ret = OpenRTM_aist.ExecutionContextFactory.instance().addFactory(name,
                     new_func,
                     delete_func)
+    if ret == OpenRTM_aist.Factory.FACTORY_OK:
       return True
-    except:
-      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
+    #except:
+    #  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
+    else:
       return False
 
 
@@ -2408,7 +2409,7 @@
       # Caught StopIteration exception.
       return str_
 
-    return str_
+    #return str_
 
 
   ##



More information about the openrtm-commit mailing list