[Bf-translations-svn] SVN commit: /data/svn/bf-translations [145] trunk/po/tools: Small updates on tools...
bf-translations at blender.org
bf-translations at blender.org
Mon Oct 31 21:45:16 CET 2011
Revision: 145
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-translations&revision=145
Author: mont29
Date: 2011-10-31 20:45:15 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
Small updates on tools...
Modified Paths:
--------------
trunk/po/tools/_update_msg.py
trunk/po/tools/check_po.py
trunk/po/tools/clean_po.py
trunk/po/tools/import_po_from_branches.py
trunk/po/tools/merge_po.py
trunk/po/tools/settings_template.py
trunk/po/tools/update_branches.py
trunk/po/tools/update_mo.py
trunk/po/tools/update_msg.py
trunk/po/tools/update_po.py
trunk/po/tools/update_pot.py
trunk/po/tools/update_trunk.py
trunk/po/tools/utils.py
Modified: trunk/po/tools/_update_msg.py
===================================================================
--- trunk/po/tools/_update_msg.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/_update_msg.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,4 +1,3 @@
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -352,9 +351,9 @@
module_name = mod.__name__
bpy.ops.wm.addon_enable(module=module_name)
- # There are currently some problems with bpy/rna... *Very* tricky to solve!
- # So this is a hack to make all newly added operator visible by
- # bpy.types.OperatorProperties.__subclasses__()
+ # XXX There are currently some problems with bpy/rna... *Very* tricky to solve!
+ # So this is a hack to make all newly added operator visible by
+ # bpy.types.OperatorProperties.__subclasses__()
for el in dir(bpy.types):
getattr(bpy.types, el)
Modified: trunk/po/tools/check_po.py
===================================================================
--- trunk/po/tools/check_po.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/check_po.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/clean_po.py
===================================================================
--- trunk/po/tools/clean_po.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/clean_po.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/import_po_from_branches.py
===================================================================
--- trunk/po/tools/import_po_from_branches.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/import_po_from_branches.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -61,44 +60,43 @@
for lang in os.listdir(BRANCHES_DIR):
if args.langs and lang not in args.langs:
continue
- for po in os.listdir(os.path.join(BRANCHES_DIR, lang)):
- if po.endswith('.po'):
- po = os.path.join(BRANCHES_DIR, lang, po)
- po_script = os.path.join(BRANCHES_DIR, lang,
- "".join((lang, "_to_utf.py")))
- u1, state, stats = utils.parse_messages(po)
- tot_msgs = stats["tot_msg"]
- trans_msgs = stats["trans_msg"]
- lvl = 0.0
- if tot_msgs:
- lvl = float(trans_msgs)/float(tot_msgs)
- if lvl > threshold:
- if state["is_broken"] and args.strict:
- print("{:<10}: {:>6.1%} done, but BROKEN, skipped." \
+ po = os.path.join(BRANCHES_DIR, lang, ".".join((lang, "po")))
+ if os.path.exists(po):
+ po_script = os.path.join(BRANCHES_DIR, lang,
+ "".join((lang, "_to_utf.py")))
+ u1, state, stats = utils.parse_messages(po)
+ tot_msgs = stats["tot_msg"]
+ trans_msgs = stats["trans_msg"]
+ lvl = 0.0
+ if tot_msgs:
+ lvl = float(trans_msgs)/float(tot_msgs)
+ if lvl > threshold:
+ if state["is_broken"] and args.strict:
+ print("{:<10}: {:>6.1%} done, but BROKEN, skipped." \
+ "".format(lang, lvl))
+ ret = 1
+ else:
+ if os.path.exists(po_script):
+ out_po = os.path.join(TRUNK_PO_DIR,
+ ".".join((lang, "po")))
+ t = subprocess.call([PY3, po_script, po, out_po])
+ if t:
+ ret = t
+ print("{:<10}: {:>6.1%} done, enough translated " \
+ "messages, processed and copied to trunk." \
"".format(lang, lvl))
- ret = 1
else:
- if os.path.exists(po_script):
- out_po = os.path.join(TRUNK_PO_DIR,
- ".".join((lang, "po")))
- t = subprocess.call([PY3, po_script, po, out_po])
- if t:
- ret = t
- print("{:<10}: {:>6.1%} done, enough translated " \
- "messages, processed and copied to trunk." \
- "".format(lang, lvl))
- else:
- shutil.copy(po, TRUNK_PO_DIR)
- print("{:<10}: {:>6.1%} done, enough translated " \
- "messages, copied to trunk.".format(lang, lvl))
+ shutil.copy(po, TRUNK_PO_DIR)
+ print("{:<10}: {:>6.1%} done, enough translated " \
+ "messages, copied to trunk.".format(lang, lvl))
+ else:
+ if state["is_broken"] and args.strict:
+ print("{:<10}: {:>6.1%} done, BROKEN and not enough " \
+ "translated messages, skipped".format(lang, lvl))
+ ret = 1
else:
- if state["is_broken"] and args.strict:
- print("{:<10}: {:>6.1%} done, BROKEN and not enough " \
- "translated messages, skipped".format(lang, lvl))
- ret = 1
- else:
- print("{:<10}: {:>6.1%} done, not enough translated " \
- "messages, skipped.".format(lang, lvl))
+ print("{:<10}: {:>6.1%} done, not enough translated " \
+ "messages, skipped.".format(lang, lvl))
return ret
Modified: trunk/po/tools/merge_po.py
===================================================================
--- trunk/po/tools/merge_po.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/merge_po.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/settings_template.py
===================================================================
--- trunk/po/tools/settings_template.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/settings_template.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,4 +1,3 @@
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/update_branches.py
===================================================================
--- trunk/po/tools/update_branches.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/update_branches.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/update_mo.py
===================================================================
--- trunk/po/tools/update_mo.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/update_mo.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/update_msg.py
===================================================================
--- trunk/po/tools/update_msg.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/update_msg.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $ID$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/update_po.py
===================================================================
--- trunk/po/tools/update_po.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/update_po.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -101,12 +100,11 @@
ret = t
else:
for lang in os.listdir(BRANCHES_DIR):
- for po in os.listdir(os.path.join(BRANCHES_DIR, lang)):
- if po.endswith(".po"):
- po = os.path.join(BRANCHES_DIR, lang, po)
- t = process_po(po, lang)
- if t:
- ret = t
+ po = os.path.join(BRANCHES_DIR, lang, ".".join((lang, "po")))
+ if os.path.exists(po):
+ t = process_po(po, lang)
+ if t:
+ ret = t
return ret
Modified: trunk/po/tools/update_pot.py
===================================================================
--- trunk/po/tools/update_pot.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/update_pot.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/update_trunk.py
===================================================================
--- trunk/po/tools/update_trunk.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/update_trunk.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Modified: trunk/po/tools/utils.py
===================================================================
--- trunk/po/tools/utils.py 2011-10-31 20:14:03 UTC (rev 144)
+++ trunk/po/tools/utils.py 2011-10-31 20:45:15 UTC (rev 145)
@@ -1,4 +1,3 @@
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
More information about the Bf-translations-svn
mailing list