Refactor code for readability and compatibility.

This commit is contained in:
Griatch 2017-01-27 00:19:27 +01:00
parent a09835049b
commit c6d9c0619e
43 changed files with 129 additions and 112 deletions

View file

@ -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

View file

@ -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,

View file

@ -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)