def rebuild(self): memory = TranslationMemory() memory.open_searcher() data = list(memory.searcher.documents()) memory.empty() with memory.writer() as writer: for entry in data: writer.add_document(**entry)
def handle(self, *args, **options): if options['backup']: memory_backup(options['indent']) return memory = TranslationMemory() memory.open_searcher() self.stdout.ending = None memory.dump(self.stdout, indent=options['indent']) self.stdout.write('\n')
def handle(self, *args, **options): memory = TranslationMemory() memory.open_searcher() self.stdout.ending = None json.dump( list(memory.searcher.documents()), self.stdout, indent=options['indent'], ) self.stdout.write('\n')