Tik-76.115 Individual Project: Guinea Pig
$Id: ab_python_interface.html,v 1.4 1996/04/13 15:09:22 kepa Exp $

Testee UI - A/B Test Python interface

This document describes the Python interface of A/B Test. It is used to interface the A/B Test Logic module to A/B Test Testee UI. See the A/B Test User Manual for a general overview. Here's a snapshot of the A/B Test GUI:

[Image]

Using ab_gui class

You can use the gui_client class init('ab') method call to create an ab_gui class GUI instance. See Testee UI Python interfaces for more information.

When you have made an ab_gui class instance ab, you can use the arm() method to put the GUI in idle state. (Grey buttons, useful for clearing the timeout red buttons.)

   ab.arm()
With the playing('A') or playing('B') method calls you can change the colour of the bar on top of A or B button blue.
   ab.playing('A')
With the stopped('A') or stopped('B') method calls you can change the colour of the bar on top of A or B button grey.
   ab.stopped('A')
With the enable(warnTO=5.0, answerTO=10.0) method call you enable the testee to give his/her answer. It also enables the warning timeout, specified in seconds, after which the GUI warns the user that the answering time is running out by changing the bars on top of the buttons yellow. The answer timeout is a timeout after which the user is no longer able to give an answer, and both bars on top of the buttons turn red. If the answer timeout is specified as 0.0, the GUI will wait forever to the testee to give an answer.
   ab.enable(warnTO=5.0, answerTO=10.0)
You can receive the user respose or timeout indication with the get_answer() method. It returns a tuple that contains a list followed by a float. The list will contain as its first item the answer testee gave: A, B or TIMEOUT message if the answering time ran out. The float returned is the system clock time at the time of the answer was given or time ran out (as returned by the python time.time() method).
   answer, timestamp = ab.get_answer()
When the test is over, the GUI is closed with the close() method. You should not access the object after calling this method.
   ab.close()
   ab = None


. Testee UI Python interfaces · Testee UI Architecture · Testee UI Index · Document index · Guinea Pig ·