From 4edde61be4b687387f8070316026a11a944c26e1 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 22 Aug 2012 13:28:38 +0200 Subject: [PATCH] Minor cleanups and a fix to manage.py that lead to a traceback if running without arguments. --- game/manage.py | 2 +- src/typeclasses/managers.py | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/game/manage.py b/game/manage.py index fe54d4246..3604fb31b 100755 --- a/game/manage.py +++ b/game/manage.py @@ -165,7 +165,7 @@ if __name__ == "__main__": # run the standard django manager, if dependencies match from src.utils.utils import check_evennia_dependencies if check_evennia_dependencies(): - if sys.argv[1] in ('runserver', 'testserver'): + if len(sys.argv) > 1 and sys.argv[1] in ('runserver', 'testserver'): print """ WARNING: There is no need to run the Django development webserver to test out Evennia web features (the web client diff --git a/src/typeclasses/managers.py b/src/typeclasses/managers.py index f0bb46d89..1badeefc1 100644 --- a/src/typeclasses/managers.py +++ b/src/typeclasses/managers.py @@ -82,15 +82,15 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager): return None return dbref - @returns_typeclass_list - def get_with_attr(self, attribute_name, attribute_value=None): - """ - Returns the typeclassed entity depending on having a given attribute. + #@returns_typeclass_list + #def get_with_attr(self, attribute_name, attribute_value=None): + # """ + # Returns the typeclassed entity depending on having a given attribute. - attribute_name - only entities with an attribute of this name will be included in match - attribute_value - if != None, only entities with db.attribute_name=attribute_value will match. - """ - self.filter() + # attribute_name - only entities with an attribute of this name will be included in match + # attribute_value - if != None, only entities with db.attribute_name=attribute_value will match. + # """ + # self.filter() #TODO not implemented @returns_typeclass @@ -150,5 +150,4 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager): if callable(typeclass): cls = typeclass.__class__ typeclass = "%s.%s" % (cls.__module__, cls.__name__) - o_query = self.filter(db_typeclass_path__exact=typeclass) - return o_query + return self.filter(db_typeclass_path__exact=typeclass)