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

All Samples(5)  |  Call(2)  |  Derive(0)  |  Import(3)

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

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

    for (longname, default, doc) in options:
        if doc == '':
            continue
        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/a/n/Anomos-HEAD/anontrack.py   Anomos(Download)
import sys
 
from Anomos.parseargs import parseargs, formatDefinitions
from Anomos.track import defaults, Tracker
 
def track(argv):
    if len(argv) == 0:
        print formatDefinitions(defaults, 80)
        return
    try:

src/a/n/Anomos-HEAD/Anomos/track.py   Anomos(Download)
from Anomos.NetworkModel import NetworkModel
from Anomos.bencode import bencode, bdecode, Bencached
from Anomos.parseargs import parseargs, formatDefinitions
from Anomos.parsedir import parsedir
from Anomos import bttime, version, is_valid_ipv4, LOG as log
def track(args):
    if len(args) == 0:
        print formatDefinitions(defaults, 80)
        return
    try:

src/a/n/Anomos-HEAD/Anomos/TwistedServer.py   Anomos(Download)
from twisted.internet.selectreactor import SelectReactor, _NO_FILENO, _NO_FILEDESC
 
from Anomos.parseargs import parseargs, formatDefinitions
from Anomos.track import defaults, isotime, Tracker
import Anomos.Crypto