def from_proto(self, msg): """Return a builder that takes the configuration from the proto message as its starting point. """ # Process plugins from a command config protobuf message. if msg.HasField('plugins'): PluginRegistry.get_instance().add_plugins_from_proto(msg.plugins) return self.with_root_uri(msg.root_uri).with_split_id(msg.split_id)
def to_proto(self): """Returns the protobuf configuration for this config. """ plugin_config = PluginRegistry.get_instance().to_proto() return CommandConfigMsg(command_type=self.command_type, root_uri=self.root_uri, split_id=self.split_id, plugins=plugin_config)
def run_from_proto(msg): PluginRegistry.get_instance().add_plugins_from_proto(msg.plugins) command_config = rv.command.CommandConfig.from_proto(msg) command = command_config.create_command() command.run()