Added a plugin system for server and portal. This allows for plugging in your own services without having to edit any modules in src/server/. Also made some various cleanups and fixes.
This commit is contained in:
parent
ee450a4fed
commit
83fa9397d5
8 changed files with 100 additions and 80 deletions
|
|
@ -56,7 +56,7 @@ def cmdparser(raw_string, cmdset, caller, match_index=None):
|
|||
and (not cmd.arg_regex or
|
||||
cmd.arg_regex.match(l_raw_string[len(cmdname):]))])
|
||||
except Exception:
|
||||
log_trace("raw_input:%s" % raw_string)
|
||||
log_trace("cmdhandler error. raw_input:%s" % raw_string)
|
||||
|
||||
if not matches:
|
||||
# no matches found.
|
||||
|
|
|
|||
|
|
@ -391,19 +391,11 @@ class CmdSet(object):
|
|||
unique[cmd.key] = cmd
|
||||
self.commands = unique.values()
|
||||
|
||||
def at_cmdset_creation(self):
|
||||
"""
|
||||
Hook method - this should be overloaded in the inheriting
|
||||
class, and should take care of populating the cmdset
|
||||
by use of self.add().
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_all_cmd_keys_and_aliases(self, caller=None):
|
||||
"""
|
||||
Returns a list of all command keys and aliases
|
||||
available in this cmdset. If caller is given, the
|
||||
comands is checked for access on the "call" type
|
||||
commands is checked for access on the "call" type
|
||||
before being returned.
|
||||
"""
|
||||
names = []
|
||||
|
|
@ -412,3 +404,11 @@ class CmdSet(object):
|
|||
else:
|
||||
[names.extend(cmd._keyaliases) for cmd in self.commands]
|
||||
return names
|
||||
|
||||
def at_cmdset_creation(self):
|
||||
"""
|
||||
Hook method - this should be overloaded in the inheriting
|
||||
class, and should take care of populating the cmdset
|
||||
by use of self.add().
|
||||
"""
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue