Mercurial > python-cmd2
comparison cmd2.py @ 291:dfdbd93a2fae
bugfixes to set
author | catherine@bothari |
---|---|
date | Fri, 06 Nov 2009 22:09:57 -0500 |
parents | cd12e4e0fa17 |
children | 23cf05c6276c |
comparison
equal
deleted
inserted
replaced
290:cd12e4e0fa17 | 291:dfdbd93a2fae |
---|---|
852 ''' | 852 ''' |
853 Sets a cmd2 parameter. Accepts abbreviated parameter names so long | 853 Sets a cmd2 parameter. Accepts abbreviated parameter names so long |
854 as there is no ambiguity. Call without arguments for a list of | 854 as there is no ambiguity. Call without arguments for a list of |
855 settable parameters with their values.''' | 855 settable parameters with their values.''' |
856 try: | 856 try: |
857 paramName, val = arg.split(None, 1) | 857 statement, paramName, val = arg.parsed.raw.split(None, 2) |
858 paramName = paramName.strip().lower() | 858 paramName = paramName.strip().lower() |
859 if paramName not in self.settable: | 859 if paramName not in self.settable: |
860 hits = [p for p in self.settable if p.startswith(p)] | 860 hits = [p for p in self.settable if p.startswith(paramName)] |
861 if len(hits) == 1: | 861 if len(hits) == 1: |
862 paramName = hits[0] | 862 paramName = hits[0] |
863 else: | 863 else: |
864 return self.do_show(paramName) | 864 return self.do_show(paramName) |
865 currentVal = getattr(self, paramName) | 865 currentVal = getattr(self, paramName) |