Minor cleanups and a fix to manage.py that lead to a traceback if running without arguments.

This commit is contained in:
Griatch 2012-08-22 13:28:38 +02:00
parent f5caab093e
commit 4edde61be4
2 changed files with 10 additions and 11 deletions

View file

@ -165,7 +165,7 @@ if __name__ == "__main__":
# run the standard django manager, if dependencies match # run the standard django manager, if dependencies match
from src.utils.utils import check_evennia_dependencies from src.utils.utils import check_evennia_dependencies
if 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 """ print """
WARNING: There is no need to run the Django development WARNING: There is no need to run the Django development
webserver to test out Evennia web features (the web client webserver to test out Evennia web features (the web client

View file

@ -82,15 +82,15 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
return None return None
return dbref return dbref
@returns_typeclass_list #@returns_typeclass_list
def get_with_attr(self, attribute_name, attribute_value=None): #def get_with_attr(self, attribute_name, attribute_value=None):
""" # """
Returns the typeclassed entity depending on having a given attribute. # 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_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. # attribute_value - if != None, only entities with db.attribute_name=attribute_value will match.
""" # """
self.filter() # self.filter() #TODO not implemented
@returns_typeclass @returns_typeclass
@ -150,5 +150,4 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
if callable(typeclass): if callable(typeclass):
cls = typeclass.__class__ cls = typeclass.__class__
typeclass = "%s.%s" % (cls.__module__, cls.__name__) typeclass = "%s.%s" % (cls.__module__, cls.__name__)
o_query = self.filter(db_typeclass_path__exact=typeclass) return self.filter(db_typeclass_path__exact=typeclass)
return o_query