parameters: (self)
return_statement: return message
docstring: Create the message based on script arguments
docstring_summary: Create the message based on script arguments
docstring_tokens: Create the message based on script arguments
function: def forge_message(self):
          '''
          Create the message based on script arguments
          '''
          message = XplMessage()
          message.set_type(self.options.type)
          if self.options.source != None:
              print(u"Source forced : {0}".format(self.options.source))
              message.set_source(self.options.source)
          if self.options.target != None:
              print(u"Target forced : {0}".format(self.options.target))
              message.set_target(self.options.target)
          message.set_schema(self.options.schema)
          datas = self.options.message.split(',')
          for data in datas:
              if "=" not in data:
                  self.log.error(u"Bad formatted commands. Must be key=value")
                  self.usage()
                  exit(4)
              else:
                  message.add_data({data.split("=",1)[0].strip() :  data.split("=",1)[1].strip()})
          return message
function_tokens: def forge_message ( self ) : message = XplMessage ( ) message . set_type ( self . options . type ) if self . options . source != None : print ( u"Source forced : {0}" . format ( self . options . source ) ) message . set_source ( self . options . source ) if self . options . target != None : print ( u"Target forced : {0}" . format ( self . options . target ) ) message . set_target ( self . options . target ) message . set_schema ( self . options . schema ) datas = self . options . message . split ( ',' ) for data in datas : if "=" not in data : self . log . error ( u"Bad formatted commands. Must be key=value" ) self . usage ( ) exit ( 4 ) else : message . add_data ( { data . split ( "=" , 1 ) [ 0 ] . strip ( ) : data . split ( "=" , 1 ) [ 1 ] . strip ( ) } ) return message