Commits

Ginés Martínez Sánchez  committed 476877c Draft

search_unique_gobj changed to find_unique_gobj

  • Participants
  • Parent commits 4365e9c

Comments (0)

Files changed (2)

File ginsfsm/gaplic.py

 
 .. autoclass:: GAplic
     :members: create_gobj, destroy_gobj,
-        register_unique_gobj, deregister_unique_gobj, search_unique_gobj,
+        register_unique_gobj, deregister_unique_gobj, find_unique_gobj,
         mt_process, mt_subprocess
 
 .. autofunction:: setup_gaplic_thread
             'enqueue_event': self.enqueue_event,
             'register_unique_gobj': self.register_unique_gobj,
             'deregister_unique_gobj': self.deregister_unique_gobj,
-            'search_unique_gobj': self.search_unique_gobj,
+            'find_unique_gobj': self.find_unique_gobj,
             '_increase_inside': self._increase_inside,
             '_decrease_inside': self._decrease_inside,
             '_tab': self._tab,
             return True
         return False
 
-    def search_unique_gobj(self, gobj_name):
-        """ Search a :term:`named-gobj`.
+    def find_unique_gobj(self, gobj_name):
+        """ Find a :term:`named-gobj`.
         """
         named_gobj = self._unique_named_gobjs.get(gobj_name, None)
         return named_gobj

File ginsfsm/gobj.py

     :members: start_up, create_gobj, destroy_gobj,
         send_event, post_event, broadcast_event,
         subscribe_event, delete_subscription, set_owned_event_filter,
-        search_unique_gobj,
+        find_unique_gobj,
         overwrite_parameters, overwrite_few_parameters
 
     .. attribute:: name
     'get_named_gobjs': [None, None, 0, None, ''],
     'register_unique_gobj': [None, None, 0, None, ''],
     'deregister_unique_gobj': [None, None, 0, None, ''],
-    'search_unique_gobj': [None, None, 0, None, ''],
+    'find_unique_gobj': [None, None, 0, None, ''],
     '_increase_inside': [None, None, 0, None, ''],
     '_decrease_inside': [None, None, 0, None, ''],
     '_tab': [None, None, 0, None, ''],
             gconfig = [GOBJ_GCONFIG]
         GConfig.__init__(self, gconfig)
 
+    def __str__(self):
+        return "%s:%s" % (self.__class__.__name__, self.name)
+
     def create_gobj(self, name, gclass, parent, **kw):
         """ Factory function to create gobj's instances.
 
 
         If ``destination`` is a `string`then
         it will be search in the current :term:`gaplic` domain
-        with :meth:`search_unique_gobj` method.
+        with :meth:`find_unique_gobj` method.
         If it is not found a :exc:`DestinationError` exception will be raised.
         """
         if not (isinstance(destination, string_types) or
                 (repr(destination), self.__class__.__name__, self.name))
 
         if isinstance(destination, string_types):
-            named_gobj = self.search_unique_gobj(destination)
+            named_gobj = self.find_unique_gobj(destination)
             if not named_gobj:
                 raise DestinationError(
                     '_resolv_destination() destination %s NOT FOUND in (%s:%s)'
                     (repr(subscriber_gobj), self.__class__.__name__, self.name))
 
             if isinstance(subscriber_gobj, string_types):
-                named_gobj = self.search_unique_gobj(subscriber_gobj)
+                named_gobj = self.find_unique_gobj(subscriber_gobj)
                 if not named_gobj:
                     raise GObjError(
                         'subscribe_event() subscriber NOT FOUND in (%s:%s)'
         """
         return True
 
-    def search_unique_gobj(self, gobj_name):
-        """ Search a :term:`named-gobj`.
+    def find_unique_gobj(self, gobj_name):
+        """ Find a :term:`named-gobj`.
         To be overriden by :term:`gaplic` or similar.
         """
         return None