summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/generate_shader.py5
-rw-r--r--Scripts/libtastt.py16
-rw-r--r--Scripts/transcribe.py8
3 files changed, 24 insertions, 5 deletions
diff --git a/Scripts/generate_shader.py b/Scripts/generate_shader.py
index 67f916d..5ad9e70 100644
--- a/Scripts/generate_shader.py
+++ b/Scripts/generate_shader.py
@@ -115,11 +115,6 @@ if __name__ == "__main__":
print("args: {}".format(" ".join(sys.argv)))
- # Set cwd to the directory holding the script
- abspath = os.path.abspath(__file__)
- dname = os.path.dirname(abspath)
- os.chdir(dname)
-
parser = argparse.ArgumentParser()
parser.add_argument("--bytes_per_char", type=str, help="The number of bytes to use to represent each character")
parser.add_argument("--rows", type=str, help="The number of rows on the board")
diff --git a/Scripts/libtastt.py b/Scripts/libtastt.py
index 3168517..18de922 100644
--- a/Scripts/libtastt.py
+++ b/Scripts/libtastt.py
@@ -539,6 +539,8 @@ def generateFX(guid_map, gen_anim_dir):
return anim
def parseArgs():
+ print("args: {}".format(" ".join(sys.argv)))
+
parser = argparse.ArgumentParser()
parser.add_argument("cmd", type=str, help="")
parser.add_argument("--gen_dir", type=str, help="The directory under " +
@@ -549,6 +551,8 @@ def parseArgs():
parser.add_argument("--fx_dest", type=str, help="The path at which to save the generated FX controller")
parser.add_argument("--bytes_per_char", type=str, help="The number of bytes to use to represent each character")
parser.add_argument("--chars_per_sync", type=str, help="The number of characters to send on each sync event")
+ parser.add_argument("--rows", type=int, help="The number of rows on the board")
+ parser.add_argument("--cols", type=int, help="The number of columns on the board")
args = parser.parse_args()
if not args.gen_dir:
@@ -575,8 +579,14 @@ if __name__ == "__main__":
print("--bytes_per_char and --chars_per_sync required", file=sys.stderr)
sys.exit(1)
+ if not args.rows or not args.cols:
+ print("--rows and --cols required", file=sys.stderr)
+ sys.exit(1)
+
generate_utils.config.BYTES_PER_CHAR = int(args.bytes_per_char)
generate_utils.config.CHARS_PER_SYNC = int(args.chars_per_sync)
+ generate_utils.config.BOARD_ROWS = int(args.rows)
+ generate_utils.config.BOARD_COLS = int(args.cols)
guid_map = {}
with open(args.guid_map, 'rb') as f:
@@ -592,8 +602,14 @@ if __name__ == "__main__":
print("--bytes_per_char and --chars_per_sync required", file=sys.stderr)
sys.exit(1)
+ if not args.rows or not args.cols:
+ print("--rows and --cols required", file=sys.stderr)
+ sys.exit(1)
+
generate_utils.config.BYTES_PER_CHAR = int(args.bytes_per_char)
generate_utils.config.CHARS_PER_SYNC = int(args.chars_per_sync)
+ generate_utils.config.BOARD_ROWS = int(args.rows)
+ generate_utils.config.BOARD_COLS = int(args.cols)
guid_map = {}
with open(args.guid_map, 'rb') as f:
diff --git a/Scripts/transcribe.py b/Scripts/transcribe.py
index 678ec59..37a8407 100644
--- a/Scripts/transcribe.py
+++ b/Scripts/transcribe.py
@@ -426,6 +426,8 @@ if __name__ == "__main__":
parser.add_argument("--bytes_per_char", type=str, help="The number of bytes to use to represent each character")
parser.add_argument("--chars_per_sync", type=str, help="The number of characters to send on each sync event")
parser.add_argument("--enable_local_beep", type=int, help="Whether to play a local auditory indicator when transcription starts/stops.");
+ parser.add_argument("--rows", type=int, help="The number of rows on the board")
+ parser.add_argument("--cols", type=int, help="The number of columns on the board")
args = parser.parse_args()
if not args.mic:
@@ -441,8 +443,14 @@ if __name__ == "__main__":
print("--bytes_per_char and --chars_per_sync required", file=sys.stderr)
sys.exit(1)
+ if not args.rows or not args.cols:
+ print("--rows and --cols required", file=sys.stderr)
+ sys.exit(1)
+
generate_utils.config.BYTES_PER_CHAR = int(args.bytes_per_char)
generate_utils.config.CHARS_PER_SYNC = int(args.chars_per_sync)
+ generate_utils.config.BOARD_ROWS = int(args.rows)
+ generate_utils.config.BOARD_COLS = int(args.cols)
transcribeLoop(args.mic, args.language, args.model, args.enable_local_beep)