uxnindex
This commit is contained in:
parent
3d4c79c934
commit
f935d5305a
|
@ -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()
|
Loading…
Reference in New Issue