please note that this is not a python question. I have multiple directories (around 500 directories, called modules) which include a __manifest__.py
file each. this file is considered as a metadata of the module. the file looks like the following:
{
'name': 'Associations Management',
'version': '0.1',
'category': 'Marketing',
'depends': [
'base_setup',
'membership',
'event'
],
'data': ['views/views.xml'],
'demo': [],
'installable': True,
'auto_install': False,
}
I'd like to match & extract (using Linux shell only) a pattern which could be as following:
'depends': ['base', 'web],
// or multi-line as
"depends": [
'base',
'web',
]
I am really interested in extracting such information using Linux commands such as grep
or sed
or awk
& I'm not interested in evaluating each file using python interpreter. so I used the following Linux command
find . -iname __manifest__.py | xargs -I{} grep -H -E "('|\")depends('|\")(.?|\n)*\]\s*," {}
however my regex doesn't provide me with multi-line selection. also I am worried about matching more lines that are not needed as following:
'depends': [
'base_setup',
'membership',
'event'
],
'data': ['views/views.xml'],
thank you