#NEWLINE# def splitSM( self , pdu ) : #NEWLINE# #INDENT# short_message = pdu . params [ 'short_message' ] #NEWLINE# if self . containsUDH ( pdu ) : #NEWLINE# #INDENT# if ( len ( short_message ) == 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'Empty short message' ) #NEWLINE# #UNINDENT# headerLen = struct . unpack ( '!B' , short_message [ 0 ] ) [ 0 ] #NEWLINE# if ( ( headerLen + 1 ) > len ( short_message ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Invalid header len (%d). Longer than short_message len (%d) + 1' % ( headerLen , len ( short_message ) ) ) ) #NEWLINE# #UNINDENT# return ( short_message , short_message [ : ( headerLen + 1 ) ] , short_message [ ( headerLen + 1 ) : ] ) #NEWLINE# #UNINDENT# return ( short_message , None , short_message )