Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias Assign NameStore Str Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore BinOpAdd BinOpMult Str Num Call AttributeLoad Str attr ListComp Call NameLoad NameLoad comprehension NameStore Call NameLoad Num Num Assign NameStore Str Assign NameStore ListLoad Str BinOpAdd BinOpAdd Str NameLoad Str BinOpAdd BinOpAdd Str NameLoad Str ClassDef bases body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad Lambda arguments args NameParam defaults AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore NameLoad body If CompareIn Call NameLoad NameLoad TupleLoad Num Num body Expr Call AttributeLoad NameLoad attr NameLoad Continue Assert CompareEq Call NameLoad NameLoad Num Str Assign TupleStore NameStore NameStore NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareEq NameLoad Str body Assign NameStore Str If CompareEq NameLoad Str body Assign NameStore Str Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier Assert UnaryOpNot AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num Assert Call AttributeLoad NameLoad attr Str NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str Assert CompareIn AttributeLoad NameLoad attr TupleLoad Str Str If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str If CompareGtE Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Num Assign NameStore BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr BinOpPow Num Num Call AttributeLoad NameLoad attr BinOpPow Num Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str If CompareEq AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assert AttributeLoad NameLoad attr TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Pass Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryFinally body Expr Call AttributeLoad NameLoad attr Return Call NameLoad finalbody Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults vararg body If UnaryOpNot AttributeLoad NameLoad attr body Return TryExcept body Expr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareGt NameLoad NameLoad body Assign NameStore NameLoad If CompareGt NameLoad NameLoad body Assign NameStore NameLoad Assign AttributeStore NameLoad attr TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam TupleStore NameStore NameStore NameParam defaults body Expr Str If CompareNotEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Dict Assign NameStore ListLoad AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Num TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Assign NameStore AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Num Assign NameStore AttributeLoad NameLoad attr Expr Call NameLoad Str Assign AttributeStore NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr orelse Assign NameStore NameStore NameLoad Assign NameStore Dict Assign NameStore Num For NameStore Call AttributeLoad NameLoad attr body AugAssignAdd NameStore Num Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad NameLoad body Assign NameStore BinOpAdd NameLoad TupleLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd Call AttributeLoad NameLoad attr NameLoad ListLoad ListLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body If CompareIn NameLoad NameLoad body Assign NameStore NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index Num Expr Call NameLoad BinOpMod Str NameLoad Continue Assign NameStore Num For TupleStore NameStore NameStore NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore TupleLoad Str Str NameLoad orelse Assign TupleStore NameStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If BoolOpAnd CompareEq NameLoad NameLoad CompareLtE NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Call NameLoad NameLoad If CompareGt BinOpAdd NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad BinOpSub NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad AugAssignAdd NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd Call AttributeLoad Str attr NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr orelse Expr Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad BinOpAdd AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assert CompareIn AttributeLoad NameLoad attr TupleLoad Str Str If CompareEq AttributeLoad NameLoad attr Str body TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListLoad Assign NameStore NameLoad TryExcept body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr ListLoad ListLoad Num handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body If NameLoad body Return TupleLoad ListLoad ListLoad Return ListLoad Raise If UnaryOpNot NameLoad body If NameLoad body Return TupleLoad ListLoad ListLoad Return ListLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Num BinOpAdd AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num For NameStore SubscriptLoad NameLoad Slice Num body If Call AttributeLoad NameLoad attr Str body Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Str If NameLoad body Return TupleLoad NameLoad ListLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareGtE NameLoad Num body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Num Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad NameLoad Return BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd NameLoad NameLoad SubscriptLoad NameLoad Slice NameLoad Str NameLoad NameLoad SubscriptLoad NameLoad Slice NameLoad NameLoad Str NameLoad NameLoad SubscriptLoad NameLoad Slice NameLoad Str orelse Return BinOpAdd BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args defaults body Expr Str Global identifier If UnaryOpNot Call NameLoad body Return NameLoad If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd Str Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad If CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Str Str body Return NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr Str body Return NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str If CompareGt Call NameLoad NameLoad Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return NameLoad For NameStore NameLoad body If CompareNotIn NameLoad Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return NameLoad If CompareEq Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore BinOpAdd Str Call AttributeLoad NameLoad attr NameLoad While NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return NameLoad decorator_list ClassDef bases body Assign NameStore Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore Num decorator_list Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str NameLoad Num body Expr Str Global identifier Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr Str attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str For NameStore Call NameLoad Num Num body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass Assign AttributeStore NameLoad attr Call NameLoad Str Str Assign AttributeStore NameLoad attr Call NameLoad Str Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list
N/A N/A 
Urwid web application display module
 N/A os N/A sys N/A signal N/A random N/A select N/A socket N/A glob urwid util N/A _js_code 
