Hi, On Thu, Jan 8, 2009 at 2:24 AM, James Paige <b...@hamsterrepublic.com> wrote: > On Wed, Jan 07, 2009 at 08:00:30PM +1030, David Gowers wrote: >> Here's an update on my progress. >> The attached module works (for the limited subset of file formats it >> currently handles), and contains most of the helper functions and some >> of the dtypes, accessible through a dictionary. Various refactoring >> will need to happen before release on PyPI; for now, I'm still >> migrating code from the doctest into this module while ensuring the >> doctest continues to run in the manner it is accustomed. >> Expected total module size is 20 - 25k >> >> The changes to memmapped-fileformats.rst merely adapt to use this >> module, so I have not included an update for it. > > I've looked over ohrrpgce.py, and it looked slick, but I still need a > little help on using it. I understand I need to use doctests, right? How > do I get started with doctests? I've never used a .rst file before.
No, you don't need to know anything about doctests to use ohrrpgce.py, it's a completely ordinary module. Just import it. The changes to memmapped-fileformats are basically deleting things that are now in ohrrpgce.py, and, at the start of the file, ">>> from ohrrpgce import *". The main feature of ohrrpgce.py is currently the dtypes[] dictionary. typical usage from updated memmapped-fileformats.rst looks like this: from ohrrpgce import * # mmap is a trivial wrapper function defined by ohrrpgce.py. veh = mmap ('viking.veh', dtypes['veh']) As I've mentioned before, I plan to abstract this so you can create an RPGFile instance and then access files in a memmapped way by doing veh = rpgfile['veh'] If you want to learn about doctests, as mentioned before 'nose' (http://somethingaboutorange.com/mrl/projects/nose/) is a good tool when used with the '--with-doctest' option (either in the nose config or on the commandline). > >> In the meantime I've released my module 'ion' >> (http://pypi.python.org/pypi/pyion); mentioning this mainly because >> it's the first thing i've released on PyPI. and also because Pixlab >> depends on it (ohrrpgce.py won't depend on pixlab, and pixlab will >> prove useful if manipulating OHR images or palettes) > > Interesting. I notice the "chain iterator" :) Yeah, it says in the source that's OHR-inspired. I'd prefer a tree iterator, and it's a bit more difficult to work out a good simple convention for passing ordered trees. > >> I've recently begun substituting 'and' where I might typically use >> 'but', since after reading an introduction to Lojban, i realized it is >> indeed used just like the word 'and' with added annoying >> oxymoronicity. > > Wait, and but what? Hehe. (I'm baffled. Is this to do with the fact that 'wait, and and what?' is slightly less nonsensical than 'wait, but but what?'?) David _______________________________________________ Ohrrpgce mailing list ohrrpgce@lists.motherhamster.org http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org