ostinato.protocols.userscript_pb2 module¶
To add and configure UserScript in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kUserScriptFieldNumber
and access the UserScript object from the Protocol object's Extensions
dictionary using the key userscript_pb2.userScript
from ostinato.protocols import userscript_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kUserScriptFieldNumber
my_userScript = proto.Extensions[userscript_pb2.userScript]
You can then set UserScript attributes using my_userScript.<attribute>
UserScript class¶
Class attributes¶
program¶
UserScript.program : str(unicode)
Optional. If not set, defaults to "".