[0.2.x] fixed : IPython integrations bugs

git-svn-id: https://pykd.svn.codeplex.com/svn@85811 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-10-17 12:38:32 +00:00 committed by Mikhail I. Izmestev
parent feb9e84a6e
commit fd89d45dfe
3 changed files with 30 additions and 5 deletions

View File

@ -135,9 +135,13 @@ BOOST_PYTHON_MODULE( pykd )
// Python debug output console helper classes
python::class_<DbgOut>( "dout", "dout", python::no_init )
.def( "write", &DbgOut::write );
python::class_<DbgErr>( "dout", "dout", python::no_init )
.def( "write", &DbgErr::write );
.def( "write", &DbgOut::write )
.def( "flush", &DbgOut::flush )
.add_property( "encoding", &DbgOut::encoding );
python::class_<DbgErr>( "derr", "derr", python::no_init )
.def( "write", &DbgErr::write )
.def( "flush", &DbgOut::flush )
.add_property( "encoding", &DbgErr::encoding );
python::class_<DbgIn>( "din", "din", python::no_init )
.def( "readline", &DbgIn::readline )
.add_property( "encoding", &DbgIn::encoding );

View File

@ -17,6 +17,13 @@ public:
dprint( str );
}
void flush() {
}
std::string
encoding() {
return "ascii";
}
};
///////////////////////////////////////////////////////////////////////////////
@ -30,6 +37,14 @@ public:
{
eprint( str );
}
void flush() {
}
std::string
encoding() {
return "ascii";
}
};
///////////////////////////////////////////////////////////////////////////////

View File

@ -1,14 +1,20 @@
from IPython.config.loader import Config
from IPython.terminal.embed import InteractiveShellEmbed
from pykd import *
from IPython.terminal.interactiveshell import TerminalInteractiveShell
import pykd
cfg = Config()
cfg.InteractiveShell.colors = 'NoColor'
cfg.InteractiveShell.readline_use = False
cfg.InteractiveShell.autoindent = True
cfg.PromptManager.in_template = 'In <\\#>: '
cfg.PromptManager.in2_template = ' .\\D.: '
cfg.PromptManager.out_template = 'Out<\\#>: '
ipshell = InteractiveShellEmbed(config=cfg)
ipshell()
ipshell()