Package html_lib :: Module html_factory
[show private | hide private]
[frames | no frames]

Module html_lib.html_factory

html_factory: very basic module to provide webbrowser access to the server's methods. this still needs _a lot_ of work!...
Function Summary
string dict_to_table(dict, caption)
format a dictionary into an html table.
string make_foot()
make an html footer (html closing tags, index link).
string make_header()
make an html header (page caption).
string make_message(msg)
format a message to be displayed on top of the page.
string make_method_table(meth_dict)
format the callable methods of a registry.Co2Registryinto an html table.
string make_page(type, msg, stuff)
make an html page.
string translate(str)
very rudimentary escape for html entities.

Variable Summary
tuple address
dict colors
str foot
str head
str header
str index
str message
str method_table
str registry_type
dict sat_link

Function Details

dict_to_table(dict, caption='')

format a dictionary into an html table.
Parameters:
dict - data
           (type=dictionary)
Returns:
html formatted dictionary data
           (type=string)

make_foot()

make an html footer (html closing tags, index link).
Returns:
html formatted footer
           (type=string)

make_header()

make an html header (page caption).
Returns:
html formatted header
           (type=string)

make_message(msg)

format a message to be displayed on top of the page.
Parameters:
msg - the message to display
           (type=string)
Returns:
html formatted message
           (type=string)

make_method_table(meth_dict)

format the callable methods of a registry.Co2Registry into an html table.
Parameters:
meth_dict - method data (the registry's instance variable 'methods')
           (type=dictionary)
Returns:
html table
           (type=string)

make_page(type='index', msg='', stuff='')

make an html page.
Parameters:
type - page type
           (type=string)
msg - optional text message to insert at the top of the page (used for displaying replies and traces)
           (type=string)
stuff - additional stuff to print
           (type=string)
Returns:
an html formatted page
           (type=string)

translate(str)

very rudimentary escape for html entities.
Parameters:
str - input to be made html-safe
           (type=string)
Returns:
input with special characters replaced by html entities
           (type=string)

Variable Details

address

Type:
tuple
Value:
('localhost', 2003)                                                    

colors

Type:
dict
Value:
{'blue': '#00b6ee', 'orange': '#ee9b00'}                               

foot

Type:
str
Value:
'''<hr>
<font face="sans-serif" size="2">
- <a href="http://%(host)s:%(port)d">index</a> -
</font>
</body>
</html>

'''                                                                    

head

Type:
str
Value:
'''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1\
">
<title>co2</title>
</head>
<body>
...                                                                    

header

Type:
str
Value:
'''<font face="sans-serif" size="4" color="#30d3e8">
co2 %(registry)s @ %(host)s:%(port)d
</font>
<p>
'''                                                                    

index

Type:
str
Value:
'''<font face="sans-serif" size="3">
some explanations here...
</font>
<p>
<a href="methods?">methods</a>
<p>
%(reg)s
'''                                                                    

message

Type:
str
Value:
'''<font face="sans-serif" size="3" color="#ff6d4c">
%s
</font>
'''                                                                    

method_table

Type:
str
Value:
''                                                                     

registry_type

Type:
str
Value:
'satellite'                                                            

sat_link

Type:
dict
Value:
{'satellite': '', 'relay': '<a href="satellites?">satellites</a><p>'}  

Generated by Epydoc 1.1 on Thu Oct 16 16:37:23 2003 http://epydoc.sf.net