if self.state is not "authenticated":
log("User " + self.account.get("name") + " logged in.", 2)
self.authenticated = True
- if self.account.subkey in universe.categories[
- "internal"
- ][
- "limits"
- ].get(
- "default_admins"
- ):
+ if self.account.subkey in universe.contents["mudpy.limit"].get(
+ "admins"):
self.account.set("administrator", "True")
def show_menu(self):
"""Log a message."""
# a couple references we need
- file_name = universe.categories["internal"]["logging"].get("file")
- max_log_lines = universe.categories["internal"]["logging"].get(
- "max_log_lines"
- )
- syslog_name = universe.categories["internal"]["logging"].get("syslog")
+ file_name = universe.contents["mudpy.log"].get("file")
+ max_log_lines = universe.contents["mudpy.log"].get("lines")
+ syslog_name = universe.contents["mudpy.log"].get("syslog")
timestamp = time.asctime()[4:19]
# turn the message into a list of nonempty lines
file_descriptor.close()
# send the timestamp and line to standard output
- if universe.categories["internal"]["logging"].get("stdout"):
+ if universe.contents["mudpy.log"].get("stdout"):
for line in lines:
print(timestamp + " " + line)
user.state = "main_utility"
# if at first your hashes don't match, try, try again
- elif user.password_tries < universe.categories[
- "internal"
- ][
- "limits"
- ].get(
- "password_tries"
- ) - 1:
+ elif user.password_tries < universe.contents["mudpy.limit"].get(
+ "password_tries") - 1:
user.password_tries += 1
user.error = "incorrect"
user.state = "verifying_new_password"
# the password was weak, try again if you haven't tried too many times
- elif user.password_tries < universe.categories[
- "internal"
- ][
- "limits"
- ].get(
- "password_tries"
- ) - 1:
+ elif user.password_tries < universe.contents["mudpy.limit"].get(
+ "password_tries") - 1:
user.password_tries += 1
user.error = "weak"
# go back to entering the new password as long as you haven't tried
# too many times
- elif user.password_tries < universe.categories[
- "internal"
- ][
- "limits"
- ].get(
- "password_tries"
- ) - 1:
+ elif user.password_tries < universe.contents["mudpy.limit"].get(
+ "password_tries") - 1:
user.password_tries += 1
user.error = "differs"
user.state = "entering_new_password"
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)")