Пример #1
0
def html( iface, title ='simulator', help ='', root ='',
        target ='out',
        remove_empty_form_fields =True,
        sorter =lambda x: x,
        **kargs ):
    base = root
    r = ('''\
<html><head>
<title> {title} </title>
''' + (base and '<base href="{base}" target="{target}" >' or '')).format( **locals()) + '''
<style TYPE='text/css'><!--
 * { font-size:small }
 form { margin:0 }
 hr { margin:1px }
--></style>
''' + (remove_empty_form_fields and js2remove_empty_form_fields or '') + '''
</head>

<body>
<table width=100% height=95% border=0 cellspacing=0><tr><td width=50%>
  <div style="overflow:auto; height:100%;">
''' + '\n<hr>'.join(
        form( what.decl, target= target, remove_empty_form_fields=remove_empty_form_fields, **kargs)
        for what in sorter( iface.methods_walk_instance( iface))
) + '''
 </div>
 <td height=100%> <iframe name=out width=100% height=100%> no-iframe? </iframe>
</table>
'''
    if help: r += '<hr>' + '\n<br>'.join( help.strip().split('\n'))
    urls = [ escape( x) for x in url_doco( iface, sepattrs=' ; ') ]
    return r + '''
<hr>
<b>Valid URLs</b>:<br>
''' + '\n<br>'.join( urls)
Пример #2
0
    .programs?channel=34   #programs in channel
    .programs              #programs in all channels
    .add_program?channel=34&program=2345        #add program to channel
    .del_program?channel=34&program=2345        #del program to channel
    .new_channel?program=2345&name=..
    .save_channel?channel=34&name=..            #upd channel metadata
    .del_channel?channel=34                     #del whole channel

    /storage
    .broadcast_channels     #all
    .programs_by_filter?filter=..
    .programs_by_filter     #all programs
    .getGenre?id=345        #description of genre 345

    /images
    .program_image?program=345
    .channel_logo?channel=12
'''


if __name__ == '__main__':
    if 10:
        from facer import url_doco
        #for x in urls: print x
        #print '---doco'
        for i in fprg,fimg,fdbgz:
            print i
            for x in url_doco( i, separator='\n    '): print x

# vim:ts=4:sw=4:expandtab