def set(self, section, key, value): if not self.data.has_section(section): self.data.add_section(section) self.data.set(section, key, value) out = StringIO() self.data.write(out) write_file(path=self.path, data=out.getvalue().encode('utf-8'))
def _generate_init(self): loc = expanduser('~/.initxyz/var/init.el') symlink_and_move_old_to_backup(loc, expanduser('~/.emacs')) write_file(path=loc, data=self._make_content())