Re: leading whitespace & alias/command expansion

will guaraldi <[email protected]> Thu, 23 Dec 2004 09:00:06 -0600 (CST)
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <[email protected]>
Out of curiosity, why do you have commands with whitespace in front of 
them?  Is it a typo issue or are you trying to do something else that is 
causing problems?  Where's this problem stemming from?

/will


On Thu, 23 Dec 2004, David Clymer wrote:
> 
> 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/
> _______________________________________________
> Lyntin-devl mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lyntin-devl
>

-- 
whatever it is, you can find it at http://www.bluesock.org/~willg/
except Will--you can only see him in real life.


-------------------------------------------------------
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/