Best practice to parse multiple config files

后端 未结 1 778
执念已碎
执念已碎 2021-01-22 14:29

What would be the best practice - if there is any - to parse multiple config files?

I want to parse the mysql server configuration and also write the configuration again

相关标签:
1条回答
  • 2021-01-22 15:10

    In your pyparsing code, attach a parse action to the expression that matches the include statements, have it parse the contents of the referenced files or directory of files, then merge those results into the current parse output. The parse action would make the successive calls to parseString, your code would only make a single call.

    See this new example added to the pyparsing examples directory: https://github.com/pyparsing/pyparsing/blob/master/examples/include_preprocessor.py

    0 讨论(0)
提交回复
热议问题