Changeset 3772

Show
Ignore:
Timestamp:
08/29/08 18:01:44 (3 months ago)
Author:
mvoncken
Message:

docgen

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deluge/scripts/wiki_docgen.py

    r3485 r3772  
    55 
    66from deluge.core.core import Core 
    7 from deluge.ui.client import aclient 
     7from deluge.ui.client import aclient, sclient 
    88import pydoc 
    99import inspect 
    10  
     10import textwrap 
     11sclient.set_core_uri() 
     12print "\n\n" 
    1113 
    1214 
     
    2931        print("%s" % pydoc.getdoc(func)) 
    3032 
    31 if True: #baseclient/core 
     33if 0: #baseclient/core 
    3234    methods = sorted([m for m in dir(Core) if m.startswith("export")] 
    3335        + ['export_add_torrent_file_binary'] #HACK 
     
    4951 
    5052        print("\n'''%s(%s): '''\n" %(method_name, ", ".join(params))) 
    51         print("%s" % pydoc.getdoc(func)) 
     53        print("{{{\n%s\n}}}" % pydoc.getdoc(func)) 
    5254 
    5355if False: #plugin-manager 
     
    6163        print("\n'''%s(%s): '''\n" %(method_name, ", ".join(params))) 
    6264        print("%s" % pydoc.getdoc(func)) 
     65 
     66if 1: #possible config-values 
     67    print "=== config-values ===" 
     68    cfg = sclient.get_config() 
     69    for key in sorted(cfg.keys()): 
     70        print "%s:%s()" % (key, type(cfg[key]).__name__) 
     71 
     72if False: #keys 
     73    print """== Notes == 
     74* The available keys for get_torrent_status(id, keys) 
     75    {{{ 
     76#!python 
     77>>>sorted(sclient.get_status_keys())""" 
     78    print "\n".join(textwrap.wrap(str(sorted(sclient.get_status_keys())),100)) 
     79    print """}}}""" 
     80 
     81 
     82 
     83 
     84print "\n\n" 
     85 
     86