add warning_box func to fpdb, add validate_config func, checks existence of hhArchiveBase, pops up warnings if not present
hhc traps errors creating folders, need to learn how to make it fail properly afterwards.
This commit is contained in:
@@ -82,13 +82,21 @@ follow : whether to tail -f the input"""
|
||||
# TODO: out_path should be sanity checked.
|
||||
out_dir = os.path.dirname(self.out_path)
|
||||
if not os.path.isdir(out_dir) and out_dir != '':
|
||||
log.info("Creating directory '%s'" % out_dir)
|
||||
os.makedirs(out_dir)
|
||||
try:
|
||||
os.makedirs(out_dir)
|
||||
except: # we get a WindowsError here in Windows.. pretty sure something else for Linux :D
|
||||
log.error("Unable to create output directory %s for HHC!" % out_dir)
|
||||
print "*** ERROR: UNABLE TO CREATE OUTPUT DIRECTORY", out_dir
|
||||
# TODO: pop up a box to allow person to choose output directory?
|
||||
# TODO: shouldn't that be done when we startup, actually?
|
||||
else:
|
||||
log.info("Created directory '%s'" % out_dir)
|
||||
try:
|
||||
self.out_fh = codecs.open(self.out_path, 'w', 'cp1252')
|
||||
log.debug("out_path %s opened as %s" % (self.out_path, self.out_fh))
|
||||
except:
|
||||
log.error("out_path %s couldn't be opened" % (self.out_path))
|
||||
else:
|
||||
log.debug("out_path %s opened as %s" % (self.out_path, self.out_fh))
|
||||
|
||||
self.follow = follow
|
||||
self.compiledPlayers = set()
|
||||
|
||||
Reference in New Issue
Block a user