Module Import alias alias alias ImportFrom alias ImportFrom alias alias FunctionDef arguments args defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Print Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body If CompareNotIn Str NameLoad body Assign NameStore Str Assign NameStore NameLoad orelse Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return TupleLoad NameLoad Call NameLoad NameLoad decorator_list Return Call NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr ImportFrom alias Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args defaults body Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Raise Call NameLoad decorator_list FunctionDef arguments args defaults body Raise Call NameLoad NameLoad decorator_list Return Call Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad ImportFrom alias Assign NameStore ListLoad Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body If Call AttributeLoad NameLoad attr NameLoad body Print Str Return SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Print NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Print AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareEq BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list For NameStore NameLoad body Assign TupleStore NameStore NameStore NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A optparse random sys twisted.internet defer twisted.internet.protocol Protocol ClientFactory parse_args N/A N/A N/A N/A N/A usage usage: %prog [options] [hostname]:port ...

This is the Get Poetry Now! client, Twisted version 5.1
Run it like this:

  python get-poetry-1.py port1 port2 port3 ...

If you are in the base directory of the twisted-intro package,
you could run it like this:

  python twisted-client-5/get-poetry-1.py 10001 10002 10003

to grab poetry from servers on ports 10001, 10002, and 10003.

Of course, there need to be servers listening on those ports
for that to work.
 N/A parser N/A N/A optparse OptionParser usage N/A N/A _ addresses N/A N/A parser parse_args N/A N/A addresses N/A N/A N/A N/A parser format_help N/A N/A N/A parser exit parse_address N/A N/A addr N/A N/A N/A N/A : addr N/A N/A host 127.0.0.1 N/A port addr N/A N/A N/A host port N/A N/A addr split : 1 N/A N/A N/A N/A port isdigit N/A N/A N/A N/A parser error Ports must be integers. N/A N/A host N/A int port N/A N/A N/A map parse_address addresses N/A PoetryProtocol N/A Protocol N/A N/A poem dataReceived N/A N/A self data N/A N/A N/A N/A self poem data N/A connectionLost N/A N/A self reason N/A N/A N/A N/A N/A self poemReceived N/A self poem N/A poemReceived N/A N/A self poem N/A N/A N/A N/A N/A N/A self factory poem_finished poem N/A N/A PoetryClientFactory N/A ClientFactory N/A N/A protocol PoetryProtocol __init__ N/A N/A self deferred N/A N/A N/A N/A self deferred deferred N/A poem_finished N/A N/A self poem N/A N/A N/A N/A N/A self deferred None N/A N/A N/A d N/A self deferred N/A N/A self deferred None N/A N/A N/A d callback poem N/A clientConnectionFailed N/A N/A self connector reason N/A N/A N/A N/A N/A self deferred None N/A N/A N/A d N/A self deferred N/A N/A self deferred None N/A N/A N/A d errback reason N/A N/A get_poetry N/A N/A host port N/A N/A N/A 
    Download a poem from the given host and port. This function
    returns a Deferred which will be fired with the complete text of
    the poem or a Failure if the poem could not be downloaded.
     N/A d N/A N/A defer Deferred twisted.internet reactor N/A factory N/A PoetryClientFactory d N/A N/A N/A reactor connectTCP host port factory N/A d N/A GibberishError N/A Exception N/A N/A N/A CannotCummingsify N/A Exception N/A N/A N/A cummingsify N/A N/A poem N/A N/A N/A 
    Randomly do one of the following:

    1. Return a cummingsified version of the poem.
    2. Raise a GibberishError.
    3. Raise a CannotCummingsify error with the original poem
       as the first argument.
     success N/A N/A N/A N/A N/A N/A N/A poem lower N/A gibberish N/A N/A N/A N/A N/A N/A GibberishError N/A bug N/A N/A N/A N/A N/A N/A CannotCummingsify poem N/A N/A N/A N/A N/A random choice N/A success gibberish bug N/A poetry_main N/A N/A N/A N/A N/A addresses N/A parse_args twisted.internet reactor N/A poems N/A N/A errors N/A cummingsify_failed N/A N/A err N/A N/A N/A N/A N/A err check CannotCummingsify N/A N/A Cummingsify failed! N/A N/A N/A N/A err value args N/A 0 N/A err N/A got_poem N/A N/A poem N/A N/A N/A poem N/A N/A N/A poems append poem N/A poem_failed N/A N/A err N/A N/A N/A N/A sys stderr The poem download failed. N/A N/A N/A errors append err N/A poem_done N/A N/A _ N/A N/A N/A N/A N/A N/A len poems N/A len errors N/A len addresses N/A N/A N/A N/A reactor stop N/A N/A address addresses N/A N/A N/A host port address N/A d N/A get_poetry host port N/A N/A N/A d addCallback cummingsify N/A N/A N/A d addErrback cummingsify_failed N/A N/A N/A d addCallbacks got_poem poem_failed N/A N/A N/A d addBoth poem_done N/A N/A N/A reactor run N/A N/A N/A __name__ __main__ N/A N/A N/A poetry_main