示例#1
0
    def run(self):
        """Runs the experiment."""

        # Save the date and time, and the version of OpenSesame
        self.var.datetime = safe_decode(time.strftime(u'%c'),
                                        enc=self.encoding,
                                        errors=u'ignore')
        self.var.opensesame_version = metadata.__version__
        self.var.opensesame_codename = metadata.codename
        self.running = True
        self.init_random()
        self.init_display()
        self.init_clock()
        self.init_sound()
        self.init_log()
        self.python_workspace.init_globals()
        self.reset_feedback()
        self.init_heartbeat()
        print(u"experiment.run(): experiment started at %s" % time.ctime())

        if self.var.start in self.items:
            item_stack_singleton.clear()
            self.items.execute(self.var.start)
        else:
            raise osexception( \
             "Could not find item '%s', which is the entry point of the experiment" \
             % self.var.start)

        print(u"experiment.run(): experiment finished at %s" % time.ctime())

        self.end()
示例#2
0
	def run(self):

		"""Runs the experiment."""

		# Save the date and time, and the version of OpenSesame
		self.var.datetime = safe_decode(time.strftime(u'%c'), enc=self.encoding,
			errors=u'ignore')
		self.var.opensesame_version = metadata.__version__
		self.var.opensesame_codename = metadata.codename
		self.running = True
		self.init_random()
		self.init_display()
		self.init_clock()
		self.init_sound()
		self.init_log()
		self.python_workspace.init_globals()
		self.reset_feedback()
		self.init_heartbeat()
		print(u"experiment.run(): experiment started at %s" % time.ctime())

		if self.var.start in self.items:
			item_stack_singleton.clear()
			self.items.execute(self.var.start)
		else:
			raise osexception( \
				"Could not find item '%s', which is the entry point of the experiment" \
				% self.var.start)

		print(u"experiment.run(): experiment finished at %s" % time.ctime())

		self.end()