コード例 #1
0
ファイル: Remote.py プロジェクト: 15580056814/hue
    def do_int(self, arg):
	# XXX We should really stop other tasks while we use changed stdio files
	# but that seems to be hard to do
	# so this is ok for some practical purposes.
	# --- new note May 8 2005:
	# --- and doesn't matter since we are in a different interpreter -
	# --- so there is no XXX issue ?
	ostdin = sys.stdin
	ostdout = sys.stdout
	ostderr = sys.stderr
	
	try:
            sys.stdin = self.stdin
	    sys.stdout = self.stdout
	    sys.stderr = self.stdout

            con = Console(stdin=sys.stdin,stdout=sys.stdout,
				       locals=self.intlocals)
            con.interact(
                "Remote interactive console. To return to Annex, type %r."%
                con.EOF_key_sequence)



	finally:
	    sys.stdin = ostdin
	    sys.stdout = ostdout
	    sys.stderr = ostderr
コード例 #2
0
ファイル: Remote.py プロジェクト: yueyub/guppy3
    def do_int(self, arg):
        # XXX We should really stop other tasks while we use changed stdio files
        # but that seems to be hard to do
        # so this is ok for some practical purposes.
        # --- new note May 8 2005:
        # --- and doesn't matter since we are in a different interpreter -
        # --- so there is no XXX issue ?
        ostdin = sys.stdin
        ostdout = sys.stdout
        ostderr = sys.stderr

        try:
            sys.stdin = self.stdin
            sys.stdout = self.stdout
            sys.stderr = self.stdout

            con = Console(stdin=sys.stdin,
                          stdout=sys.stdout,
                          locals=self.intlocals)
            con.interact(
                "Remote interactive console. To return to Annex, type %r." %
                con.EOF_key_sequence)

        finally:
            sys.stdin = ostdin
            sys.stdout = ostdout
            sys.stderr = ostderr
コード例 #3
0
    def do_int(self, arg):
	try:
	    con = Console(stdin=self.stdin,stdout=self.stdout,
				       locals=self.__dict__)
	    con.interact(
                "Local interactive console. To return to Monitor, type %r."%
                         con.EOF_key_sequence)

	finally:
	    pass