diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-07-08 13:27:33 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-07-08 13:27:33 +0400 |
commit | d96275a5c344d82f2466b0a6f85d8ee716771179 (patch) | |
tree | 2184df7306e1c2e535ff37f33a0933938b3d8c7b | |
parent | b91bc4f037b5c3ce69fef2d6187690ce05ffea62 (diff) |
Some cleanup.
Also trying to make it usuable from other tools (imports become a bit tricky here :/ ).
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/bl_process_msg.py | 3 | ||||
-rwxr-xr-x | release/scripts/modules/bl_i18n_utils/update_pot.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/utils.py | 7 |
3 files changed, 4 insertions, 10 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py index 353b911ab2c..3a026f33ea3 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py +++ b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py @@ -25,8 +25,7 @@ import os # XXX Relative import does not work here when used from Blender... -#from . import settings -import bl_i18n_utils.settings as settings +from bl_i18n_utils import settings #classes = set() diff --git a/release/scripts/modules/bl_i18n_utils/update_pot.py b/release/scripts/modules/bl_i18n_utils/update_pot.py index f4468da2bad..58c924cade4 100755 --- a/release/scripts/modules/bl_i18n_utils/update_pot.py +++ b/release/scripts/modules/bl_i18n_utils/update_pot.py @@ -26,7 +26,6 @@ import subprocess import os import sys import re -#from codecs import open import tempfile import argparse import time @@ -40,14 +39,11 @@ COMMENT_PREFIX = settings.COMMENT_PREFIX COMMENT_PREFIX_SOURCE = settings.COMMENT_PREFIX_SOURCE CONTEXT_PREFIX = settings.CONTEXT_PREFIX FILE_NAME_MESSAGES = settings.FILE_NAME_MESSAGES -#FILE_NAME_POTFILES = settings.FILE_NAME_POTFILES FILE_NAME_POT = settings.FILE_NAME_POT SOURCE_DIR = settings.SOURCE_DIR POTFILES_DIR = settings.POTFILES_SOURCE_DIR SRC_POTFILES = settings.FILE_NAME_SRC_POTFILES -#GETTEXT_XGETTEXT_EXECUTABLE = settings.GETTEXT_XGETTEXT_EXECUTABLE -#GETTEXT_KEYWORDS = settings.GETTEXT_KEYWORDS CONTEXT_DEFAULT = settings.CONTEXT_DEFAULT PYGETTEXT_ALLOWED_EXTS = settings.PYGETTEXT_ALLOWED_EXTS diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index dfed2088878..ebf0f994a7a 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -23,9 +23,8 @@ import os import sys import collections -from codecs import open -import settings +from bl_i18n_utils import settings COMMENT_PREFIX = settings.COMMENT_PREFIX @@ -145,7 +144,7 @@ def parse_messages(fname): clean_vars() - with open(fname, 'r', "utf-8") as f: + with open(fname, 'r', encoding="utf-8") as f: for line_nr, line in enumerate(f): line = stripeol(line) if line == "": @@ -248,7 +247,7 @@ def write_messages(fname, messages, commented, fuzzy): "returned values). commented and fuzzy are two sets containing msgid. " \ "Returns the number of written messages." num = 0 - with open(fname, 'w', "utf-8") as f: + with open(fname, 'w', encoding="utf-8") as f: for msgkey, val in messages.items(): msgctxt, msgid = msgkey f.write("\n".join(val["comment_lines"])) |