def _export_commands(self, toppar): commands = ('declare', 'autogen', 'default') for command in commands: cmd = self.commands[command] if cmd is not None: merged = tp._merge_command(cmd, toppar.commands[command]) if merged is not None: toppar.commands[command] = cmd
def _export_section(self, section, toppar): toppar.commands[section] = tp._merge_command(self.commands[section], toppar.commands[section]) self_section = getattr(self, section) if self_section is not None: func = self.prm_reader_map[section] objs = [ func(line) for line in self_section ] setattr(toppar, section, tp._merge_section(objs, getattr(toppar, section)))
def _export_cmap(self, toppar): toppar.commands['cmap'] = tp._merge_command(self.commands['cmap'], toppar.commands['cmap']) if self.cmap is not None: cmap = [ tp.CmapPRM('\n'.join(self.cmap)) ] toppar.cmap = tp._merge_cmap(cmap, toppar.cmap)