Exemplo n.º 1
0
 def rebuild(self):
     memory = TranslationMemory()
     data = list(memory.searcher.documents())
     memory.empty()
     with memory.writer() as writer:
         for entry in data:
             writer.add_document(**entry)
Exemplo n.º 2
0
 def rebuild(self):
     memory = TranslationMemory()
     data = list(memory.searcher.documents())
     memory.empty()
     with memory.writer() as writer:
         for entry in data:
             writer.add_document(**entry)
Exemplo n.º 3
0
 def handle(self, *args, **options):
     """Translation memory cleanup."""
     memory = TranslationMemory()
     if options['all']:
         memory.empty()
     elif options['origin'] or options['category']:
         memory.delete(options['origin'], options['category'])
     else:
         raise CommandError('Please specify what you want to delete')
Exemplo n.º 4
0
 def handle(self, *args, **options):
     """Translation memory cleanup."""
     memory = TranslationMemory()
     if options['all']:
         memory.empty()
     elif options['origin'] or options['category']:
         memory.delete(options['origin'], options['category'])
     else:
         raise CommandError('Please specify what you want to delete')