From adcfdeaf4d40e1d251a3d5cb7fc8e913cae449b0 Mon Sep 17 00:00:00 2001 From: Takuya Nishimoto Date: Fri, 31 May 2019 17:34:24 +0900 Subject: [PATCH 1/6] txt2tags for python3 #8734 --- .gitmodules | 2 +- keyCommandsDoc.py | 15 ++++++++------- miscDeps | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index 95d46bf3d50..5f2405e4a54 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ url = https://github.com/RaMMicHaeL/minhook [submodule "miscDeps"] path = miscDeps - url = https://github.com/nvaccess/nvda-misc-deps + url = https://github.com/nvdajp/nvda-misc-deps [submodule "include/espeak"] path = include/espeak url=https://github.com/espeak-ng/espeak-ng diff --git a/keyCommandsDoc.py b/keyCommandsDoc.py index 07f3cbcec6c..75628b22cbf 100644 --- a/keyCommandsDoc.py +++ b/keyCommandsDoc.py @@ -4,6 +4,7 @@ #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2010-2015 NV Access Limited, Mesar Hameed +#Copyright (C) 2018-2019 Takuya Nishimoto """Utilities related to NVDA Key Commands documents. """ @@ -13,7 +14,7 @@ import re import txt2tags -LINE_END = u"\r\n" +LINE_END = "\r\n" class KeyCommandsError(Exception): """Raised due to an error encountered in the User Guide related to generation of the Key Commands document. @@ -195,7 +196,7 @@ def _writeHeadings(self): for level, heading in enumerate(self._headings[level:], level): # We don't want numbered headings in the output. label=heading.group("label") - headingText = u"{id}{txt}{id}{label}".format( + headingText = "{id}{txt}{id}{label}".format( id="=" * len(heading.group("id")), txt=heading.group("txt"), label="[%s]" % label if label else "") @@ -213,7 +214,7 @@ def _heading(self, m): self._headings.append(m) self._kcLastHeadingLevel = min(self._kcLastHeadingLevel, level - 1) - RE_SETTING_SINGLE_KEY = re.compile(ur"^[^|]+?[::]\s*(.+?)\s*$") + RE_SETTING_SINGLE_KEY = re.compile(r"^[^|]+?[::]\s*(.+?)\s*$") def _handleSetting(self): if not self._settingsHeaderRow: raise KeyCommandsError("%d, setting command cannot be used before settingsSection command" % self._lineNum) @@ -237,7 +238,7 @@ def _handleSetting(self): # The next few lines should be table rows for each layout. # Alternatively, if the key is common to all layouts, there will be a single line of text specifying the key after a colon. keys = [] - for layout in xrange(self._settingsNumLayouts): + for layout in range(self._settingsNumLayouts): line = next(self._ug).strip() self._lineNum += 1 m = self.RE_SETTING_SINGLE_KEY.match(line) @@ -254,7 +255,7 @@ def _handleSetting(self): if 1 == len(keys) < self._settingsNumLayouts: # The key has only been specified once, so it is the same in all layouts. key = keys[0] - keys[1:] = (key for layout in xrange(self._settingsNumLayouts - 1)) + keys[1:] = (key for layout in range(self._settingsNumLayouts - 1)) # There should now be a blank line. line = next(self._ug).strip() @@ -266,9 +267,9 @@ def _handleSetting(self): desc = next(self._ug).strip() self._lineNum += 1 - self._kc.write(u"| {name} | {keys} | {desc} |{lineEnd}".format( + self._kc.write("| {name} | {keys} | {desc} |{lineEnd}".format( name=name, - keys=u" | ".join(keys), + keys=" | ".join(keys), desc=desc, lineEnd=LINE_END)) def remove(self): diff --git a/miscDeps b/miscDeps index 3a0065301ec..a068e120ee0 160000 --- a/miscDeps +++ b/miscDeps @@ -1 +1 @@ -Subproject commit 3a0065301ec91c52ae5bebf2c4403ce429db078c +Subproject commit a068e120ee075b4697c6b05759eab049223941d0 From e32fa0ed0830b7c5f6291d321910a7dab2bf597f Mon Sep 17 00:00:00 2001 From: Takuya Nishimoto Date: Fri, 31 May 2019 22:27:26 +0900 Subject: [PATCH 2/6] address review comments Co-Authored-By: Leonard de Ruijter --- keyCommandsDoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyCommandsDoc.py b/keyCommandsDoc.py index 75628b22cbf..be0c5e15b46 100644 --- a/keyCommandsDoc.py +++ b/keyCommandsDoc.py @@ -3,7 +3,7 @@ #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. -#Copyright (C) 2010-2015 NV Access Limited, Mesar Hameed +#Copyright (C) 2010-2019 NV Access Limited, Mesar Hameed, Takuya Nishimoto #Copyright (C) 2018-2019 Takuya Nishimoto """Utilities related to NVDA Key Commands documents. From 3070fcc5f8efac972eb89ff5af66b245359d4b45 Mon Sep 17 00:00:00 2001 From: Takuya Nishimoto Date: Fri, 31 May 2019 22:32:13 +0900 Subject: [PATCH 3/6] address review comments --- .gitmodules | 2 +- keyCommandsDoc.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5f2405e4a54..95d46bf3d50 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ url = https://github.com/RaMMicHaeL/minhook [submodule "miscDeps"] path = miscDeps - url = https://github.com/nvdajp/nvda-misc-deps + url = https://github.com/nvaccess/nvda-misc-deps [submodule "include/espeak"] path = include/espeak url=https://github.com/espeak-ng/espeak-ng diff --git a/keyCommandsDoc.py b/keyCommandsDoc.py index be0c5e15b46..a0e96715947 100644 --- a/keyCommandsDoc.py +++ b/keyCommandsDoc.py @@ -14,7 +14,7 @@ import re import txt2tags -LINE_END = "\r\n" +LINE_END = u"\r\n" class KeyCommandsError(Exception): """Raised due to an error encountered in the User Guide related to generation of the Key Commands document. @@ -196,7 +196,7 @@ def _writeHeadings(self): for level, heading in enumerate(self._headings[level:], level): # We don't want numbered headings in the output. label=heading.group("label") - headingText = "{id}{txt}{id}{label}".format( + headingText = u"{id}{txt}{id}{label}".format( id="=" * len(heading.group("id")), txt=heading.group("txt"), label="[%s]" % label if label else "") @@ -267,9 +267,9 @@ def _handleSetting(self): desc = next(self._ug).strip() self._lineNum += 1 - self._kc.write("| {name} | {keys} | {desc} |{lineEnd}".format( + self._kc.write(u"| {name} | {keys} | {desc} |{lineEnd}".format( name=name, - keys=" | ".join(keys), + keys=u" | ".join(keys), desc=desc, lineEnd=LINE_END)) def remove(self): From befffdd6d32a24e165c85e4148c3b6ea954050de Mon Sep 17 00:00:00 2001 From: Takuya Nishimoto Date: Fri, 31 May 2019 22:35:55 +0900 Subject: [PATCH 4/6] address review comments. revert miscDeps --- miscDeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miscDeps b/miscDeps index a068e120ee0..3a0065301ec 160000 --- a/miscDeps +++ b/miscDeps @@ -1 +1 @@ -Subproject commit a068e120ee075b4697c6b05759eab049223941d0 +Subproject commit 3a0065301ec91c52ae5bebf2c4403ce429db078c From 3824709b4153fa759951e7fc0b7702eb5c0d3245 Mon Sep 17 00:00:00 2001 From: Takuya Nishimoto Date: Tue, 4 Jun 2019 21:21:06 +0900 Subject: [PATCH 5/6] address review comment #9648 --- keyCommandsDoc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/keyCommandsDoc.py b/keyCommandsDoc.py index a0e96715947..c37e56b9195 100644 --- a/keyCommandsDoc.py +++ b/keyCommandsDoc.py @@ -4,7 +4,6 @@ #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2010-2019 NV Access Limited, Mesar Hameed, Takuya Nishimoto -#Copyright (C) 2018-2019 Takuya Nishimoto """Utilities related to NVDA Key Commands documents. """ From c7c1cc551f359fa189631f7b03f91f7604d9198b Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Tue, 11 Jun 2019 12:32:11 +1000 Subject: [PATCH 6/6] Update miscDeps to master containing python3 txt2tags. --- miscDeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miscDeps b/miscDeps index 3a0065301ec..b6d634b8333 160000 --- a/miscDeps +++ b/miscDeps @@ -1 +1 @@ -Subproject commit 3a0065301ec91c52ae5bebf2c4403ce429db078c +Subproject commit b6d634b8333db75f2797e8f241e1501803acbfb3