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 "".

results matching ""

    No results matching ""