Fixed paths with square brackets in them.
This commit is contained in:
committed by
Andrew Chin
parent
8d99fef4dd
commit
44f624f64f
@@ -21,6 +21,7 @@ import logging
|
|||||||
import hashlib
|
import hashlib
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
|
import re
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
@@ -492,14 +493,14 @@ class RegionSet(object):
|
|||||||
|
|
||||||
logging.debug("regiondir is %s", self.regiondir)
|
logging.debug("regiondir is %s", self.regiondir)
|
||||||
|
|
||||||
for path in glob(self.regiondir + "/r.*.*.mca"):
|
for f in os.listdir(self.regiondir):
|
||||||
dirpath, f = os.path.split(path)
|
if re.match(r"^r\.-?\d+\.-?\d+\.mca$", f):
|
||||||
p = f.split(".")
|
p = f.split(".")
|
||||||
x = int(p[1])
|
x = int(p[1])
|
||||||
y = int(p[2])
|
y = int(p[2])
|
||||||
if abs(x) > 500000 or abs(y) > 500000:
|
if abs(x) > 500000 or abs(y) > 500000:
|
||||||
logging.warning("Holy shit what is up with region file %s !?" % f)
|
logging.warning("Holy shit what is up with region file %s !?" % f)
|
||||||
yield (x, y, path)
|
yield (x, y, os.path.join(self.regiondir, f))
|
||||||
|
|
||||||
class RegionSetWrapper(object):
|
class RegionSetWrapper(object):
|
||||||
"""This is the base class for all "wrappers" of RegionSet objects. A
|
"""This is the base class for all "wrappers" of RegionSet objects. A
|
||||||
|
|||||||
Reference in New Issue
Block a user