<s> """<STR_LIT>""" <EOL> from starpy import manager <EOL> import utilapplication <EOL> from twisted . internet import reactor <EOL> import sys , logging <EOL> APPLICATION = utilapplication . UtilApplication ( ) <EOL> def main ( channel = '<STR_LIT>' , connectTo = ( '<STR_LIT>' , '<STR_LIT:s>' , '<STR_LIT:1>' ) ) : <EOL> df = APPLICATION . amiSpecifier . login ( ) <EOL> def onLogin ( protocol ) : <EOL> """<STR_LIT>""" <EOL> context , extension , priority = connectTo <EOL> df = protocol . originate ( <EOL> channel , <EOL> context , extension , priority , <EOL> ) <EOL> def onFinished ( result ) : <EOL> return protocol . logoff ( ) <EOL> df . addCallbacks ( onFinished , onFinished ) <EOL> return df <EOL> def onFailure ( reason ) : <EOL> print reason . getTraceback ( ) <EOL> def onFinished ( result ) : <EOL> reactor . stop ( ) <EOL> df . addCallbacks ( <EOL> onLogin , onFailure <EOL> ) . addCallbacks ( onFinished , onFinished ) <EOL> return df <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> logging . basicConfig ( ) <EOL> reactor . callWhenRunning ( main ) <EOL> reactor . run ( ) </s>
