From 256fe819eeaf93d7882f6b93372f6e2254beab13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 17 Aug 2015 16:25:11 +0200 Subject: Fix relative path to .target file .target file should load always from root folder of project to ensure, that all tools in project are targeting same target. --- conf.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conf.py b/conf.py index c2f1902..b4b8179 100644 --- a/conf.py +++ b/conf.py @@ -126,13 +126,16 @@ write_config = 'scripts/write_config/write_config' picosat = 'scripts/picosat-959/picosat' allconfig = 'scripts/allconfig/allconfig' +####################################### +absroot = os.path.dirname(os.path.realpath(__file__)) + ####################################### # Overlap configuration for specified target -if os.path.isfile('.target'): +if os.path.isfile(os.path.join(absroot, '.target')): target = None - with open('.target', 'r') as f: + with open(os.path.join(absroot, '.target'), 'r') as f: target = f.readline().rstrip() - conffile = os.path.join('targets', target, 'conf.py') + conffile = os.path.join(absroot, 'targets', target, 'conf.py') if os.path.isfile(conffile): ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module() for name in dir(ovconf): @@ -142,6 +145,3 @@ if os.path.isfile('.target'): print("W: No target specifier. Write target to .target file.") else: print("W: No target specifier. Write target to .target file.") - -####################################### -absroot = os.path.dirname(os.path.realpath(__file__)) -- cgit v1.2.3