#NEWLINE# @ staticmethod #NEWLINE# def build( capabilities , device_handler ) : #NEWLINE# #INDENT# "Given a list of capability URI's returns <hello> message XML string" #NEWLINE# if device_handler : #NEWLINE# #INDENT# xml_namespace_kwargs = { #NEWLINE# #INDENT# 'nsmap' : device_handler . get_xml_base_namespace_dict ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# xml_namespace_kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# hello = new_ele ( 'hello' , ** xml_namespace_kwargs ) #NEWLINE# caps = sub_ele ( hello , 'capabilities' ) #NEWLINE# def fun( uri ) : #NEWLINE# #INDENT# sub_ele ( caps , 'capability' ) . text = uri #NEWLINE# #UNINDENT# if ( sys . version < '3' ) : #NEWLINE# #INDENT# map ( fun , capabilities ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# list ( map ( fun , capabilities ) ) #NEWLINE# #UNINDENT# return to_xml ( hello )