| 1 |
#!/usr/bin/env python3 |
| 2 |
|
| 3 |
import os |
| 4 |
import sys |
| 5 |
import argparse |
| 6 |
|
| 7 |
from pathlib import Path |
| 8 |
|
| 9 |
filedir = Path(os.path.dirname(__file__)).resolve() |
| 10 |
sys.path.insert(0, (filedir / 'ext').as_posix()) |
| 11 |
|
| 12 |
if hasattr(os, 'add_dll_directory'): |
| 13 |
os.add_dll_directory(filedir / 'ext' / 'lib') |
| 14 |
|
| 15 |
import tachyon |
| 16 |
|
| 17 |
parser = argparse.ArgumentParser() |
| 18 |
parser.add_argument('-o', dest='output', default=None) |
| 19 |
|
| 20 |
options = parser.parse_args(sys.argv[1:]) |
| 21 |
|
| 22 |
result = tachyon.phaserize('shoot') |
| 23 |
|
| 24 |
if options.output: |
| 25 |
with open(options.output, 'w', encoding='utf-8') as f: |
| 26 |
f.write('success') |
| 27 |
|
| 28 |
if not isinstance(result, int): |
| 29 |
raise SystemExit('Returned result not an integer.') |
| 30 |
|
| 31 |
if result != 1: |
| 32 |
raise SystemExit(f'Returned result {result} is not 1.') |