// Urwid web (CGI/Asynchronous Javascript) display module
//    Copyright (C) 2004-2005  Ian Ward
//
//    This library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    This library is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with this library; if not, write to the Free Software
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// Urwid web site: http://excess.org/urwid/

colours = new Object();
colours = {
    '0': "black",
    '1': "#c00000",
    '2': "green",
    '3': "#804000",
    '4': "#0000c0",
    '5': "#c000c0",
    '6': "teal",
    '7': "silver",
    '8': "gray",
    '9': "#ff6060",
    'A': "lime",
    'B': "yellow",
    'C': "#8080ff",
    'D': "#ff40ff",
    'E': "aqua",
    'F': "white"
};

keycodes = new Object();
keycodes = {
    8: "backspace", 9: "tab", 13: "enter", 27: "esc",
    33: "page up", 34: "page down", 35: "end", 36: "home",
    37: "left", 38: "up", 39: "right", 40: "down",
    45: "insert", 46: "delete",
    112: "f1", 113: "f2", 114: "f3", 115: "f4", 
    116: "f5", 117: "f6", 118: "f7", 119: "f8", 
    120: "f9", 121: "f10", 122: "f11", 123: "f12"
    };

var conn = null;
var char_width = null;
var char_height = null;
var screen_x = null;
var screen_y = null;

var urwid_id = null;
var send_conn = null;
var send_queue_max = 32;
var send_queue = new Array(send_queue_max);
var send_queue_in = 0;
var send_queue_out = 0;

var check_font_delay = 1000;
var send_more_delay = 100;
var poll_again_delay = 500;

var document_location = null;

var update_method = "multipart";

var sending = false;
var lastkeydown = null;

function setup_connection() {
    if (window.XMLHttpRequest) {
        conn = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        conn = new ActiveXObject("Microsoft.XMLHTTP");
    }

    if (conn == null) {
        set_status("Connection Failed");
        alert( "Can't figure out how to send request." );
        return;
    }
    try{
        conn.multipart = true;
    }catch(e){
        update_method = "polling";
    }
    conn.onreadystatechange = handle_recv;
    conn.open("POST", document_location, true);
    conn.setRequestHeader("X-Urwid-Method",update_method);
    conn.setRequestHeader("Content-type","text/plain");
    conn.send("window resize " +screen_x+" "+screen_y+"\n");
}

function do_poll() {
    if (urwid_id == null){
        alert("that's unpossible!");
        return;
    }
    if (window.XMLHttpRequest) {
        conn = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        conn = new ActiveXObject("Microsoft.XMLHTTP");
    }
    conn.onreadystatechange = handle_recv;
    conn.open("POST", document_location, true);
    conn.setRequestHeader("X-Urwid-Method","polling");
    conn.setRequestHeader("X-Urwid-ID",urwid_id);
    conn.setRequestHeader("Content-type","text/plain");
    conn.send("eh?");
}

