#NEWLINE# def on_raw_cap_ls( self , params ) : #NEWLINE# #INDENT# ' Update capability mapping. Request capabilities. ' #NEWLINE# to_request = set ( ) #NEWLINE# for capab in params [ 0 ] . split ( ) : #NEWLINE# #INDENT# ( capab , value ) = self . _capability_normalize ( capab ) #NEWLINE# if ( capab in self . _capabilities ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# attr = ( ( 'on_capability_' + pydle . protocol . identifierify ( capab ) ) + '_available' ) #NEWLINE# supported = ( getattr ( self , attr ) ( value ) if hasattr ( self , attr ) else False ) #NEWLINE# if supported : #NEWLINE# #INDENT# if isinstance ( supported , str ) : #NEWLINE# #INDENT# to_request . add ( ( ( attr + CAPABILITY_VALUE_DIVIDER ) + supported ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# to_request . add ( capab ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _capabilities [ capab ] = False #NEWLINE# #UNINDENT# #UNINDENT# if to_request : #NEWLINE# #INDENT# self . _capabilities_requested . update ( ( x . split ( CAPABILITY_VALUE_DIVIDER , 1 ) [ 0 ] for x in to_request ) ) #NEWLINE# self . rawmsg ( 'CAP' , 'REQ' , ' ' . join ( to_request ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . rawmsg ( 'CAP' , 'END' )