commit/unicodeBrailleInput: pzajda: Add a check box to decide to replace or not the braille space by the regular one.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Mon, 30 Sep 2013 09:04:13 -0000

1 new commit in unicodeBrailleInput:

https://bitbucket.org/nvdaaddonteam/unicodebrailleinput/commits/5d231fa4551e/
Changeset:   5d231fa4551e
Branch:      master
User:        pzajda
Date:        2013-09-30 11:03:46
Summary:     Add a check box to decide to replace or not the braille space by 
the regular one.

Affected #:  2 files

diff --git a/addon/globalPlugins/unicodeBrailleInput/interface.py 
b/addon/globalPlugins/unicodeBrailleInput/interface.py
index b0c3996..238f3e0 100644
--- a/addon/globalPlugins/unicodeBrailleInput/interface.py
+++ b/addon/globalPlugins/unicodeBrailleInput/interface.py
@@ -27,9 +27,10 @@ else:
        conv = chr
 
 invalidInputRegexp = compile('[^0-8-]+')
-def dots2uni(cells):
+def dots2uni(cells, regularSpace = False):
        """ Convert a braille to Unicode
        @param cells the braille cells (I.E. 13457-12367-1457-17)
+       @param regularSpace boolean if True, space will be replaced by a 
regulare one instead of the braille space
        @return the result in Unicode (NVDA in our example)
        """
        cells = cells.strip()
@@ -56,7 +57,7 @@ def dots2uni(cells):
                        val |= 0x2800
                        out.append(conv(val))
                else:
-                       out.append(conv(0x2800))
+                       out.append(u" " if regularSpace else conv(0x2800))
        return "".join(out)
 
 class B2UDialog(gui.SettingsDialog):
@@ -72,6 +73,11 @@ class B2UDialog(gui.SettingsDialog):
                brailleTextSizer.Add(brailleTextLabel)
                self._brailleTextEdit = wx.TextCtrl(self, -1)
                brailleTextSizer.Add(self._brailleTextEdit)
+               self._regularSpaceChk = wx.CheckBox(self,
+               # Translators: wether to use a regular space or the Braille one
+                       label = _("Convert unicode braille space to ascii 
space."))
+               self._regularSpaceChk.SetValue(False)
+               brailleTextSizer.Add(self._regularSpaceChk)
                sizer.Add(brailleTextSizer)
 
        def postInit(self):
@@ -80,8 +86,9 @@ class B2UDialog(gui.SettingsDialog):
        def onOk(self, event):
                super(B2UDialog, self).onOk(event)
                value = self._brailleTextEdit.GetValue()
+               regularSpace = self._regularSpaceChk.GetValue()
                try:
-                       value = dots2uni(value)
+                       value = dots2uni(value, regularSpace)
                        copyToClip(value)
                        # Translators: This is the message when unicode text 
has been copied to the clipboard.
                        wx.CallLater(100, message, _("Unicode text copied to 
clipboard ready for you to paste."))

diff --git a/readme.md b/readme.md
index 4fceda6..ded3218 100644
--- a/readme.md
+++ b/readme.md
@@ -22,7 +22,7 @@ and to add automatic tests for your language.
 * New languages: Aragonese, Arabic, Brazilian Portuguese, Dutch, Finnish, 
German, Galician, Hungarian, Italian, Japanese, Nepali, Russian, Slovak, 
Slovenian, Spanish.
 * Use the new addon template so provide documentation under NVDA help menu.
 * Add a menu item named Unicode Braille Input under NVDA help menu which calls 
the script.
-* Replace the regular space character by 0x2800 to be ISO standard compliant.
+* Add a checkbox to replace or not the space braille (character 0x2800) by the 
regular space character.
 
 ## Changes for 1.0 ##

Repository URL: https://bitbucket.org/nvdaaddonteam/unicodebrailleinput/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/unicodeBrailleInput: pzajda: Add a check box to decide to replace or not the braille space by the regular one. - commits-noreply