Improve the handling of module load messages
Instead of doing ugly stuff to shorten the "Loaded Module [foo]" message, we now just always generate the shorter version of that message. The code paths which didn't do this shortening now prepend that message themselves. The result is that every message looks the same as it did before, but the code for generating these is a little nicer. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
1 parent
2003465489
commit
f0bf7134ec
6 files changed
+8
-30
No files matched your search
@@ -288,9 +288,9 @@ def load_module(modname, args, user, retmsg, modpython):
|
||||
|
||||
if loaded:
|
||||
if retmsg.s == '':
|
||||
retmsg.s = "Loaded module [{0}] [{1}]".format(modname, pymodule.__file__)
|
||||
retmsg.s = "[{0}]".format(pymodule.__file__)
|
||||
else:
|
||||
retmsg.s = "Loaded module [{0}] [{2}] [{1}]".format(modname, pymodule.__file__, retmsg.s)
|
||||
retmsg.s = "[{1}] [{0}]".format(pymodule.__file__, retmsg.s)
|
||||
return 2
|
||||
print(retmsg.s)
|
||||
|
||||
|
||||
Reference in new issue
Block a user