<s> from twisted . application import service , internet <EOL> from twisted . internet import reactor <EOL> from twisted . spread import pb <EOL> import cache_classes <EOL> class Receiver ( pb . Root ) : <EOL> def remote_takePond ( self , pond ) : <EOL> self . pond = pond <EOL> print "<STR_LIT>" , pond <EOL> self . remote_checkDucks ( ) <EOL> def remote_checkDucks ( self ) : <EOL> print "<STR_LIT>" % self . pond . count ( ) , self . pond . getDucks ( ) <EOL> def remote_ignorePond ( self ) : <EOL> print "<STR_LIT>" <EOL> self . pond = None <EOL> def remote_shutdown ( self ) : <EOL> reactor . stop ( ) <EOL> application = service . Application ( "<STR_LIT>" ) <EOL> internet . TCPServer ( <NUM_LIT> , pb . PBServerFactory ( Receiver ( ) ) ) . setServiceParent ( <EOL> service . IServiceCollection ( application ) ) </s>
