def __init__(self, file_path, template_path, config, read=False):
    self.file_path = file_path
    self.template_path = template_path
    self.config = config
    self.binary = template_path.endswith(BINARY_EXTENSIONS)
    self._read = (read_file_binary if self.binary else read_file)
    self._write = (write_file_binary if self.binary else write_file)
    self.contents = None
    if read:
        self.read()
def __init__(self, file_path, template_path, config, read=False):
    self.file_path = file_path
    self.template_path = template_path
    self.config = config
    self.binary = template_path.endswith(BINARY_EXTENSIONS)
    self._read = (read_file_binary if self.binary else read_file)
    self._write = (write_file_binary if self.binary else write_file)
    self.contents = None
    if read:
        self.read()