Esempio n. 1
0
 def cmd_delete(self, topic):
     help_entry = search_help_entry(topic)
     if help_entry:
         help_entry = help_entry[0]
     else:
         self.msg('{R[Topic not found]')
         return
     help_entry.delete()
     self.msg('{G[Topic deleted]')
Esempio n. 2
0
 def cmd_category(self, topic, category):
     help_entry = search_help_entry(topic)
     if help_entry:
         help_entry = help_entry[0]
     else:
         self.msg('{R[Topic not found]')
         return
     help_entry.help_category = category
     self.msg('{G[Category set]')
Esempio n. 3
0
 def cmd_locks(self, topic, lockstring):
     help_entry = search_help_entry(topic)
     if help_entry:
         help_entry = help_entry[0]
     else:
         self.msg('{R[Topic not found]')
         return
     help_entry.locks.clear()
     if help_entry.locks.add(lockstring):
         self.msg('{G[Lock string set]')
     else:
         self.msg('{R[Failed to set lock string (Invalid string?)]') # FIXME: Upstream issue 410
Esempio n. 4
0
 def cmd_edit(self, topic):
     help_entry = search_help_entry(topic)
     if help_entry:
         help_entry = help_entry[0]
     else:
         help_entry = None
     input_cmd = CmdSetHelpEdit()
     input_cmd.editor = lineeditor.LineEditor(self.caller, maxchars=None, maxlines=None, color=True, key='Help: ' + topic)
     if help_entry:
         input_cmd.editor.set_buffer(help_entry.entrytext)
     input_cmd.editor.display_buffer()
     input_cmd.help_topic = topic
     input_cmd.help_entry = help_entry
     input_cmdset = CmdsetSetHelp()
     input_cmdset.add(input_cmd)
     self.caller.cmdset.add(input_cmdset)