fixes found during testing

should standardize on IOError for errno.ENOENT across the package
adhere to standard choice of logging message
make sure to skip a non-directory in OutputCollection ("continue")
This commit is contained in:
Martin A. Brown 2016-02-16 14:13:17 -08:00
parent b9defe3e8b
commit fbb6e56929
1 changed files with 3 additions and 2 deletions

View File

@ -50,9 +50,9 @@ class OutputDirectory(OutputNamingConvention):
parent = os.path.dirname(self.dirname)
if not os.path.isdir(parent):
logger.critical("Missing output tree %s.", parent)
raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), parent)
raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), parent)
if not os.path.isdir(self.dirname):
logger.info("Creating output directory %s.", dirname)
logger.info("%s creating output directory %s.", self.stem, dirname)
os.mkdir(dirname)
super(OutputDirectory, self).__init__(self.stem, self.dirname)
@ -81,6 +81,7 @@ class OutputCollection(collections.MutableMapping):
name = os.path.join(dirname, fname)
if not os.path.isdir(name):
logger.warning("Skipping non-directory %s (in %s)", name, dirname)
continue
o = OutputDirectory(name)
assert not o.stem in self
self[o.stem] = o