rtCommon.webServer

Web Server module which provides the web user interface to control and monitor experiments

Module Contents

Classes

Web

Cloud service web-interface that is the front-end to the data processing.

WsBrowserRequestHandler

Command handler for commands that the javascript running in the web browser can call

Functions

procOutputReader(proc, lineQueue)

Read output from runSession process and queue into lineQueue for logging

getCookieSecret(dir)

Used to remember users who are currently logged in.

Attributes

CommonOutputDir

moduleDir

rootDir

logger

rtCommon.webServer.CommonOutputDir = /rtfmriData/
rtCommon.webServer.moduleDir
rtCommon.webServer.rootDir
rtCommon.webServer.logger
class rtCommon.webServer.Web

Cloud service web-interface that is the front-end to the data processing.

app
httpServer
started = False
httpPort = 8888
webDir
htmlDir
ioLoopInst
testMode = False
webDisplayInterface
static start(params, cfg, testMode=False)

Start the web server running. Function does not return.

static addHandlers(handlers)
static stop()

Stop the web server.

static close()
class rtCommon.webServer.WsBrowserRequestHandler(webDisplayInterface, params, cfg)

Command handler for commands that the javascript running in the web browser can call

_addScript(self, name, path, type)

Add the experiment script to be connected to the various run button of the web page. These include ‘mainScript’ for classification processing, ‘initScript’ for session initialization, and ‘finalizeScript’ for any final processing at the end of a session.

on_getDefaultConfig(self)

Return default configuration settings for the project

on_getDataPoints(self)

Return data points that have been plotted

on_getRunStatus(self)

Return run status from the project server

on_clearDataPoints(self)

Clear all plot datapoints

on_runScript(self, name)

Run one of the project scripts in a separate process

on_stop(self)

Stop execution of the currently running project script (only one can run at a time)

on_uploadFiles(self, request)

Upload files from the dataServer to the cloud computer

_wsBrowserCallback(self, client, message)

The main message handler for messages received over web sockets from the web page javascript. It will parse the message and call the corresponding function above to handle the request.

_runSession(self, cfg, pyScript, tag, logType='run')

Run the experimenter provided python script as a separate process. Forward the script’s printed output to the web page’s log message area.

_uploadFilesHandler(self, request)

Handle requests from the web interface to upload files to this computer.

_setError(self, errStr)
rtCommon.webServer.procOutputReader(proc, lineQueue)

Read output from runSession process and queue into lineQueue for logging

rtCommon.webServer.getCookieSecret(dir)

Used to remember users who are currently logged in.