~launchpad-pqm/launchpad/devel

10637.3.1 by Guilherme Salgado
Use the default python version instead of a hard-coded version
1
#!/usr/bin/python -S
9772.11.4 by Danilo Šegan
Add cleanup script.
2
#
3
# Copyright 2009 Canonical Ltd.  This software is licensed under the
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
6
# pylint: disable-msg=W0403
7
8
"""Mark all translation credits as translated."""
9
10
import _pythonpath
11
9830.1.1 by Danilo Šegan
Introduce a new DB user for the script and use it.
12
from lp.services.scripts.base import LaunchpadScript
9772.11.4 by Danilo Šegan
Add cleanup script.
13
from lp.translations.scripts.fix_translation_credits import (
14
    FixTranslationCreditsProcess)
15
16
9830.1.1 by Danilo Šegan
Introduce a new DB user for the script and use it.
17
class FixTranslationCredits(LaunchpadScript):
9772.11.4 by Danilo Šegan
Add cleanup script.
18
    """Go through all POFiles and mark translation credits as translated."""
19
20
    def main(self):
21
        fixer = FixTranslationCreditsProcess(self.txn, self.logger)
22
        fixer.run()
23
24
25
if __name__ == '__main__':
26
    script = FixTranslationCredits(name="fix-translation-credits",
9830.1.3 by Danilo Šegan
Go back to one DB user to simplify rollout of this.
27
                                   dbuser='rosettaadmin')
9772.11.4 by Danilo Šegan
Add cleanup script.
28
    script.lock_and_run()