def TaskMessage1(name, id=None, args=(), kwargs={}, callbacks=None, errbacks=None, chain=None, **options):
 from celery import uuid
 from kombu.serialization import dumps
 id = (id or uuid())
 message = Mock(name=u'TaskMessage-{0}'.format(id))
 message.headers = {}
 message.payload = {u'task': name, u'id': id, u'args': args, u'kwargs': kwargs, u'callbacks': callbacks, u'errbacks': errbacks}
 message.payload.update(options)
 (message.content_type, message.content_encoding, message.body) = dumps(message.payload)
 return message

def TaskMessage1 ( name , id = None , args = ( ) , kwargs = { } , callbacks = None , errbacks = None , chain = None , ** options ) : from celery import uuid from kombu . serialization import dumps id = ( id or uuid ( ) ) message = Mock ( name = u'TaskMessage-{0}' . format ( id ) ) message . headers = { } message . payload = { u'task' : name , u'id' : id , u'args' : args , u'kwargs' : kwargs , u'callbacks' : callbacks , u'errbacks' : errbacks } message . payload . update ( options ) ( message . content_type , message . content_encoding , message . body ) = dumps ( message . payload ) return message
create task message in protocol 1 format .