Mercurial > python-cmd2
comparison cmd2.py @ 214:68c03076c9e7
multiple connections
author | catherine@Elli.myhome.westell.com |
---|---|
date | Mon, 16 Mar 2009 02:46:57 -0400 |
parents | 500955dece3f |
children | e9091d9a3a60 |
comparison
equal
deleted
inserted
replaced
213:500955dece3f | 214:68c03076c9e7 |
---|---|
79 print e | 79 print e |
80 optionParser.print_help() | 80 optionParser.print_help() |
81 return | 81 return |
82 if hasattr(opts, '_exit'): | 82 if hasattr(opts, '_exit'): |
83 return None | 83 return None |
84 terminator = arg.parsed.terminator | 84 if hasattr(arg, 'parser'): |
85 try: | 85 terminator = arg.parsed.terminator |
86 if arg.parsed.terminator[0] == '\n': | 86 try: |
87 terminator = arg.parsed.terminator[0] | 87 if arg.parsed.terminator[0] == '\n': |
88 except IndexError: | 88 terminator = arg.parsed.terminator[0] |
89 pass | 89 except IndexError: |
90 arg = arg.parser('%s %s%s%s' % (arg.parsed.command, newArgs, terminator, arg.parsed.suffix)) | 90 pass |
91 arg = arg.parser('%s %s%s%s' % (arg.parsed.command, newArgs, | |
92 terminator, arg.parsed.suffix)) | |
93 else: | |
94 arg = newArgs | |
91 result = func(instance, arg, opts) | 95 result = func(instance, arg, opts) |
92 return result | 96 return result |
93 newFunc.__doc__ = '%s\n%s' % (func.__doc__, optionParser.format_help()) | 97 newFunc.__doc__ = '%s\n%s' % (func.__doc__, optionParser.format_help()) |
94 return newFunc | 98 return newFunc |
95 return option_setup | 99 return option_setup |