From cae925c29bac28ff09da17202f8ba257e606d5f9 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 1 May 2009 07:16:44 +0000 Subject: [PATCH] Made so the local_and_global_search strips the query of surrounding whitespace. Many calling functions don't do this properly, making it a source of bugs. E.g. "@desc obj = text" did not locate obj but "@desc obj= text" did. --- src/ansi.py | 4 ++-- src/commands/objmanip.py | 14 +++++++------- src/objects/managers/object.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ansi.py b/src/ansi.py index d4ab08e5e3..6e0f2a7261 100755 --- a/src/ansi.py +++ b/src/ansi.py @@ -135,8 +135,8 @@ class ExtendedANSIParser(MuxANSIParser): (r'{n', normal) #reset ] ) -ANSI_PARSER = MuxANSIParser() -#ANSI_PARSER = ExtendedANSIParser() +#ANSI_PARSER = MuxANSIParser() +ANSI_PARSER = ExtendedANSIParser() def parse_ansi(string, strip_ansi=False, strip_formatting=False, parser=ANSI_PARSER): """ diff --git a/src/commands/objmanip.py b/src/commands/objmanip.py index 210872ba40..e1bd35f23f 100644 --- a/src/commands/objmanip.py +++ b/src/commands/objmanip.py @@ -810,7 +810,7 @@ def cmd_recover(command): Recovers @destroyed non-player objects. Usage: - @recover [dbref [,dbref2, etc]] + @recover[/switches] [obj [,obj2, ...]] switches: ROOM - recover as ROOM type instead of THING @@ -818,15 +818,15 @@ def cmd_recover(command): If no argument is given, a list of all recoverable objects will be given. - Objects scheduled for destruction with the @destroy command is cleaned out + Objects scheduled for destruction with the @destroy command are cleaned out by the game at regular intervals. Up until the time of the next cleanup you can recover the object using this command (use @ps to check when the next cleanup is due). - Note that exits and objects in @destroyed rooms will not be automatically recovered - to its former state, you have to @recover those objects manually. + Note that exits linked to @destroyed rooms will not be automatically recovered + to its former state, you have to @recover those manually. - The object type is forgotten, so the object is returned as type ITEM if not the - switches /ROOM or /EXIT is given. Note that recovering an item as the wrong type will - most likely make it nonfunctional. + Objects are returned as type THING if the object type is not explicitly set using the + switches. Note that recovering an item as the wrong type will most likely make it + nonfunctional. """ source_object = command.source_object diff --git a/src/objects/managers/object.py b/src/objects/managers/object.py index 2e26f37f78..e420eaae53 100644 --- a/src/objects/managers/object.py +++ b/src/objects/managers/object.py @@ -205,7 +205,7 @@ class ObjectManager(models.Manager): dbref_only: (bool) Only compare dbrefs. limit_types: (list of int) A list of Object type numbers to filter by. """ - search_query = ostring + search_query = str(ostring).strip() # This is a global dbref search. Not applicable if we're only searching # searcher's contents/locations, dbref comparisons for location/contents