<s> """<STR_LIT>""" <EOL> import cPickle as pickle <EOL> from twisted . internet import reactor , defer <EOL> from jasmin . managers . proxies import SMPPClientManagerPBProxy <EOL> from jasmin . routing . proxies import RouterPBProxy <EOL> from jasmin . routing . Routes import DefaultRoute <EOL> from jasmin . routing . jasminApi import User , Group <EOL> from jasmin . protocols . smpp . configs import SMPPClientConfig <EOL> from jasmin . protocols . cli . smppccm import JCliSMPPClientConfig as SmppClientConnector <EOL> from twisted . web . client import getPage <EOL> @ defer . inlineCallbacks <EOL> def runScenario ( ) : <EOL> try : <EOL> proxy_smpp = SMPPClientManagerPBProxy ( ) <EOL> yield proxy_smpp . connect ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) <EOL> connector1 = { '<STR_LIT:id>' : '<STR_LIT:abc>' , '<STR_LIT:username>' : '<STR_LIT>' , '<STR_LIT>' : True } <EOL> config1 = SMPPClientConfig ( ** connector1 ) <EOL> yield proxy_smpp . add ( config1 ) <EOL> yield proxy_smpp . start ( '<STR_LIT:abc>' ) <EOL> proxy_router = RouterPBProxy ( ) <EOL> yield proxy_router . connect ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) <EOL> yield proxy_router . mtroute_add ( DefaultRoute ( SmppClientConnector ( '<STR_LIT:abc>' ) ) , <NUM_LIT:0> ) <EOL> routes = yield proxy_router . mtroute_get_all ( ) <EOL> print "<STR_LIT>" % pickle . loads ( routes ) <EOL> g1 = Group ( <NUM_LIT:1> ) <EOL> u1 = User ( uid = <NUM_LIT:1> , group = g1 , username = '<STR_LIT:foo>' , password = '<STR_LIT:bar>' ) <EOL> yield proxy_router . group_add ( g1 ) <EOL> yield proxy_router . user_add ( u1 ) <EOL> users = yield proxy_router . user_get_all ( ) <EOL> print "<STR_LIT>" % pickle . loads ( users ) <EOL> yield proxy_smpp . stop ( '<STR_LIT:abc>' ) <EOL> except Exception , e : <EOL> print "<STR_LIT>" % str ( e ) <EOL> finally : <EOL> reactor . stop ( ) <EOL> runScenario ( ) <EOL> reactor . run ( ) </s>
