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.

This commit is contained in:
Griatch 2009-05-01 07:16:44 +00:00
parent ba623af351
commit cae925c29b
3 changed files with 10 additions and 10 deletions

View file

@ -135,8 +135,8 @@ class ExtendedANSIParser(MuxANSIParser):
(r'{n', normal) #reset (r'{n', normal) #reset
] ) ] )
ANSI_PARSER = MuxANSIParser() #ANSI_PARSER = MuxANSIParser()
#ANSI_PARSER = ExtendedANSIParser() ANSI_PARSER = ExtendedANSIParser()
def parse_ansi(string, strip_ansi=False, strip_formatting=False, parser=ANSI_PARSER): def parse_ansi(string, strip_ansi=False, strip_formatting=False, parser=ANSI_PARSER):
""" """

View file

@ -810,7 +810,7 @@ def cmd_recover(command):
Recovers @destroyed non-player objects. Recovers @destroyed non-player objects.
Usage: Usage:
@recover [dbref [,dbref2, etc]] @recover[/switches] [obj [,obj2, ...]]
switches: switches:
ROOM - recover as ROOM type instead of THING 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. 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 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). 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 Note that exits linked to @destroyed rooms will not be automatically recovered
to its former state, you have to @recover those objects manually. 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 Objects are returned as type THING if the object type is not explicitly set using the
switches /ROOM or /EXIT is given. Note that recovering an item as the wrong type will switches. Note that recovering an item as the wrong type will most likely make it
most likely make it nonfunctional. nonfunctional.
""" """
source_object = command.source_object source_object = command.source_object

View file

@ -205,7 +205,7 @@ class ObjectManager(models.Manager):
dbref_only: (bool) Only compare dbrefs. dbref_only: (bool) Only compare dbrefs.
limit_types: (list of int) A list of Object type numbers to filter by. 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 # This is a global dbref search. Not applicable if we're only searching
# searcher's contents/locations, dbref comparisons for location/contents # searcher's contents/locations, dbref comparisons for location/contents