i've added 2 new types for the properties in the YAML file so the correct formating and newlines are preserved between loads and dumps. The issue is https://pagure.io/modulemd/issue/40. The PyYAML module will preserve the newlines only when you define the properties you need to preserve as new types. Those types will be than identified by PyYAMLs Dumper as special types with specific options which can be defined in the representer function. I haven't written any tests as the existing tests are covering my use case (according to coverage). I didn't know where to put the new types so i put them in file util.py. I'm open to suggestion if the locations is no good.
Hi All,
i've added 2 new types for the properties in the YAML file so the correct formating and newlines are preserved between loads and dumps. The issue is https://pagure.io/modulemd/issue/40. The PyYAML module will preserve the newlines only when you define the properties you need to preserve as new types. Those types will be than identified by PyYAMLs Dumper as special types with specific options which can be defined in the representer function. I haven't written any tests as the existing tests are covering my use case (according to coverage). I didn't know where to put the new types so i put them in file util.py. I'm open to suggestion if the locations is no good.