Coming back to this ancient thread...

Benji York wrote:
> A helper function could be written to shorten it to something like this:
> 
> --- begin quote ---
> 
> Contents of myfile.zcml::
> 
>    <configure xmlns="http://namespaces.zope.org/zope";>
>    blah blah blah
>    </configure>
> 
> .. -> config
> 
>     >>> file_name = temp_file_helper(config)
>     >>> zope.configuration.xmlconfig.file(file_name)
> 

What I'd really like to do is write a Manuel plugin that will be part of 
testfixtures' [1] TempDirectory and would handle the following:

.. topic:: some/dir/myfile.py
   :class: file

    ::

         class MyClass:
            def something(self):
               pass

...to write the file.

> --- begin quote ---
> 
> Contents of myfile.zcml::
> 
>    <configure xmlns="http://namespaces.zope.org/zope";>
>    blah blah blah
>    </configure>
> 
> .. -> config
> 
>     >>> file, file_name = make_a_named_temp_file()
>     >>> generate_a_file(fn)
>     >>> file.read() == config
>     True

...and:

.. topic:: some/dir/myfile.py
   :class: expected-file

    ::

         class MyClass:
            def something(self):
               pass

...to check it exists and matches what should be there, emitting 
meaningful error messages if things are wrong.

Aside from looking at manuel.capture, can you give me any pointers as to 
what I'd need to write to make all the above happen?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to