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

noreply@sourceforge.net noreply@sourceforge.net
Wed, 05 Jun 2002 18:20:40 -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.


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

>Comment By: Anthony Baxter (anthonybaxter)
Date: 2002-06-06 11:20

Message:
Logged In: YES 
user_id=29957

damn. here's patch

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-06-02 22:45

Message:
Logged In: YES 
user_id=21627

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

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

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