+ check if sectors/sectors2 directories exist before attempting to read them

This commit is contained in:
Nils Dagsson Moskopp 2011-06-02 17:21:58 +02:00
parent 34e57da1ca
commit bd5cdbf1a4

@ -73,6 +73,7 @@ xlist = []
zlist = []
# List all sectors to memory and calculate the width and heigth of the resulting picture.
if os.path.exists(path + "sectors2"):
for filename in os.listdir(path + "sectors2"):
for filename2 in os.listdir(path + "sectors2/" + filename):
x = hex_to_int(filename)
@ -83,6 +84,8 @@ for filename in os.listdir(path + "sectors2"):
continue
xlist.append(x)
zlist.append(z)
if os.path.exists(path + "sectors"):
for filename in os.listdir(path + "sectors"):
x = hex4_to_int(filename[:4])
z = hex4_to_int(filename[-4:])