[Patches] [ python-Patches-558544 ] cmd.py: add instance-specific stdin/out

noreply@sourceforge.net noreply@sourceforge.net
Mon, 20 May 2002 22:45:14 -0700


Patches item #558544, was opened at 2002-05-21 15:45
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=558544&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Anthony Baxter (anthonybaxter)
Assigned to: Nobody/Anonymous (nobody)
Summary: cmd.py: add instance-specific stdin/out

Initial Comment:
The following patch adds stdin, stdout as optional
arguments to the cmd.Cmd constructor (defaulting to
sys.stdin, sys.stdout), and changes the Cmd methods
throughout to use self.stdout.write() and 
self.stdin.foo for output and input. This allows much
greater flexibility for using cmd - for instance, 
hooking it into a telnet server. And if the response
is YAGNI, well, actually, IAGNI, because it's in use
today (and for the last year). :)

If this is acceptable, I'll provide a documentation
patch as well.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=558544&group_id=5470