예제 #1
0
    def __init__(self, coroutines, _item, start_time, end_time):
        """
		desc:
			Constructor.

		arguments:
			item:
				desc:	An item object.
				type:	item
		"""

        if not hasattr(_item, u'coroutine'):
            raise osexception(u'%s not supported by coroutines' %
                              _item.item_type)
        self._item = _item
        base_task.__init__(self, coroutines, start_time, end_time)
        self.coroutines.event(u'initialize %s' % _item.coroutine)
    def __init__(self, function_name, python_workspace, start_time, end_time):
        """
		desc:
			Constructor.

		arguments:
			function_name:
				desc:	The name of a Python generator function.
				type:	str
			python_workspace:
				desc:	The python-workspace object.
				type:	python_workspace
		"""

        self.function_name = function_name
        self.python_workspace = python_workspace
        base_task.__init__(self, start_time, end_time)
예제 #3
0
	def __init__(self, coroutines, _item, start_time, end_time):

		"""
		desc:
			Constructor.

		arguments:
			item:
				desc:	An item object.
				type:	item
		"""

		if not hasattr(_item, u'coroutine'):
			raise osexception(
				u'%s not supported by coroutines' % _item.item_type)
		self._item = _item
		base_task.__init__(self, coroutines, start_time, end_time)
		self.coroutines.event(u'initialize %s' % _item.coroutine)
예제 #4
0
	def __init__(self, coroutines, function_name, python_workspace, start_time,
		end_time):

		"""
		desc:
			Constructor.

		arguments:
			function_name:
				desc:	The name of a Python generator function.
				type:	str
			python_workspace:
				desc:	The python-workspace object.
				type:	python_workspace
		"""

		base_task.__init__(self, coroutines, start_time, end_time)
		self.function_name = function_name
		self.python_workspace = python_workspace
예제 #5
0
    def __init__(self, _item, start_time, end_time):
        """
		desc:
			Constructor.

		arguments:
			item:
				desc:	An item object.
				type:	item
		"""

        if not hasattr(_item, u'coroutine'):
            print(u'inject coroutine into %s' % _item)
            try:
                _item.__class__.coroutine = getattr(injections,
                                                    _item.item_type)
            except:
                raise osexception(u'%s not supported by coroutines' %
                                  _item.item_type)
        print(u'coroutine: %s' % _item.coroutine)
        self._item = _item
        base_task.__init__(self, start_time, end_time)