(domain, p, excludes=[], includes="", endings=[".py"], xxargs=[])
| 295 | |
| 296 | |
| 297 | def makepot(domain, p, excludes=[], includes="", endings=[".py"], xxargs=[]): |
| 298 | print "Generate %s.pot" % domain |
| 299 | |
| 300 | f = open("includes.txt", "wb") |
| 301 | if includes: |
| 302 | f.write(includes) |
| 303 | |
| 304 | if p: |
| 305 | f.write(walk_trans(path(p), excludes, endings)) |
| 306 | |
| 307 | f.close() |
| 308 | |
| 309 | call(["xgettext", "--files-from=includes.txt", "--default-domain=%s" % domain] + xargs + xxargs) |
| 310 | |
| 311 | # replace charset und move file |
| 312 | with open("%s.po" % domain, "rb") as f: |
| 313 | content = f.read() |
| 314 | |
| 315 | path("%s.po" % domain).remove() |
| 316 | content = content.replace("charset=CHARSET", "charset=UTF-8") |
| 317 | |
| 318 | with open("locale/%s.pot" % domain, "wb") as f: |
| 319 | f.write(content) |
| 320 | |
| 321 | |
| 322 | def change_owner(dir, uid, gid): |
no test coverage detected