Accessing context from finalizeFunction
Thank you for the appy.pod module, it's really useful.
I am a structural engineer trying to automate some repetitive design calculations. So I have some python classes and functions that do the actual calculations and would like to find a way to generate a writer document documenting the calcs.
I was really happy to find appy.pod, I can make it work for a general document but when I have formula that I normally type with math directly within writer I am stuck as I can't insert fields in there.
Then I realised that each formula was an object inside the odt zippedfile filed in a folder named "Object x" with x a number. I discovered the finalizeFunction and managed to list the relevant directories and files with this function passed to finalizeFunction
def postprocess(path):
...: import glob,fnmatch,os
...: for dirobj in (glob.glob(
...: listxml = fnmatch.
...: print dirobj , " = ",listxml
I thought well in my formula in the odt template, I will write my variables as $variablename$ and will replace them doing some postprocessing with the finalizeFunction. When I tried to access context to access the variables that I had passed through renderer, I realised that they were not in the scope...
So I am stuck, any idea how I could access the context variables from within this function? Alternatively any way to have variables in my formulae that can be updated by appy.pod ?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Appy Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Gaëtan Delannay
- Solved:
- Last query:
- Last reply: