Refactor code for readability and compatibility.
This commit is contained in:
parent
a09835049b
commit
c6d9c0619e
43 changed files with 129 additions and 112 deletions
|
|
@ -139,6 +139,7 @@ class ScriptDB(TypedObject):
|
|||
try:
|
||||
value = _GA(value, "dbobj")
|
||||
except AttributeError:
|
||||
# deprecated ...
|
||||
pass
|
||||
if isinstance(value, (basestring, int)):
|
||||
from evennia.objects.models import ObjectDB
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class ScriptHandler(object):
|
|||
repeats = script.repeats
|
||||
try:
|
||||
next_repeat = script.time_until_next_repeat()
|
||||
except:
|
||||
except Exception:
|
||||
next_repeat = "?"
|
||||
string += _("\n '%(key)s' (%(next_repeat)s/%(interval)s, %(repeats)s repeats): %(desc)s") % \
|
||||
{"key": script.key, "next_repeat": next_repeat,
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class ExtendedLoopingCall(LoopingCall):
|
|||
if self.start_delay:
|
||||
self.start_delay = None
|
||||
self.starttime = self.clock.seconds()
|
||||
super(ExtendedLoopingCall, self).__call__()
|
||||
LoopingCall.__call__(self)
|
||||
|
||||
def force_repeat(self):
|
||||
"""
|
||||
|
|
@ -210,6 +210,7 @@ class DefaultScript(ScriptBase):
|
|||
try:
|
||||
self.db_obj.msg(estring)
|
||||
except Exception:
|
||||
# we must not crash inside the errback, even if db_obj is None.
|
||||
pass
|
||||
logger.log_err(estring)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue