diff --git a/src/objects/manager.py b/src/objects/manager.py index 742c86ee52..45e10a8445 100644 --- a/src/objects/manager.py +++ b/src/objects/manager.py @@ -8,7 +8,8 @@ from src.typeclasses.managers import TypedObjectManager from src.typeclasses.managers import returns_typeclass, returns_typeclass_list from src.utils import utils from src.utils.utils import to_unicode -from src.utils import logger + +ObjAttribute = None __all__ = ("ObjectManager",) @@ -104,11 +105,13 @@ class ObjectManager(TypedObjectManager): """ Returns all objects having the given attribute_name defined at all. """ - from src.objects.models import ObjAttribute + global _ObjAttribute + if not ObjAttribute: + from src.objects.models import ObjAttribute as _ObjAttribute lstring = "" if location: lstring = ", db_obj__db_location=location" - attrs = eval("ObjAttribute.objects.filter(db_key=attribute_name%s)" % lstring) + attrs = eval("_ObjAttribute.objects.filter(db_key=attribute_name%s)" % lstring) return [attr.obj for attr in attrs] @returns_typeclass_list @@ -118,7 +121,9 @@ class ObjectManager(TypedObjectManager): attrname set to the given value. Note that no conversion is made to attribute_value, and so it can accept also non-strings. """ - from src.objects.models import ObjAttribute + global _ObjAttribute + if not ObjAttribute: + from src.objects.models import ObjAttribute as _ObjAttribute lstring = "" if location: lstring = ", db_obj__db_location=location" diff --git a/src/server/initial_setup.py b/src/server/initial_setup.py index 1a3c3f6234..92f9415b4b 100644 --- a/src/server/initial_setup.py +++ b/src/server/initial_setup.py @@ -211,7 +211,7 @@ def reset_server(): It also checks so the warm-reset mechanism works as it should. """ from src.server.sessionhandler import SESSIONS - print _(" Initial setup finished. Resetting/Reloading Server.") + print _(" Initial setup complete. Resetting/reloading Server.") SESSIONS.server.shutdown(mode='reset') def handle_setup(last_step): diff --git a/src/utils/ansi.py b/src/utils/ansi.py index 24f6f8b18c..511f6d6d99 100644 --- a/src/utils/ansi.py +++ b/src/utils/ansi.py @@ -129,6 +129,15 @@ class ANSIParser(object): (r'(?