diff options
| author | 2020-02-24 17:10:43 +0000 | |
|---|---|---|
| committer | 2020-02-24 17:10:43 +0000 | |
| commit | 22a2bead7f52aabe79a6c40b47a209c03edaac2f (patch) | |
| tree | ba73fdc8b2ab6ab329b9a28eb0d18f1c6f525e20 /modules | |
| parent | open possibly-utf8 files with forced utf8 (diff) | |
| signature | ||
for some reason, __ variables disappear from hasattr
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/channel_log.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/channel_log.py b/modules/channel_log.py index d4b677c6..17ae5df4 100644 --- a/modules/channel_log.py +++ b/modules/channel_log.py @@ -25,24 +25,24 @@ class Module(ModuleManager.BaseModule): sanitised_name = channel_name.replace(os.path.sep, ",") return self.data_directory("%s/%s.log" % (server_name, sanitised_name)) def _write_line(self, channel, line): - channel.__log_file.write("%s\n" % line) + channel._log_file.write("%s\n" % line) def _write(self, channel, filename, key, line): - if not hasattr(channel, "__log_file"): - channel.__log_file = utils.io.open(filename, "a") - channel.__log_rsa = None - channel.__log_aes = None + if not hasattr(channel, "_log_file"): + channel._log_file = utils.io.open(filename, "a") + channel._log_rsa = None + channel._log_aes = None - if key and not key == channel.__log_rsa: + if key and not key == channel._log_rsa: aes_key = utils.security.aes_key() - channel.__log_rsa = key - channel.__log_aes = aes_key + channel._log_rsa = key + channel._log_aes = aes_key aes_key_line = utils.security.rsa_encrypt(key, aes_key) self._write_line(channel, "\x03%s" % aes_key_line) - if not channel.__log_aes == None: + if not channel._log_aes == None: line = "\x04%s" % utils.security.aes_encrypt( - channel.__log_aes, line) + channel._log_aes, line) self._write_line(channel, line) def _log(self, server, channel, line): |
