projects
/
mudpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Eliminate exec() in Universe.new()
[mudpy.git]
/
mudpy
/
misc.py
diff --git
a/mudpy/misc.py
b/mudpy/misc.py
index
b83215c
..
fca279a
100644
(file)
--- a/
mudpy/misc.py
+++ b/
mudpy/misc.py
@@
-406,7
+406,7
@@
class Universe:
"""Create a new, empty Universe (the Big Bang)."""
new_universe = Universe()
for attribute in vars(self).keys():
"""Create a new, empty Universe (the Big Bang)."""
new_universe = Universe()
for attribute in vars(self).keys():
-
exec("new_universe." + attribute + " = self." + attribute
)
+
setattr(new_universe, attribute, getattr(self, attribute)
)
new_universe.reload_flag = False
del self
return new_universe
new_universe.reload_flag = False
del self
return new_universe
@@
-637,14
+637,13
@@
class User:
"""Flag the user as authenticated and disconnect duplicates."""
if self.state != "authenticated":
self.authenticated = True
"""Flag the user as authenticated and disconnect duplicates."""
if self.state != "authenticated":
self.authenticated = True
+ log("User %s authenticated for account %s." % (
+ self, self.account.subkey), 2)
if ("mudpy.limit" in universe.contents and self.account.subkey in
universe.contents["mudpy.limit"].get("admins")):
self.account.set("administrator", True)
if ("mudpy.limit" in universe.contents and self.account.subkey in
universe.contents["mudpy.limit"].get("admins")):
self.account.set("administrator", True)
- log("Administrator %s authenticated." %
- self.account.get("name"), 2)
- else:
- log("User %s authenticated for account %s." % (
- self, self.account.subkey), 2)
+ log("Account %s is an administrator." % (
+ self.account.subkey), 2)
def show_menu(self):
"""Send the user their current menu."""
def show_menu(self):
"""Send the user their current menu."""