Upgrade dictionnaries to upper version
All dictionnaries has a format version number. When a new format version is proposed, it is possible to automatically convert the files to the new version.
We create a term:structure file named dict/01-upgrade.yml with version 1.0:
---
version: '1.0'
my_variable:
multi: true
my_dyn_family:
type: "dynamic"
variable: my_variable
a_variable:
>>> from rougail import RougailUpgrade, RougailConfig
>>> RougailConfig['main_structural_directories'] = ['dict']
>>> upgrade = RougailUpgrade()
>>> upgrade.load_dictionaries('dict_converted')
The term:structure file named dict_converted/01-upgrade.yml is in version 1.1:
version: '1.1'
my_variable:
multi: true
my_dyn_family:
type: dynamic
a_variable: null
dynamic:
type: variable
variable: my_variable
propertyerror: false