forked from M-Labs/artiq
artiq_flash: make scripts_path a function (for doc generating)
This commit is contained in:
parent
b4df00009b
commit
d16f5ce540
|
@ -11,12 +11,13 @@ from artiq import __artiq_dir__ as artiq_dir
|
||||||
from artiq.frontend.bit2bin import bit2bin
|
from artiq.frontend.bit2bin import bit2bin
|
||||||
|
|
||||||
|
|
||||||
scripts_path = ["share", "openocd", "scripts"]
|
def scripts_path():
|
||||||
if os.name == "nt":
|
scripts_path = ["share", "openocd", "scripts"]
|
||||||
scripts_path.insert(0, "Library")
|
if os.name == "nt":
|
||||||
scripts_path = os.path.abspath(os.path.join(
|
scripts_path.insert(0, "Library")
|
||||||
os.path.dirname(shutil.which("openocd")),
|
scripts_path = os.path.abspath(os.path.join(
|
||||||
"..", *scripts_path))
|
os.path.dirname(shutil.which("openocd")),
|
||||||
|
"..", *scripts_path))
|
||||||
|
|
||||||
|
|
||||||
def get_argparser():
|
def get_argparser():
|
||||||
|
@ -139,7 +140,7 @@ def main():
|
||||||
target_file = opts.target_file
|
target_file = opts.target_file
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
"openocd",
|
"openocd",
|
||||||
"-s", scripts_path,
|
"-s", scripts_path(),
|
||||||
"-f", target_file,
|
"-f", target_file,
|
||||||
"-c", "; ".join(prog),
|
"-c", "; ".join(prog),
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in New Issue