def do_set(self, line):
try:<EOL><INDENT>name, value = [part.strip() for part in line.split('<STR_LIT:=>')]<EOL>if name not in self.bot._vars:<EOL><INDENT>self.print_response('<STR_LIT>' % name)<EOL>return<EOL><DEDENT>variable = self.bot._vars[name]<EOL>variable.value = variable.sanitize(value.strip('<STR_LIT:;>'))<EOL>success, msg = self.bot.canvas.sink.var_changed(name, variable.value)<EOL>if success:<EOL><INDENT>print('<STR_LIT>'.format(name, variable.value), file=self.stdout)<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>'.format(msg), file=self.stdout)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>print('<STR_LIT>', e)<EOL>return<EOL><DEDENT>
Set a variable.