summaryrefslogtreecommitdiffstats
path: root/gen_web_gettext.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2016-11-03 21:26:46 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2016-11-03 21:45:45 +0000
commit3a2ff0c188b0e8da893b733cccb1e164b54f2471 (patch)
tree2997d64b20e6e280016792cd4a04bfd20ff89992 /gen_web_gettext.py
parentd4a8a38586251575a17c50735a10ddfba30fdc31 (diff)
downloaddeluge-3a2ff0c188b0e8da893b733cccb1e164b54f2471.tar.gz
deluge-3a2ff0c188b0e8da893b733cccb1e164b54f2471.tar.bz2
deluge-3a2ff0c188b0e8da893b733cccb1e164b54f2471.zip
[Lint] Convert all python double quotes to single quotes
* A rather disruptive change but for a few reasons such as easier to read, easier type, keep consistent and javascript code uses single quotes. * There are a few exceptions for the automated process: * Any double quotes in comments * Triple double quotes for docstrings * Strings containing single quotes are left e.g. "they're" * To deal with merge conflicts from feature branches it is best to follow these steps for each commit: * Create a patch: `git format-patch -1 <sha1>` * Edit the patch and replace double quotes with single except those in comments or strings containing an unescaped apostrophe. * Check the patch `git apply --check <patchfile>` and fix any remaining issues if it outputs an error. * Apply the patch `git am < <patchfile>`
Diffstat (limited to 'gen_web_gettext.py')
-rwxr-xr-xgen_web_gettext.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gen_web_gettext.py b/gen_web_gettext.py
index 69dd91d8e..44654cb4c 100755
--- a/gen_web_gettext.py
+++ b/gen_web_gettext.py
@@ -42,11 +42,11 @@ def check_missing_markup(js_dir):
except_chars = "' &#"
# A list of strings that should be skipped shuold the match contain them.
- skip = ["HTTP:"]
+ skip = ['HTTP:']
# Create a list of the matching strings to search for with the except_chars appended to each one.
string_re = re.compile(
- "(" + ")|(".join(["%s[^" + except_chars + "].*'"]*len(attr_list)) % tuple(attr_list) + ")"
+ '(' + ')|('.join(['%s[^' + except_chars + "].*'"]*len(attr_list)) % tuple(attr_list) + ')'
)
strings = {}
@@ -100,7 +100,7 @@ if __name__ == '__main__':
print("Created '%s'" % gettext_fname)
missed_markup = check_missing_markup(WEBUI_JS_DIR)
if missed_markup:
- print("Possible missed text for translation markup:")
+ print('Possible missed text for translation markup:')
for text, filenames in missed_markup.iteritems():
for filename_lineno in filenames:
- print("{0:<58} {1}".format(':'.join(filename_lineno), text))
+ print('{0:<58} {1}'.format(':'.join(filename_lineno), text))