WriteParameterFile: Orders of entries
Hello,
I use pyFoam's WriteParameterFile to write to the files in 0 directory (U, p, ...) Code:
field_file = WriteParameterFile(field_name), className=_OF_units[field_name][1]) Is there a way to change the order? It have to, cause the pyFoamCaseBuilder uses the "correct" order. (though python dictionaries do not have any order...) Thanks! Ok, kind of an addendum. I found that piece of code: Code:
if type(dic)==DictProxy: |
Quote:
self.content={} should be replaced with self.content=DictProxy() DictProxy is a wrapper around a regular dictionary whose purpose it is to preserve the order of the entries (and preserve comments) and for purposes of output it will order the entries in the order they were added Let me know if the fix works for you and I'll add it to the next release |
I have worked around it in another way.
After writing the internalField and dimensions I close the file and reopen it (as ParsedParameterFile). This keeps the entries so far in order that the ones that already existed are kept on top. |
Quote:
|
All times are GMT -4. The time now is 19:20. |