From f935d5305a387f179fe60f5fd8eabc608eeac8aa Mon Sep 17 00:00:00 2001 From: d6 Date: Mon, 6 Feb 2023 10:28:59 -0500 Subject: [PATCH] uxnindex --- uxnindex | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 uxnindex diff --git a/uxnindex b/uxnindex new file mode 100755 index 0000000..5bfd3b1 --- /dev/null +++ b/uxnindex @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +from sys import argv, exit + +def usage(): + print('%s SRC DST' % argv[0]) + print(' reads uxn roms from SRC') + print(' generates an index at DST') + exit(1) + +def main(): + if len(argv[1:]) != 2: + return usage() + src, dst = argv[1:] + if not os.path.isdir(src): + print('%r is not a directory' % src) + return usage() + if os.path.exists(dst): + print('%r already exists' % dst) + return usage() + + roms = [] + for root, _, names in os.walk(src): + for name in names: + if not name.endswith('.rom'): + continue + + + +if __name__ == "__main__": + main() \ No newline at end of file