7

I've got some XML files from which I intend to derive some python source code; they are things like lists of language codes. Does the distribute module have a hook I can plug into for this purpose? To be perhaps clearer, I don't want to ship XML around. I want to only ship .py files. I want to derive some .py files by running a program that generates them from XML.

1
  • Do you want the conversion to be done when the module is loaded or are you planning on doing it some time beforehand in a different step? Commented Oct 1, 2012 at 14:47

1 Answer 1

2

You could create a custom distutils command for your code gen process, or you can override build itself. This would require you to include the XML, though.

I'd probably move the code generation into my local build process, using zc.buildout with a templating recipe like z3c.recipe.template. The XML would then be part of the development build, with only the code generated Python files included in the user distribution.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.