Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def formatDefinitions(options, COLS):
    s = StringIO()
    indent = " " * 10
    width = COLS - 11

    if width < 15:
        width = COLS - 2
        indent = " "

    for (longname, default, doc) in options:
        s.write('--' + longname + ' \n')
        if default is not None:
            doc += ' (defaults to ' + repr(default) + ')'
        i = 0
        for word in doc.split():
            if i == 0:
                s.write(indent + word)
                i = len(word)
            elif i + len(word) >= width:
                s.write('\n' + indent + word)
                i = len(word)
            else:
                s.write(' ' + word)
                i += len(word) + 1
        s.write('\n\n')
    return s.getvalue()
        


src/k/a/kamaelia-HEAD/Sketches/RJL/bittorrent/BitTorrent/BitTorrent/track.py   kamaelia(Download)
from BitTorrent.obsoletepythonsupport import *
 
from BitTorrent.parseargs import parseargs, formatDefinitions
from BitTorrent.RawServer_magic import RawServer
from BitTorrent.HTTPHandler import HTTPHandler, months, weekdays
def track(args):
    if len(args) == 0:
        print formatDefinitions(defaults, 80)
        return
    try:

src/b/e/benflix-HEAD/videoportal/BitTorrent/btmakemetafile.py   benflix(Download)
from BitTorrent.bencode import bencode
from BitTorrent.btformats import check_info
from BitTorrent.parseargs import parseargs, formatDefinitions
from threading import Event
from time import time
        print argv[0] + ' file trackerurl [params]'
        print
        print formatDefinitions(defaults, 80)
    else:
        try: