Benji York wrote:
--- begin quote ---
Contents of myfile.zcml::
<configure xmlns="http://namespaces.zope.org/zope"> blah blah blah </configure>
.. -> config
>>> import tmpfile >>> f = tmpfile.mkstemp() >>> f.write(config) >>> f.close()
Okay, but this looks like I'd have to write the above every time I wanted to save a file *and* the saving code would show in the docs, or am I missing something?
I could imagine a plug-in that understood the Sphinx ".. literalinclude:: example.file" directive and made the included lines available in a variable. That might be handy when you *really* want to keep a file on-disk but still include part or all of it in a document.
I kind-of want the opposite of that. I want an easy, clean way to write chunks from my docs to files in a temporary directory such that the code being tested/documented can get at them. This is for testing things that inherently run on files (eg: zc.buildout recipies and the like). In fact, thinking about it, it'd be great if there were two plugins: - one to write files that code being tested could access from disk - one to read files that code being tested had output and check their contents were as expected. Do you see what I mean? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk