[openrtm-commit:02148] r761 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 11月 29日 (火) 13:43:33 JST


Author: miyamoto
Date: 2016-11-29 13:43:33 +0900 (Tue, 29 Nov 2016)
New Revision: 761

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/CorbaNaming.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortCorbaCdrConsumer.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/PortProfileHelper.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/PublisherNew.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py
Log:
[compat,bugfix,->RELENG_1_2] fixed bug.

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/CorbaNaming.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/CorbaNaming.py	2016-11-28 08:27:05 UTC (rev 760)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/CorbaNaming.py	2016-11-29 04:43:33 UTC (rev 761)
@@ -161,9 +161,9 @@
       self.__print_exception()
       return False
 
-    return False
 
 
+
   ##
   # @if jp
   #
@@ -336,8 +336,8 @@
   #
   # @endif
   def rebind(self, name_list, obj, force=True):
-    if force is None:
-      force = True
+    #if force is None:
+    #  force = True
       
     try:
       self._rootContext.rebind(name_list, obj)
@@ -666,8 +666,8 @@
   #
   # @endif
   def bindNewContext(self, name, force=True):
-    if force is None:
-      force = True
+    #if force is None:
+    #  force = True
       
     if isinstance(name, basestring):
       name_ = self.toName(name)
@@ -962,9 +962,9 @@
     except CosNaming.NamingContext.AlreadyBound:
       obj = context.resolve(name_list)
       return obj
-    return CORBA.Object._nil
 
 
+
   ##
   # @if jp
   #

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortCorbaCdrConsumer.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortCorbaCdrConsumer.py	2016-11-28 08:27:05 UTC (rev 760)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortCorbaCdrConsumer.py	2016-11-29 04:43:33 UTC (rev 761)
@@ -160,8 +160,8 @@
       self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
       return self.CONNECTION_LOST
         
-    return self.UNKNOWN_ERROR
 
+
   ##
   # @if jp
   # @brief InterfaceProfile情報を公開する
@@ -414,7 +414,9 @@
     if not obj:
       return False
 
-    if not self._ptr(True)._is_equivalent(obj):
+    obj_ptr = self._ptr(True)
+    
+    if obj_ptr is None or not obj_ptr._is_equivalent(obj):
       return False
     
     self.releaseObject()

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py	2016-11-28 08:27:05 UTC (rev 760)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py	2016-11-29 04:43:33 UTC (rev 761)
@@ -186,7 +186,7 @@
     except:
       self._rtcout.RTC_TRACE(OpenRTM_aist.Logger.print_exception())
       return OpenRTM.UNKNOWN_ERROR
-    return OpenRTM.UNKNOWN_ERROR
+
     
 
 

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py	2016-11-28 08:27:05 UTC (rev 760)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py	2016-11-29 04:43:33 UTC (rev 761)
@@ -196,10 +196,9 @@
       self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
       return self.CONNECTION_LOST
 
-    self._rtcout.RTC_ERROR("get(): Never comes here.")
-    return self.UNKNOWN_ERROR
 
 
+
   
 
 

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/PortProfileHelper.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/PortProfileHelper.py	2016-11-28 08:27:05 UTC (rev 760)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/PortProfileHelper.py	2016-11-29 04:43:33 UTC (rev 761)
@@ -422,9 +422,9 @@
     else:
       return self._connProfiles[index]
 
-    return None
 
 
+
   ##
   # @if jp
   #

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/PublisherNew.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/PublisherNew.py	2016-11-28 08:27:05 UTC (rev 760)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/PublisherNew.py	2016-11-29 04:43:33 UTC (rev 761)
@@ -635,8 +635,8 @@
       self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
       return self.CONNECTION_LOST
 
-    return self.PORT_ERROR
 
+
   ##
   # @brief push "fifo" policy
   #
@@ -663,8 +663,8 @@
       self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
       return self.CONNECTION_LOST
 
-    return self.PORT_ERROR
 
+
   ##
   # @brief push "skip" policy
   #
@@ -711,8 +711,8 @@
       self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
       return self.CONNECTION_LOST
 
-    return self.PORT_ERROR
 
+
   ##
   # @brief push "new" policy
   #
@@ -741,8 +741,8 @@
       self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
       return self.CONNECTION_LOST
 
-    return self.PORT_ERROR
 
+
   ##
   # @if jp
   # @brief BufferStatus から DataPortStatus への変換

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py	2016-11-28 08:27:05 UTC (rev 760)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/StringUtil.py	2016-11-29 04:43:33 UTC (rev 761)
@@ -556,20 +556,25 @@
   if not _str:
     return False
 
-  if type(_type[0]) == int:
-    _type[0] = int(_str)
-    return True
-  elif type(_type[0]) == long:
-    _type[0] = long(_str)
-    return True
-  elif type(_type[0]) == float:
-    _type[0] = float(_str)
-    return True
-  elif type(_type[0]) == list:
-    return _stringToList(_type, _str)
-  elif type(_type[0]) == str:
-    _type[0] = str(_str)
-    return True
+  try:
+    if type(_type[0]) == int:
+      _type[0] = int(_str)
+      return True
+    elif type(_type[0]) == long:
+      _type[0] = long(_str)
+      return True
+    elif type(_type[0]) == float:
+      _type[0] = float(_str)
+      return True
+    elif type(_type[0]) == list:
+      return _stringToList(_type, _str)
+    elif type(_type[0]) == str:
+      _type[0] = str(_str)
+      return True
+  except ValueError:
+    return False
+  except:
+    return False
   
   return False
 



More information about the openrtm-commit mailing list