This commit is contained in:
~d6 2023-02-06 10:28:59 -05:00
parent 3d4c79c934
commit f935d5305a
1 changed files with 31 additions and 0 deletions

31
uxnindex Executable file
View File

@ -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()