#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def onJoin( self , details ) : #NEWLINE# #INDENT# self . log ( 'joined' ) #NEWLINE# def ping( ) : #NEWLINE# #INDENT# self . log ( 'ping() is invoked' ) #NEWLINE# return #NEWLINE# #UNINDENT# def add2( a , b ) : #NEWLINE# #INDENT# self . log ( 'add2() is invoked' , a , b ) #NEWLINE# return ( a + b ) #NEWLINE# #UNINDENT# def stars( nick = 'somebody' , stars = 0 ) : #NEWLINE# #INDENT# self . log ( 'stars() is invoked' , nick , stars ) #NEWLINE# return '{0} starred {1}x' . format ( nick , stars ) #NEWLINE# #UNINDENT# def orders( product , limit = 5 ) : #NEWLINE# #INDENT# self . log ( 'orders() is invoked' , product , limit ) #NEWLINE# return [ 'Product {0}' . format ( i ) for i in range ( 50 ) ] [ : limit ] #NEWLINE# #UNINDENT# def arglen( * args , **kwargs ) : #NEWLINE# #INDENT# self . log ( 'arglen() is invoked' , args , kwargs ) #NEWLINE# return [ len ( args ) , len ( kwargs ) ] #NEWLINE# #UNINDENT# ( yield self . register ( ping , 'com.arguments.ping' ) ) #NEWLINE# ( yield self . register ( add2 , 'com.arguments.add2' ) ) #NEWLINE# ( yield self . register ( stars , 'com.arguments.stars' ) ) #NEWLINE# ( yield self . register ( orders , 'com.arguments.orders' ) ) #NEWLINE# ( yield self . register ( arglen , 'com.arguments.arglen' ) ) #NEWLINE# self . log ( 'procedures registered' )