zlist = []\r
\r
# List all sectors to memory and calculate the width and heigth of the resulting picture.\r
-for filename in os.listdir(path + "sectors2"):\r
- for filename2 in os.listdir(path + "sectors2/" + filename):\r
- x = hex_to_int(filename)\r
- z = hex_to_int(filename2)\r
+if os.path.exists(path + "sectors2"):\r
+ for filename in os.listdir(path + "sectors2"):\r
+ for filename2 in os.listdir(path + "sectors2/" + filename):\r
+ x = hex_to_int(filename)\r
+ z = hex_to_int(filename2)\r
+ if x < sector_xmin or x > sector_xmax:\r
+ continue\r
+ if z < sector_zmin or z > sector_zmax:\r
+ continue\r
+ xlist.append(x)\r
+ zlist.append(z)\r
+\r
+if os.path.exists(path + "sectors"):\r
+ for filename in os.listdir(path + "sectors"):\r
+ x = hex4_to_int(filename[:4])\r
+ z = hex4_to_int(filename[-4:])\r
if x < sector_xmin or x > sector_xmax:\r
continue\r
if z < sector_zmin or z > sector_zmax:\r
continue\r
xlist.append(x)\r
zlist.append(z)\r
-for filename in os.listdir(path + "sectors"):\r
- x = hex4_to_int(filename[:4])\r
- z = hex4_to_int(filename[-4:])\r
- if x < sector_xmin or x > sector_xmax:\r
- continue\r
- if z < sector_zmin or z > sector_zmax:\r
- continue\r
- xlist.append(x)\r
- zlist.append(z)\r
\r
w = (max(xlist) - min(xlist)) * 16 + 16\r
h = (max(zlist) - min(zlist)) * 16 + 16\r