From 653eee071ddc2a1b0295d2141258d8e0425e644f Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Thu, 26 Jan 2017 17:53:33 +0100 Subject: [PATCH] artiq_flash: make scripts_path a function (for doc generating) --- artiq/frontend/artiq_flash.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 9edebd42e..a04d2ef06 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -11,12 +11,13 @@ from artiq import __artiq_dir__ as artiq_dir from artiq.frontend.bit2bin import bit2bin -scripts_path = ["share", "openocd", "scripts"] -if os.name == "nt": - scripts_path.insert(0, "Library") -scripts_path = os.path.abspath(os.path.join( - os.path.dirname(shutil.which("openocd")), - "..", *scripts_path)) +def scripts_path(): + scripts_path = ["share", "openocd", "scripts"] + if os.name == "nt": + scripts_path.insert(0, "Library") + scripts_path = os.path.abspath(os.path.join( + os.path.dirname(shutil.which("openocd")), + "..", *scripts_path)) def get_argparser(): @@ -139,7 +140,7 @@ def main(): target_file = opts.target_file subprocess.check_call([ "openocd", - "-s", scripts_path, + "-s", scripts_path(), "-f", target_file, "-c", "; ".join(prog), ])