function handle_recv() {
    if( ! conn ){ return;}
    if( conn.readyState != 4) {
        return;
    }
    if( conn.status == 404 && urwid_id != null) {
        set_status("Connection Closed");
        return;
    }
    if( conn.status == 403 && update_method == "polling" ) {
        set_status("Server Refused Connection");
        alert("This server does not allow polling clients.\n\n" +
            "Please use a web browser with multipart support " +
            "such as Mozilla Firefox");
        return;
    }
    if( conn.status == 503 ) {
        set_status("Connection Failed");
        alert("The server has reached its maximum number of "+
            "connections.\n\nPlease try again later.");
        return;
    }
    if( conn.status != 200) {
        set_status("Connection Failed");
        alert("Error from server: "+conn.statusText);
        return;
    }
    if( urwid_id == null ){
        urwid_id = conn.getResponseHeader("X-Urwid-ID");
        if( send_queue_in != send_queue_out ){
            // keys waiting
            do_send(); 
        }
        if(update_method=="polling"){
            set_status("Polling");
        }else if(update_method=="multipart"){
            set_status("Connected");
        }
    
    }
    
    if( conn.responseText == "" ){
        if(update_method=="polling"){
            poll_again();
        }
        return; // keepalive
    }
    if( conn.responseText == "Z" ){
        set_status("Connection Closed");
        update_method = null;
        return;
    }
    
    var text = document.getElementById('text');
    
    var last_screen = Array(text.childNodes.length);
    for( var i=0; i<text.childNodes.length; i++ ){
        last_screen[i] = text.childNodes[i];
    }
    
    var frags = conn.responseText.split("\n");
    var ln = document.createElement('span');
    var k = 0;
    for( var i=0; i<frags.length; i++ ){
        var f = frags[i];
        if( f == "" ){
            var br = document.getElementById('br').cloneNode(true);
            ln.appendChild( br );
            if( text.childNodes.length > k ){
                text.replaceChild(ln, text.childNodes[k]);
            }else{
                text.appendChild(ln);
            }
            k = k+1;
            ln = document.createElement('span');
        }else if( f.charAt(0) == "<" ){
            line_number = parseInt(f.substr(1));
            if( line_number == k ){
                k = k +1;
                continue;
            }
            var clone = last_screen[line_number].cloneNode(true);
            if( text.childNodes.length > k ){
                text.replaceChild(clone, text.childNodes[k]);
            }else{
                text.appendChild(clone);
            }
            k = k+1;
        }else{
            var span=make_span(f.substr(2),f.charAt(0),f.charAt(1));
            ln.appendChild( span );
        }
    }
    for( var i=k; i < text.childNodes.length; i++ ){
        text.removeChild(last_screen[i]);
    }
    
    if(update_method=="polling"){
        poll_again();
    }
}

function poll_again(){
    if(conn.status == 200){
        setTimeout("do_poll();",poll_again_delay);
    }
}


function load_web_display(){
    if( document.documentURI ){
        document_location = document.documentURI;
    }else{
        document_location = document.location;
    }
    
    document.onkeypress = body_keypress;
    document.onkeydown = body_keydown;
    document.onresize = body_resize;
    
    body_resize();
    send_queue_out = send_queue_in; // don't queue the first resize

    set_status("Connecting");
    setup_connection();
    
    setTimeout("check_fontsize();",check_font_delay);
}

function set_status( status ){
    var s = document.getElementById('status');
    var t = document.createTextNode(status);
    s.replaceChild(t, s.firstChild);
}

function make_span(s, fg, bg){
    d = document.createElement('span');
    d.style.backgroundColor = colours[bg];
    d.style.color = colours[fg];
    d.appendChild(document.createTextNode(s));
    
    return d;
}

function body_keydown(e){
    if (conn == null){
        return;
    }
    if (!e) var e = window.event;
    if (e.keyCode) code = e.keyCode;
    else if (e.which) code = e.which;

    var mod = "";
    var key;

    if( e.ctrlKey ){ mod = "ctrl " + mod; }
    if( e.altKey || e.metaKey ){ mod = "meta " + mod; }
    if( e.shiftKey && e.charCode == 0 ){ mod = "shift " + mod; }

    key = keycodes[code];
    
    if( key != undefined ){
        lastkeydown = key;
        send_key( mod + key );
        stop_key_event(e);
        return false;
    }
}

function body_keypress(e){
    if (conn == null){
        return;
    }

    if (!e) var e = window.event;
    if (e.keyCode) code = e.keyCode;
    else if (e.which) code = e.which;

    var mod = "";
    var key;

    if( e.ctrlKey ){ mod = "ctrl " + mod; }
    if( e.altKey || e.metaKey ){ mod = "meta " + mod; }
    if( e.shiftKey && e.charCode == 0 ){ mod = "shift " + mod; }
    
    if( e.charCode != null && e.charCode != 0 ){
        key = String.fromCharCode(e.charCode);
    }else if( e.charCode == null ){
        key = String.fromCharCode(code);
    }else{
        key = keycodes[code];
        if( key == undefined || lastkeydown == key ){
            lastkeydown = null;
            stop_key_event(e);
            return false;
        }
    }
    
    send_key( mod + key );
    stop_key_event(e);
    return false;
}

function stop_key_event(e){
    e.cancelBubble = true;
    if( e.stopPropagation ){
        e.stopPropagation();
    }
    if( e.preventDefault  ){
        e.preventDefault();
    }
}

