From 5fc3a521894950e63cd0ef4a5bdc985a0766bb44 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 25 Jul 2016 10:05:10 +0800 Subject: [PATCH] artiq_flash: expose scripts_path --- 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 7ef99b164..9edebd42e 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -11,6 +11,14 @@ 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 get_argparser(): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, @@ -79,13 +87,6 @@ def main(): raise SystemExit("Binaries directory '{}' does not exist" .format(opts.dir)) - 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)) - conv = False prog = []