I'm currently using the code below to find a configuration file in the current project
kRootPath = os.path.dirname(os.path.abspath(__file__))
kConfRootPath = os.path.join(kRootPath, '..', 'ConfigFiles' )
This currently works for my original project. I now have multiple projects that want to use this include file. I need the location of the file that called the include instead of the include itself.
Details:
Project 1
Config
1a.cfg
1b.cfg
Code
code1a.py
code1b.py
theInclude.py
Project 2
Config
2a.cfg
2b.cfg
Code
code2a.py
code2b.py
If all code files include theInclude.py then the include file should return the configure Path for:
- project 1 if included from code1a.py or code1b.py
- project 2 if included from code2a.py or code2b.py