Comment 1 for bug 503026

Siegfried Gevatter (rainct) wrote :

Until (/If) this is implemented, I'm using the following hack to achieve this:

---------------------------------------------------------------------------------
from __future__ import with_statement
import os
from glob import glob

if __name__ == "__main__":
    """ Generate POTFILES.in from POTFILES.in.in. """
    os.chdir(os.path.realpath(os.path.dirname(__file__)))
    if os.path.isfile("po/POTFILES.in.in"):
        lines = []
        with open("po/POTFILES.in.in") as f:
            for line in f:
                lines.extend(glob(line.strip()))
        with open("po/POTFILES.in", "w") as f:
            f.write("\n".join(lines) + "\n")
---------------------------------------------------------------------------------

Listing it here in case it's useful to somebody.