def __init__(self, M, writeRawLog=False): self.M = M self.writers = { } if hasattr(self, "init_hook"): self.init_hook() if writeRawLog: self.writers['.log.txt'] = writers.TextLog(self.M) for extension, writer in self.writer_map.iteritems(): self.writers[extension] = writer(self.M)
def __init__(self, M, writeRawLog=False, safeMode=False, extraConfig={}): self.M = M self.writers = {} # Update config values with anything we may have for k, v in extraConfig.iteritems(): setattr(self, k, v) if hasattr(self, "init_hook"): self.init_hook() if writeRawLog: self.writers['.log.txt'] = writers.TextLog(self.M) for extension, writer in self.writer_map.iteritems(): self.writers[extension] = writer(self.M) self.safeMode = safeMode