diff options
author | lloyd <[email protected]> | 2006-08-23 05:54:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-08-23 05:54:19 +0000 |
commit | d3330b40d3cb5960afd7a14cf1b0c8ff949216e1 (patch) | |
tree | 76a36a61c3fa5191232a511c8f4fcb6a6e37c5d9 /misc/python | |
parent | dec0804ab37ef874b1f7888164025e1c8c0d71cc (diff) |
Export Pipe::read_all_as_string simply as read_all, since strings are how
binary data is handled in Python.
Export Pipe::process_msg()
Diffstat (limited to 'misc/python')
-rw-r--r-- | misc/python/src/filter.cpp | 4 | ||||
-rwxr-xr-x | misc/python/test.py | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/misc/python/src/filter.cpp b/misc/python/src/filter.cpp index fe28cb3c4..46e929fc9 100644 --- a/misc/python/src/filter.cpp +++ b/misc/python/src/filter.cpp @@ -91,6 +91,7 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(rallas_ovls, read_all_as_string, 0, 1) void export_pipe() { void (Pipe::*pipe_write_str)(const std::string&) = &Pipe::write; + void (Pipe::*pipe_process_str)(const std::string&) = &Pipe::process_msg; class_<Pipe, boost::noncopyable>("PipeObj") .def(init<>()) @@ -106,5 +107,6 @@ void export_pipe() .def("start_msg", &Pipe::start_msg) .def("end_msg", &Pipe::end_msg) .def("write", pipe_write_str) - .def("read_all_as_string", &Pipe::read_all_as_string, rallas_ovls()); + .def("process_msg", pipe_process_str) + .def("read_all", &Pipe::read_all_as_string, rallas_ovls()); } diff --git a/misc/python/test.py b/misc/python/test.py index 1aff5894f..e2f1e61fa 100755 --- a/misc/python/test.py +++ b/misc/python/test.py @@ -11,19 +11,15 @@ def encrypt(input): pipe.write(input) pipe.end_msg() - return pipe.read_all_as_string() + return pipe.read_all() def decrypt(input): pipe = botan.Pipe(botan.Filter("Hex_Decoder"), - botan.Filter("ARC4", key = botan.SymmetricKey("AABB"))) - pipe.start_msg() - pipe.write(input) - pipe.end_msg() - - return pipe.read_all_as_string() + pipe.process_msg(input) + return pipe.read_all() def main(): ciphertext = encrypt("hi chappy") |