function send_key( key ){
    if( (send_queue_in+1)%send_queue_max == send_queue_out ){
        // buffer overrun
        return;
    }
    send_queue[send_queue_in] = key;
    send_queue_in = (send_queue_in+1)%send_queue_max;

    if( urwid_id != null ){
        if (send_conn == undefined || send_conn.ready_state != 4 ){
            send_more();
            return;
        }
        do_send();
    }
}

function do_send() {
    if( ! urwid_id ){ return; }
    if( ! update_method ){ return; } // connection closed
    if( send_queue_in == send_queue_out ){ return; }
    if( sending ){ 
        //var queue_delta = send_queue_in - send_queue_out;
        //if( queue_delta < 0 ){ queue_delta += send_queue_max; }
        //set_status("Sending (queued "+queue_delta+")"); 
        return; 
    }
    try{
        sending = true;
        //set_status("starting send");
        if( send_conn == null ){
            if (window.XMLHttpRequest) {
                send_conn = new XMLHttpRequest();
            } else if (window.ActiveXObject) {
                send_conn = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }else if( send_conn.status != 200) {
            alert("Error from server: "+send_conn.statusText);
            return;
        }else if(send_conn.readyState != 4 ){
            alert("not ready on send connection");
            return;
        }
    } catch(e) {
        alert(e);
        sending = false;
        return;
    }
    send_conn.open("POST", document_location, true);
    send_conn.onreadystatechange = send_handle_recv;
    send_conn.setRequestHeader("Content-type","text/plain");
    send_conn.setRequestHeader("X-Urwid-ID",urwid_id);
    var tmp_send_queue_in = send_queue_in;
    var out = null;
    if( send_queue_out > tmp_send_queue_in ){
        out = send_queue.slice(send_queue_out).join("\n")
        if( tmp_send_queue_in > 0 ){
            out += "\n"  + send_queue.slice(0,tmp_send_queue_in).join("\n");
        }
    }else{
        out = send_queue.slice(send_queue_out,
             tmp_send_queue_in).join("\n");
    }
    send_queue_out = tmp_send_queue_in;
    //set_status("Sending");
    send_conn.send( out +"\n" );
}

function send_handle_recv() {
    if( send_conn.readyState != 4) {
        return;
    }
    if( send_conn.status == 404) {
        set_status("Connection Closed");
        update_method = null;
        return;
    }
    if( send_conn.status != 200) {
        alert("Error from server: "+send_conn.statusText);
        return;
    }
    
    sending = false;
    
    if( send_queue_out != send_queue_in ){
        send_more();
    }
}

function send_more(){
    setTimeout("do_send();",send_more_delay);
}

function check_fontsize(){
    body_resize()
    setTimeout("check_fontsize();",check_font_delay);
}

function body_resize(){
    var t = document.getElementById('testchar');
    var t2 = document.getElementById('testchar2');
    var text = document.getElementById('text');

    var window_width;
    var window_height;
    if (window.innerHeight) {
        window_width = window.innerWidth;
        window_height = window.innerHeight;
    }else{
        window_width = document.documentElement.clientWidth;
        window_height = document.documentElement.clientHeight;
        //var z = "CI:"; for(var i in bod){z = z + " " + i;} alert(z);
    }

    char_width = t.offsetLeft / 44;
    var avail_width = window_width-18;
    var avail_width_mod = avail_width % char_width;
    var x_size = (avail_width - avail_width_mod)/char_width;
    
    char_height = t2.offsetTop - t.offsetTop;
    var avail_height = window_height-text.offsetTop-10;
    var avail_height_mod = avail_height % char_height;
    var y_size = (avail_height - avail_height_mod)/char_height;
    
    text.style.width = x_size*char_width+"px";
    text.style.height = y_size*char_height+"px";

    if( screen_x != x_size || screen_y != y_size ){
        send_key("window resize "+x_size+" "+y_size);
    }
    screen_x = x_size;
    screen_y = y_size;
}

 N/A ALARM_DELAY 60 N/A POLL_CONNECT 3 N/A MAX_COLS 200 N/A MAX_ROWS 100 N/A MAX_READ 4096 N/A BUF_SZ 16384 N/A _code_colours N/A black dark red dark green brown dark blue dark magenta dark cyan light gray dark gray light red light green yellow light blue light magenta light cyan white 0 1 2 3 4 5 6 7 8 9 A B C D E F N/A _trans_table N/A N/A ? 32 N/A N/A join N/A N/A chr x N/A x N/A range 32 256 N/A _css_style 
body {    margin: 8px 8px 8px 8px; border: 0; 
    color: black; background-color: silver;
    font-family: fixed; overflow: hidden; }

form { margin: 0 0 8px 0; }

#text { position: relative;
    background-color: silver;
    width: 100%; height: 100%;
    margin: 3px 0 0 0; border: 1px solid #999; }

#page { position: relative;  width: 100%;height: 100%;}
 N/A _html_page N/A <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Urwid Web Display -  N/A N/A </title>
<style type="text/css">
 _css_style 
</style>
</head>
<body id="body" onload="load_web_display()">
<div style="position:absolute; visibility:hidden;">
<br id="br"\> 
<pre>The quick brown fox jumps over the lazy dog.<span id="testchar">X</span>
<span id="testchar2">Y</span></pre>
</div>
Urwid Web Display - <b> N/A N/A </b> -
Status: <span id="status">Set up</span>
<script type="text/javascript">
//<![CDATA[
 _js_code 
//]]>
</script>
<pre id="text"></pre>
</body>
</html>
 Screen N/A N/A __init__ N/A N/A self N/A N/A N/A N/A self palette N/A N/A N/A self has_color True N/A N/A self _started False N/A N/A started N/A property N/A N/A N/A self N/A N/A self _started register_palette N/A N/A self l N/A N/A N/A Register a list of palette entries.

        l -- list of (name, foreground, background) or
             (name, same_as_other_name) palette entries.

        calls self.register_palette_entry for each item in l
         N/A item l N/A N/A N/A N/A len item N/A 3 4 N/A N/A N/A N/A self register_palette_entry item N/A N/A N/A N/A len item 2 Invalid register_palette usage N/A N/A name like_name item N/A N/A N/A N/A N/A self palette has_key like_name N/A N/A N/A Exception N/A palette entry '%s' doesn't exist like_name N/A N/A N/A self palette N/A name N/A N/A self palette N/A like_name N/A register_palette_entry N/A N/A self name foreground background mono N/A None N/A N/A Register a single palette entry.

        name -- new entry/attribute name
        foreground -- foreground colour
        background -- background colour
        mono -- monochrome terminal attribute

        See curses_display.register_palette_entry for more info.
         N/A N/A foreground default N/A N/A foreground black N/A N/A background default N/A N/A background light gray N/A N/A N/A self palette N/A name N/A foreground background mono N/A set_mouse_tracking N/A N/A self enable N/A True N/A N/A Not yet implemented N/A N/A tty_signal_keys N/A N/A self N/A args vargs N/A N/A Do nothing. N/A N/A start N/A N/A self N/A N/A N/A     
        This function reads the initial screen size, generates a
        unique id and handles cleanup when fn exits.
        
        web_display.set_preferences(..) must be called before calling
        this function for the preferences to take effect
         N/A _prefs N/A N/A N/A self _started N/A client_init N/A N/A N/A sys stdin read 50 N/A N/A N/A client_init startswith window resize  client_init N/A N/A ignore1 ignore2 x y N/A N/A client_init split 3 N/A x N/A int x N/A y N/A int y N/A N/A N/A self _set_screen_size x y N/A N/A self last_screen N/A N/A N/A self last_screen_width 0 N/A N/A self update_method N/A N/A os environ N/A HTTP_X_URWID_METHOD N/A N/A N/A self update_method N/A multipart polling N/A N/A N/A N/A self update_method polling N/A N/A _prefs allow_polling N/A N/A N/A N/A N/A sys stdout write Status: 403 Forbidden

 N/A N/A N/A sys exit 0 N/A clients N/A N/A glob glob N/A N/A N/A os path join N/A _prefs pipe_dir urwid*.in N/A N/A N/A len clients N/A _prefs max_clients N/A N/A N/A N/A N/A sys stdout write Status: 503 Sever Busy

 N/A N/A N/A sys exit 0 N/A urwid_id N/A %09d%09d N/A N/A N/A random randrange N/A 10 9 N/A N/A random randrange N/A 10 9 N/A N/A self pipe_name N/A N/A N/A os path join N/A _prefs pipe_dir N/A urwid urwid_id N/A N/A N/A os mkfifo N/A N/A self pipe_name .in 384 N/A N/A N/A signal signal N/A signal SIGTERM N/A self _cleanup_pipe N/A N/A self input_fd N/A N/A os open N/A N/A self pipe_name .in N/A N/A os O_NONBLOCK N/A os O_RDONLY N/A N/A self input_tail N/A N/A self content_head N/A N/A Content-type: multipart/x-mixed-replace;boundary=ZZ
X-Urwid-ID:  urwid_id 


--ZZ
 N/A N/A N/A self update_method polling N/A N/A N/A self content_head N/A N/A Content-type: text/plain
X-Urwid-ID:  urwid_id N/A N/A N/A signal signal N/A signal SIGALRM N/A self _handle_alarm N/A N/A N/A signal alarm ALARM_DELAY N/A N/A self _started True N/A stop N/A N/A self N/A N/A N/A 
        Restore settings and clean up.  
         N/A N/A self _started N/A N/A N/A N/A N/A self _close_connection N/A N/A N/A Exception N/A N/A N/A N/A N/A signal signal N/A signal SIGTERM N/A signal SIG_DFL N/A N/A N/A self _cleanup_pipe N/A N/A self _started False N/A set_input_timeouts N/A N/A self N/A args N/A N/A N/A run_wrapper N/A N/A self fn N/A N/A N/A 
        Run the application main loop, calling start() first
        and stop() on exit.
         N/A N/A N/A N/A N/A self start N/A N/A fn N/A N/A N/A N/A self stop N/A _close_connection N/A N/A self N/A N/A N/A N/A N/A self update_method polling child N/A N/A N/A N/A N/A self server_socket settimeout 0 N/A N/A sock addr N/A N/A N/A self server_socket accept N/A N/A N/A sock sendall Z N/A N/A N/A sock close N/A N/A N/A self update_method multipart N/A N/A N/A N/A N/A sys stdout write 
Z
--ZZ--
 N/A N/A N/A N/A sys stdout flush N/A _cleanup_pipe N/A N/A self N/A args N/A N/A N/A N/A self pipe_name N/A N/A N/A N/A N/A N/A N/A os remove N/A N/A self pipe_name .in N/A N/A N/A os remove N/A N/A self pipe_name .update N/A N/A N/A Exception N/A N/A N/A _set_screen_size N/A N/A self cols rows N/A N/A N/A Set the screen size (within max size). N/A N/A cols MAX_COLS N/A N/A cols MAX_COLS N/A N/A rows MAX_ROWS N/A N/A rows MAX_ROWS N/A N/A self screen_size N/A cols rows N/A draw_screen N/A N/A self N/A cols rows r N/A N/A N/A Send a screen update to the client. N/A N/A cols N/A self last_screen_width N/A N/A N/A self last_screen N/A N/A sendq N/A N/A self content_head N/A N/A N/A self update_method polling N/A N/A send N/A sendq append N/A N/A N/A N/A self update_method polling child N/A N/A N/A N/A signal alarm 0 N/A N/A N/A N/A s addr N/A N/A N/A self server_socket accept N/A N/A N/A N/A socket timeout N/A N/A N/A N/A sys exit 0 N/A send N/A s sendall N/A N/A N/A N/A signal alarm 0 N/A send N/A sendq append N/A N/A send N/A N/A self content_head N/A N/A N/A N/A r rows rows N/A N/A N/A r cursor None N/A N/A N/A cx cy N/A r cursor N/A N/A cx cy None N/A new_screen N/A N/A y -1 N/A row N/A N/A r content N/A N/A y 1 N/A row N/A list row N/A l N/A N/A sig N/A tuple row N/A N/A y cy N/A N/A sig N/A sig N/A cx N/A N/A new_screen N/A sig N/A N/A N/A new_screen get sig N/A N/A y N/A old_line_numbers N/A N/A N/A self last_screen get sig None N/A N/A old_line_numbers None N/A N/A N/A y old_line_numbers N/A N/A old_line y N/A N/A old_line N/A old_line_numbers N/A 0 N/A N/A send N/A <%d
 old_line N/A N/A col 0 N/A N/A a cs run row N/A N/A run N/A N/A run translate _trans_table N/A N/A a None N/A N/A N/A fg bg mono N/A black light gray None N/A N/A N/A fg bg mono N/A N/A self palette N/A a N/A N/A N/A y cy N/A col cx N/A N/A run_width N/A N/A util calc_width run 0 N/A len run N/A N/A N/A col run_width cx N/A N/A N/A N/A l append N/A code_span run fg bg N/A cx col N/A N/A N/A N/A l append N/A code_span run fg bg N/A col run_width N/A N/A N/A N/A l append N/A code_span run fg bg N/A N/A send N/A N/A N/A join l N/A N/A self last_screen new_screen N/A N/A self last_screen_width cols N/A N/A N/A self update_method polling N/A N/A N/A N/A N/A sys stdout write N/A N/A join sendq N/A N/A N/A N/A sys stdout flush N/A N/A N/A N/A sys stdout close N/A N/A N/A self _fork_child N/A N/A N/A N/A self update_method polling child N/A N/A N/A N/A s close N/A N/A N/A send 
--ZZ
 N/A N/A N/A N/A sys stdout write N/A N/A join sendq N/A N/A N/A N/A sys stdout flush N/A N/A N/A signal alarm ALARM_DELAY N/A clear N/A N/A self N/A N/A N/A 
        Force the screen to be completely repainted on the next
        call to draw_screen().

        (does nothing for web_display)
         N/A N/A _fork_child N/A N/A self N/A N/A N/A 
        Fork a child to run CGI disconnected for polling update method.
        Force parent process to exit.
         N/A N/A daemonize N/A N/A self pipe_name .err N/A N/A self input_fd N/A N/A os open N/A N/A self pipe_name .in N/A N/A os O_NONBLOCK N/A os O_RDONLY N/A N/A self update_method polling child N/A s N/A N/A socket socket N/A socket AF_UNIX N/A socket SOCK_STREAM N/A N/A N/A s bind N/A N/A self pipe_name .update N/A N/A N/A s listen 1 N/A N/A N/A s settimeout POLL_CONNECT N/A N/A self server_socket s N/A _handle_alarm N/A N/A self sig frame N/A N/A N/A N/A N/A self update_method N/A multipart polling child N/A N/A N/A self update_method polling child N/A N/A N/A N/A N/A s addr N/A N/A N/A self server_socket accept N/A N/A N/A s close N/A N/A N/A N/A socket timeout N/A N/A N/A N/A sys exit 0 N/A N/A N/A N/A N/A sys stdout write 

--ZZ
 N/A N/A N/A N/A sys stdout flush N/A N/A N/A signal alarm ALARM_DELAY N/A get_cols_rows N/A N/A self N/A N/A N/A Return the screen size. N/A N/A self screen_size N/A get_input N/A N/A self raw_keys N/A False N/A N/A Return pending input as a list. N/A l N/A N/A resized False N/A N/A N/A N/A iready oready eready N/A N/A select select N/A N/A self input_fd N/A N/A 0.5 N/A N/A N/A N/A select error N/A e N/A N/A N/A N/A N/A e args N/A 0 4 N/A N/A raw_keys N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A iready N/A N/A raw_keys N/A N/A N/A N/A N/A N/A N/A N/A keydata N/A N/A os read N/A self input_fd MAX_READ N/A N/A N/A os close N/A self input_fd N/A N/A self input_fd N/A N/A os open N/A N/A self pipe_name .in N/A N/A os O_NONBLOCK N/A os O_RDONLY N/A keys N/A N/A keydata split N/A N/A keys N/A 0 N/A N/A self input_tail N/A keys N/A 0 N/A N/A self input_tail N/A keys N/A -1 N/A k N/A keys N/A -1 N/A N/A N/A N/A k startswith window resize  N/A N/A N/A ign1 ign2 x y N/A N/A k split 3 N/A x N/A int x N/A y N/A int y N/A N/A N/A self _set_screen_size x y N/A resized True N/A N/A N/A N/A l append k N/A resized N/A N/A N/A N/A l append window resize N/A raw_keys N/A N/A N/A l N/A N/A l N/A N/A code_span N/A N/A s fg bg cursor N/A -1 N/A N/A code_fg N/A _code_colours N/A fg N/A code_bg N/A _code_colours N/A bg N/A N/A cursor 0 N/A N/A N/A c_off _ign N/A N/A util calc_text_pos s 0 N/A len s cursor N/A c2_off N/A N/A util move_next_char s c_off N/A len s N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A code_fg code_bg N/A s N/A c_off code_bg code_fg N/A s N/A c_off c2_off code_fg code_bg N/A s N/A c2_off N/A N/A N/A N/A N/A code_fg code_bg s N/A html_escape N/A N/A text N/A N/A N/A Escape text so that it will be displayed safely within HTML N/A text N/A N/A text replace & &amp; N/A text N/A N/A text replace < &lt; N/A text N/A N/A text replace > &gt; N/A text N/A is_web_request N/A N/A N/A N/A N/A 
    Return True if this is a CGI web request.
     N/A N/A N/A N/A os environ has_key REQUEST_METHOD N/A handle_short_request N/A N/A N/A N/A N/A 
    Handle short requests such as passing keystrokes to the application
    or sending the initial html page.  If returns True, then this
    function recognised and handled a short request, and the calling
    script should immediately exit.

    web_display.set_preferences(..) should be called before calling this
    function for the preferences to take effect
     N/A _prefs N/A N/A N/A is_web_request N/A N/A False N/A N/A N/A N/A os environ N/A REQUEST_METHOD GET N/A N/A N/A N/A N/A sys stdout write N/A Content-type: text/html

 N/A N/A N/A html_escape N/A _prefs app_name join _html_page N/A True N/A N/A N/A N/A os environ N/A REQUEST_METHOD POST N/A N/A False N/A N/A N/A N/A N/A os environ has_key HTTP_X_URWID_ID N/A N/A False N/A urwid_id N/A N/A os environ N/A HTTP_X_URWID_ID N/A N/A N/A len urwid_id 20 N/A N/A N/A N/A N/A sys stdout write Status: 414 URI Too Long

 N/A True N/A c urwid_id N/A N/A N/A c 0123456789 N/A N/A N/A N/A N/A sys stdout write Status: 403 Forbidden

 N/A True N/A N/A N/A N/A N/A os environ get HTTP_X_URWID_METHOD None polling N/A N/A s N/A N/A socket socket N/A socket AF_UNIX N/A socket SOCK_STREAM N/A N/A N/A N/A N/A s connect N/A N/A N/A os path join N/A _prefs pipe_dir N/A N/A urwid urwid_id .update N/A data N/A Content-type: text/plain

 N/A N/A s recv BUF_SZ N/A data N/A N/A N/A N/A N/A sys stdout write data N/A data N/A N/A s recv BUF_SZ N/A True N/A N/A N/A N/A socket error N/A N/A N/A N/A N/A sys stdout write Status: 404 Not Found

 N/A True N/A N/A N/A fd N/A N/A os open N/A N/A N/A os path join N/A _prefs pipe_dir N/A N/A urwid urwid_id .in N/A os O_WRONLY N/A N/A N/A OSError N/A N/A N/A N/A N/A sys stdout write Status: 404 Not Found

 N/A True N/A keydata N/A N/A N/A sys stdin read MAX_READ N/A N/A N/A os write fd N/A N/A keydata encode ascii N/A N/A N/A os close fd N/A N/A N/A N/A sys stdout write Content-type: text/plain

 N/A True N/A _Preferences N/A N/A N/A app_name Unnamed Application N/A pipe_dir /tmp N/A allow_polling True N/A max_clients 20 N/A N/A _prefs N/A _Preferences set_preferences N/A N/A app_name pipe_dir allow_polling max_clients N/A /tmp True 20 N/A N/A 
    Set web_display preferences.
    
    app_name -- application name to appear in html interface
    pipe_dir -- directory for input pipes, daemon update sockets 
                and daemon error logs
    allow_polling -- allow creation of daemon processes for 
                     browsers without multipart support 
    max_clients -- maximum concurrent client connections. This
               pool is shared by all urwid applications
               using the same pipe_dir
     N/A _prefs N/A N/A _prefs app_name app_name N/A N/A _prefs pipe_dir pipe_dir N/A N/A _prefs allow_polling allow_polling N/A N/A _prefs max_clients max_clients N/A ErrorLog N/A N/A __init__ N/A N/A self errfile N/A N/A N/A N/A self errfile errfile N/A write N/A N/A self err N/A N/A N/A N/A N/A N/A open N/A self errfile a write err N/A N/A daemonize N/A N/A errfile N/A N/A N/A 
    Detach process and become a daemon.
     N/A pid N/A N/A os fork N/A pid N/A N/A N/A N/A os _exit 0 N/A N/A N/A os setsid N/A N/A N/A signal signal N/A signal SIGHUP N/A signal SIG_IGN N/A N/A N/A os umask 0 N/A pid N/A N/A os fork N/A pid N/A N/A N/A N/A os _exit 0 N/A N/A N/A os chdir / N/A fd N/A range 0 20 N/A N/A N/A N/A N/A N/A os close fd N/A N/A N/A OSError N/A N/A N/A N/A sys stdin N/A open /dev/null r N/A N/A sys stdout N/A open /dev/null w N/A N/A sys stderr N/A ErrorLog errfile N/A