Fixed a typeclass access bug in @find. Resolves issue 199.

This commit is contained in:
Griatch 2011-10-10 09:14:50 +02:00
parent 8d3817ccd4
commit 70b4b559a5
2 changed files with 9 additions and 8 deletions

View file

@ -1719,7 +1719,7 @@ class CmdFind(MuxCommand):
if not low <= int(result.id) <= high: if not low <= int(result.id) <= high:
string += "\n {RNo match found for '%s' within the given dbref limits.{n" % searchstring string += "\n {RNo match found for '%s' within the given dbref limits.{n" % searchstring
else: else:
string += "\n{g %s(%s) - %s{n" % (result.key, result.dbref, result.typeclass) string += "\n{g %s(%s) - %s{n" % (result.key, result.dbref, result.typeclass.path)
else: else:
# Not a player/dbref search but a wider search; build a queryset. # Not a player/dbref search but a wider search; build a queryset.
@ -1749,14 +1749,14 @@ class CmdFind(MuxCommand):
restrictions = ", %s" % (",".join(self.switches)) restrictions = ", %s" % (",".join(self.switches))
if nresults: if nresults:
# convert result to typeclasses. # convert result to typeclasses.
results = [result.typeclass(result) for result in results] results = [result.typeclass for result in results]
if nresults > 1: if nresults > 1:
string = "{w%i Matches{n(#%i-#%i%s):" % (nresults, low, high, restrictions) string = "{w%i Matches{n(#%i-#%i%s):" % (nresults, low, high, restrictions)
for res in results: for res in results:
string += "\n {g%s(%s) - %s{n" % (res.key, res.dbref, res.typeclass) string += "\n {g%s(%s) - %s{n" % (res.key, res.dbref, res.path)
else: else:
string = "{wOne Match{n(#%i-#%i%s):" % (low, high, restrictions) string = "{wOne Match{n(#%i-#%i%s):" % (low, high, restrictions)
string += "\n {g%s(%s) - %s{n" % (results[0].key, results[0].dbref, results[0].typeclass) string += "\n {g%s(%s) - %s{n" % (results[0].key, results[0].dbref, results[0].path)
else: else:
string = "{wMatch{n(#%i-#%i%s):" % (low, high, restrictions) string = "{wMatch{n(#%i-#%i%s):" % (low, high, restrictions)
string += "\n {RNo matches found for '%s'{n" % searchstring string += "\n {RNo matches found for '%s'{n" % searchstring

View file

@ -181,8 +181,10 @@ def create_admin_media_links():
def at_initial_setup(): def at_initial_setup():
""" """
Custom hook for users to overload some or all parts of the initial setup. Called very Custom hook for users to overload some or all parts of the initial
last in the sequence. It tries to import and run a module setup. Called very last in the sequence. It tries to import and
run a module settings.AT_INITIAL_SETUP_HOOK_MODULE and will fail
silently if this does not exist or fails to load.
""" """
try: try:
mod = __import__(settings.AT_INITIAL_SETUP_HOOK_MODULE, fromlist=[None]) mod = __import__(settings.AT_INITIAL_SETUP_HOOK_MODULE, fromlist=[None])
@ -192,7 +194,6 @@ def at_initial_setup():
if mod.__dict__.get("at_initial_setup", None): if mod.__dict__.get("at_initial_setup", None):
mod.at_initial_setup() mod.at_initial_setup()
def handle_setup(last_step): def handle_setup(last_step):
""" """
Main logic for the module. It allows for restarting Main logic for the module. It allows for restarting