leading whitespace & alias/command expansion
David Clymer <david-LEGOU7lN1jbY0TyS/[email protected]> Thu, 23 Dec 2004 09:48:21 -0500
| Newsgroups | gmane.comp.games.mud.client.lyntin |
|---|---|
| Message-ID | <1103813301.9986.10.camel@localhost> |
I've modified my copy of lyntin to expand commands & aliases regardless
of whether they've got whitespace in front of them:
old behavior:
/test # worked
/test # didnt work
new behavior:
/test # works
/test # works
modifications are below, if anyone is interested.
-davidc
*** commandmanager.py 2004-12-23 09:32:56.000000000 -0500
--- commandmanager.py.orig 2004-12-23 09:24:35.000000000 -0500
***************
*** 236,244 ****
internal = args["internal"]
input = args["dataadj"]
- # get rid of leading whitespace
- input = input.lstrip()
-
commandchar = self._engine.getConfigManager().get("commandchar")
if len(input) > 1 and input.startswith(commandchar):
input = input[1:]
--- 236,241 ----
*** utils.py 2004-12-23 09:16:32.000000000 -0500
--- utils.py.orig 2004-12-23 09:17:34.000000000 -0500
***************
*** 1069,1077 ****
"""
vars = _strip_placement_vars(expansion)
- # get rid of leading whitespace
- input = input.lstrip()
-
if len(vars) > 0:
varlookup = {}
inputsplit = input.split(' ')
--- 1069,1074 ----
*** alias.py 2004-12-23 09:16:34.000000000 -0500
--- alias.py.orig 2004-12-23 08:48:31.000000000 -0500
***************
*** 107,115 ****
@rtype: string
"""
if len(input) > 0:
- # get rid of leading whitespace
- input = input.lstrip()
-
# pull out the first word of the input
firstword = input.split(' ', 1)[0]
--- 107,112 ----
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/