projects
/
mudpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Strip extra separators in show element command
[mudpy.git]
/
lib
/
mudpy
/
misc.py
diff --git
a/lib/mudpy/misc.py
b/lib/mudpy/misc.py
index
bf107a4
..
1dc6b3d
100644
(file)
--- a/
lib/mudpy/misc.py
+++ b/
lib/mudpy/misc.py
@@
-908,8
+908,7
@@
class User:
# log non-printable characters remaining
if mudpy.telnet.is_enabled(self, mudpy.telnet.TELOPT_BINARY,
mudpy.telnet.HIM):
# log non-printable characters remaining
if mudpy.telnet.is_enabled(self, mudpy.telnet.TELOPT_BINARY,
mudpy.telnet.HIM):
- asciiline = b"".join(
- filter(lambda x: b" " <= x <= b"~", line))
+ asciiline = bytes([x for x in line if 32 <= x <= 126])
if line != asciiline:
logline = "Non-ASCII characters from "
if self.account and self.account.get("name"):
if line != asciiline:
logline = "Non-ASCII characters from "
if self.account and self.account.get("name"):
@@
-2055,11
+2054,11
@@
def command_say(actor, parameters):
if message:
# match the punctuation used, if any, to an action
if message:
# match the punctuation used, if any, to an action
- actions = universe.c
ategories["internal"]["language
"].get(
+ actions = universe.c
ontents["mudpy.linguistic
"].get(
"actions"
)
default_punctuation = (
"actions"
)
default_punctuation = (
- universe.c
ategories["internal"]["language
"].get(
+ universe.c
ontents["mudpy.linguistic
"].get(
"default_punctuation"))
action = ""
"default_punctuation"))
action = ""
@@
-2084,7
+2083,7
@@
def command_say(actor, parameters):
message = message[0].lower() + message[1:]
# iterate over all words in message, replacing typos
message = message[0].lower() + message[1:]
# iterate over all words in message, replacing typos
- typos = universe.c
ategories["internal"]["language
"].get(
+ typos = universe.c
ontents["mudpy.linguistic
"].get(
"typos"
)
words = message.split()
"typos"
)
words = message.split()
@@
-2184,8
+2183,8
@@
def command_show(actor, parameters):
elif arguments[0] == "element":
if len(arguments) != 2:
message = "You must specify one element."
elif arguments[0] == "element":
if len(arguments) != 2:
message = "You must specify one element."
- elif arguments[1] in universe.contents:
- element = universe.contents[arguments[1]]
+ elif arguments[1]
.strip(".")
in universe.contents:
+ element = universe.contents[arguments[1]
.strip(".")
]
message = ("These are the properties of the \"" + arguments[1]
+ "\" element (in \"" + element.origin.filename
+ "\"):$(eol)")
message = ("These are the properties of the \"" + arguments[1]
+ "\" element (in \"" + element.origin.filename
+ "\"):$(eol)")