def create_tm_for_all_projects(self): """Creates the TM memory for all projects""" if os.path.isfile(self.tm_file): os.remove(self.tm_file) projects_catalog = POCatalog(self.tm_file) for project in self.projects: project_catalog = POCatalog(project.get_filename()) projects_catalog.add_pofile(project_catalog.filename) projects_catalog.cleanup()
def build(self): convert = ConvertFiles() convert.convert() self.clean_up_after_convert() self.add_comments() findFiles = FindFiles() files = findFiles.find(self.temp_dir, '*.po') if len(files) == 0: logging.info('No files to add in fileset: {0}'.format(self.name)) return fileset_tm = 'fileset-tm.po' self.po_catalog = POCatalog(fileset_tm) self._build_tm_for_fileset(fileset_tm, files) self._add_tm_for_fileset_to_project_tm(fileset_tm) self._delete_tm_fileset(fileset_tm)
def _add_tm_for_fileset_to_project_tm(self, fileset_tm): project_catalog = POCatalog(self.tm_file) project_catalog.add_pofile(self.po_catalog.filename) project_catalog.cleanup()