Changeset 528:25c1783c0111 for projects/handlers/types/pot.py
- Timestamp:
- 04/27/09 22:10:31 (17 months ago)
- Branch:
- default
- Files:
-
- 1 modified
-
projects/handlers/types/pot.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
projects/handlers/types/pot.py
r514 r528 1 1 from translations.lib.types.pot import POTManager 2 from translations.models import POFile 2 3 from txcommon.log import logger 3 4 … … 57 58 self.set_stats_for_lang(lang) 58 59 60 self.clear_old_stats() 61 62 def clear_old_stats(self): 63 """ 64 Clear stats present on the database and msgmerge dir, that are not 65 anymore in the upstream repository 66 """ 67 pofiles = POFile.objects.select_related().filter( 68 component=self.component) 69 pots = self.tm.get_source_files() 70 files = self.tm.get_po_files() 71 for pot in pots: 72 files.append(pot) 73 logger.info(files) 74 for stat in pofiles: 75 if stat.filename not in files: 76 self.tm.delete_file_from_static_dir(stat.filename) 77 stat.delete() 78 59 79 def clear_stats(self): 60 80 """Clear stats for all translations of the component."""
