MCPcopy
hub / github.com/pyload/pyload / makepot

Function makepot

pavement.py:297–319  ·  view source on GitHub ↗
(domain, p, excludes=[], includes="", endings=[".py"], xxargs=[])

Source from the content-addressed store, hash-verified

295
296
297def 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
322def change_owner(dir, uid, gid):

Callers 1

generate_localeFunction · 0.85

Calls 7

walk_transFunction · 0.85
pathFunction · 0.85
writeMethod · 0.45
closeMethod · 0.45
readMethod · 0.45
removeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected