I have a file __manifest__.py
in which I have a python dict :
{
'name': "example",
'verbose_name': "Example",
'version': "0.1",
'summary': "This is a summary",
'description': """
This
is
a
multiline
description
""",
'some_other_attr': True
}
And I'd like to be able to open it and transform its content in a regular python dict. I'm already able to open it :
manifest = open(path_to_manifest, 'r')
where path_to_manifest
is the..path to the manifest. And also to read it :
manifest_content = manifest.read()
The thing is that it returns obviously a string :
print('manifest_content : ' + str(manifest_content))
manifest_content : {
'name': "example",
'verbose_name': "Example",
'version': "0.1",
'summary': "This is a summary",
'description': """
This
is
a
multiline
description
""",
'some_other_attr': True
}
And I want to be able to transform this content into a python dict.
I know you will probably tell me about json
and json.loads()
but this doesn't support multiline as my description
is. How could I achieve that ?
Thanks in advance for your help