Commit graph

15 commits

Author SHA1 Message Date
Jason Paryani
83e30f5a30 Add from_dict 2013-09-03 01:00:52 -07:00
Jason Paryani
c900690b96 Fix bug in exception handling for which(). Also standardize exceptions
to always be ValueError. Add the beginnings of to_dict()
2013-09-03 00:25:32 -07:00
Jason Paryani
891f0d28e5 Change import hook to require modules to end in '_capnp' 2013-09-01 23:55:29 -07:00
Jason Paryani
98c9b959f7 Fix up bug with import hook on python3/pypy 2013-09-01 22:24:46 -07:00
Jason Paryani
5600f9939a Add import monkey patch function 2013-09-01 21:31:39 -07:00
Jason Paryani
1317527893 Change naming for functions to conform to PEP 8. Also deprecate old
read/write api.
2013-09-01 20:10:57 -07:00
Jason Paryani
6fcdf841e4 Update preferred method for reading/writing messages from files 2013-09-01 02:13:19 -07:00
Kenton Varda
1cfea9c846 Add shortcuts for reading from / writing to files. In Python, it doesn't make much sense to force people to muck around with MessageReaders and MessageBuilders since everything is landing on the heap anyway. Instead, let's make it easy: MyType.read[Packed]From(file) reads a file and returns a MyType reader. MyType.newMessage() returns a MyType builder representing the root of a new message. You can call this builder's write[Packed]To(file) method to write it to a file. 2013-08-31 18:19:02 -07:00
Kenton Varda
86b742e91d Wrap MessageBuilder::setRoot(). 2013-08-31 17:07:44 -07:00
Kenton Varda
0478ee3081 Add tests based on TestAllTypes from the C++ test.capnp. Fix problems uncovered in capnp.pyx. Requires capnproto-c++-0.3.0-rc5, as I found a bug in the base library. 2013-08-31 16:44:54 -07:00
Jason Paryani
76796f8d75 Add forgotten test files 2013-08-29 21:12:39 -07:00
Jason Paryani
f7fbe5bdb3 Change load to use a global SchemaParser. Make structs settable as field 2013-08-29 21:03:00 -07:00
Jason Paryani
add49178f2 Add regression test 2013-08-29 16:45:31 -07:00
Jason Paryani
397357110d Fix tests 2013-08-28 23:29:48 -07:00
Jason Paryani
892e87b747 Add initial tests 2013-08-28 23:13:38 -07:00