Stripping leading spaces

sirperc-/[email protected] Fri, 13 Jan 2006 17:46:05 +0000
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <[email protected]>
Hi All,

I have been writing some aliases, triggers and so forth.
I have had to create some ugly scripts, somewhat like 
#alias {speedwalk} {#if {$$SPEEDWALKING == 0} {#ws.slowwalk;#schedule {1} {mib.dospeedwalk}}}

One of the ugly things here, is that after a ';' character, if you wish
to do a command, using the commandchar, it must immedietely follow the
semicolon, spaces aren;t stripped.
So i thought about having a look in the source code to enable space
stripping on a line of input, and removing any leading spaces.

I notice that there is already a line of code which does it, but is
commented out, as follows...
commandchar = self._managers["config"].get("commandchar")
  for mem in inputlist:
    # mem = mem.strip()

Is there a reason why this has been commented out.  the only thing I can
think of, is that it stops you sending leading spaces to the mud if you
wanted to, say if your using an embedded programming environment or
anyhting that might want them.

Anyway, I may look at changing the parsing the semicolon to remove any
spaces after it before submitting it to the engines parser, which is the
alternative method.  You'd still not be able to type any commands with a
space in front at the gui itself, but aliases / scripts would be able to
have spaces after the semi colon to tighten things up.

Hope that makes sense to you all.
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDx+ddSZYa/GLlf2ARAu/OAKDstPrnu7wE0HU19rmsAEmGuOnsmwCeJ/lk
KVJefiwACFRFvf36dsBpx2k=
=KqVC
-----END PGP SIGNATURE-----