X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Fmisc.py;h=f111b9edb76fc24bdca2deca174697e5e94149a3;hp=5270acd3661d09d586deeb33c81dee1645649c18;hb=8e082a95481d8f6f30a29f4a95fdd46d24ed992f;hpb=97777484a98e7b81bdf29033c26aae3de5ed2fa0 diff --git a/mudpy/misc.py b/mudpy/misc.py index 5270acd..f111b9e 100644 --- a/mudpy/misc.py +++ b/mudpy/misc.py @@ -655,6 +655,8 @@ class User: old_user.connection = self.connection old_user.last_address = old_user.address old_user.address = self.address + old_user.telopts = self.telopts + old_user.adjust_echoing() # take this one out of the list and delete self.remove() @@ -1369,14 +1371,14 @@ def replace_macros(user, text, is_input=False): elif macro.startswith("inc:"): incfile = mudpy.data.find_file(macro[4:], universe=universe) if os.path.exists(incfile): - incfd = codecs.open(incfile, "r", "utf-8") replacement = "" - for line in incfd: - if line.endswith("\n") and not line.endswith("\r\n"): - line = line.replace("\n", "\r\n") - replacement += line - # lose the trailing eol - replacement = replacement[:-2] + with codecs.open(incfile, "r", "utf-8") as incfd: + for line in incfd: + if line.endswith("\n") and not line.endswith("\r\n"): + line = line.replace("\n", "\r\n") + replacement += line + # lose the trailing eol + replacement = replacement[:-2] else: replacement = "" log("Couldn't read included " + incfile + " file.", 7)