def send_formatting(message):
 message = message.replace('\r\n', '\n')
 if ('\n' in message):
  return ('+%s\r\n.\r\n' % message.replace('\n', '\r\n'))
 else:
  return (message + '\r\n')

def send_formatting ( message ) : message = message . replace ( '\r\n' , '\n' ) if ( '\n' in message ) : return ( '+%s\r\n.\r\n' % message . replace ( '\n' , '\r\n' ) ) else : return ( message + '\r\n' )
performs the formatting expected from sent control messages .