mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-21 09:26:29 +08:00
artiq_run: use "artiq_run_" as user code module prefix, not "file_import_".
This commit is contained in:
parent
edf33f1643
commit
6b8ef8c490
@ -92,7 +92,7 @@ def _build_experiment(dmgr, pdb, rdb, args):
|
|||||||
"for ELF kernels")
|
"for ELF kernels")
|
||||||
return ELFRunner(dmgr, pdb, rdb, file=args.file)
|
return ELFRunner(dmgr, pdb, rdb, file=args.file)
|
||||||
else:
|
else:
|
||||||
module = file_import(args.file)
|
module = file_import(args.file, prefix="artiq_run_")
|
||||||
file = args.file
|
file = args.file
|
||||||
else:
|
else:
|
||||||
module = sys.modules["__main__"]
|
module = sys.modules["__main__"]
|
||||||
|
@ -19,7 +19,7 @@ def parse_arguments(arguments):
|
|||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
||||||
def file_import(filename):
|
def file_import(filename, prefix="file_import_"):
|
||||||
linecache.checkcache(filename)
|
linecache.checkcache(filename)
|
||||||
|
|
||||||
modname = filename
|
modname = filename
|
||||||
@ -29,7 +29,7 @@ def file_import(filename):
|
|||||||
i = modname.find(".")
|
i = modname.find(".")
|
||||||
if i > 0:
|
if i > 0:
|
||||||
modname = modname[:i]
|
modname = modname[:i]
|
||||||
modname = "file_import_" + modname
|
modname = prefix + modname
|
||||||
|
|
||||||
path = os.path.dirname(os.path.realpath(filename))
|
path = os.path.dirname(os.path.realpath(filename))
|
||||||
sys.path.insert(0, path)
|
sys.path.insert(0, path)
|
||||||
|
Loading…
Reference in New Issue
Block a user