forked from M-Labs/artiq
1
0
Fork 0

Fix formatting.

This commit is contained in:
whitequark 2016-01-19 18:52:36 +00:00
parent cf17be92e3
commit 1d7858c7bc
1 changed files with 6 additions and 6 deletions

View File

@ -13,13 +13,13 @@ import sys, os, argparse, importlib
def main(): def main():
parser = argparse.ArgumentParser(description=__doc__) parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('-m', metavar='mod', type=str, parser.add_argument("-m", metavar="mod", type=str,
help='run library module as a script') help="run library module as a script")
parser.add_argument('args', type=str, nargs='+', parser.add_argument("args", type=str, nargs="+",
help='arguments passed to program in sys.argv[1:]') help="arguments passed to program in sys.argv[1:]")
args = parser.parse_args(sys.argv[1:]) args = parser.parse_args(sys.argv[1:])
artiq_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) artiq_path = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(1, artiq_path) sys.path.insert(1, artiq_path)
if args.m: if args.m:
@ -28,7 +28,7 @@ def main():
else: else:
sys.argv[1:] = args.args[1:] sys.argv[1:] = args.args[1:]
with open(args.args[0]) as f: with open(args.args[0]) as f:
code = compile(f.read(), args.args[0], 'exec') code = compile(f.read(), args.args[0], "exec")
exec(code, globals()) exec(code, globals())
if __name__ == "__main__": if __name__ == "__main__":