common.services.prompt package

Submodules

common.services.prompt.HtmlAWEprompt module

Module with the web based awe prompt

class common.services.prompt.HtmlAWEprompt.HtmlAWE(args)

Bases: common.services.general.HtmlBase.HtmlBase

class for generating html from the template file AWEprompt.html.tmpl

SessionLifeTime = datetime.timedelta(0, 7200)
allow_anonymous = True
authorize()

test the username and password

checkUserDir()

make a directory for this user (if not exist)

classmethod cleanupSessions()

cleanup old obsolete User Sessions data

classmethod cleanupUserSession(global_data)

remove the user dir

completeCommand(phrase)

user hit tab, use rlcompleter to give back all possible commands

doCommand()

run the user given command

getHtml()

generate html

getUserDir(session_id, username)

return the directory name of the user

initialize()

initialization that must be done after __init__

initialize_global_data()

intialize the global data dict

users_dir = 'awe_prompt_users'
common.services.prompt.HtmlAWEprompt.getcommonstart(seq)

get the common part of all strings in seq

common.services.prompt.HtmlAWEprompt.splitCommand(command)

find the most right command, using the delims in readline return splitted string

common.services.prompt.myInterpreter module

class common.services.prompt.myInterpreter.ThreadedStdOut

Bases: object

Class simulates the write method of stdout and stores the output in a per thread dictionary

flush()

define a dummy flush method

pop_thread_stdout()

pop the latest output of the given thread

write(data)

this write overrules the standard stdout.write

class common.services.prompt.myInterpreter.myInterpreter

Bases: code.InteractiveInterpreter

Extended InteractiveInterpreter class - keeps a history of all commands - uses a threadsafe stdout

STARTUP_COMMANDS = "\nimport os\nprint('')\nprint('')\nprint(' Welcome to the online prompt ! ')\nprint('')\nprint('')\n"
append_history(output)

append output to history

format_output(output)

format the output

initialize()

initialize or re-initialize this instance

runsource(code, show_code=True, show_output=True)

run the given code in the interpretor

setOutput()

pop the output from the current thread

write(data)

write data to output

Module contents