plover 5.0.0.dev2__py3-none-any.whl → 5.0.0.dev3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. plover/__init__.py +8 -7
  2. plover/__main__.py +1 -1
  3. plover/command/set_config.py +7 -4
  4. plover/config.py +177 -74
  5. plover/dictionary/base.py +21 -9
  6. plover/dictionary/helpers.py +6 -4
  7. plover/dictionary/json_dict.py +10 -12
  8. plover/dictionary/loading_manager.py +8 -10
  9. plover/dictionary/rtfcre_dict.py +46 -43
  10. plover/dictionary/rtfcre_parse.py +116 -100
  11. plover/engine.py +112 -96
  12. plover/exception.py +4 -1
  13. plover/formatting.py +198 -140
  14. plover/gui_none/add_translation.py +17 -16
  15. plover/gui_none/engine.py +1 -3
  16. plover/gui_none/main.py +2 -2
  17. plover/gui_qt/about_dialog.py +17 -17
  18. plover/gui_qt/add_translation_dialog.py +8 -9
  19. plover/gui_qt/add_translation_widget.py +66 -63
  20. plover/gui_qt/config_window.py +274 -154
  21. plover/gui_qt/console_widget.py +9 -13
  22. plover/gui_qt/dictionaries_widget.py +140 -119
  23. plover/gui_qt/dictionary_editor.py +60 -61
  24. plover/gui_qt/engine.py +3 -3
  25. plover/gui_qt/info_browser.py +50 -4
  26. plover/gui_qt/log_qt.py +3 -2
  27. plover/gui_qt/lookup_dialog.py +9 -9
  28. plover/gui_qt/machine_options.py +38 -37
  29. plover/gui_qt/main.py +19 -19
  30. plover/gui_qt/main_window.py +88 -71
  31. plover/gui_qt/paper_tape.py +69 -52
  32. plover/gui_qt/paper_tape_ui.py +0 -3
  33. plover/gui_qt/plugins_manager.py +47 -43
  34. plover/gui_qt/resources_rc.py +28 -28
  35. plover/gui_qt/run_dialog.py +7 -6
  36. plover/gui_qt/steno_validator.py +2 -3
  37. plover/gui_qt/suggestions_dialog.py +34 -38
  38. plover/gui_qt/suggestions_widget.py +22 -16
  39. plover/gui_qt/tool.py +1 -3
  40. plover/gui_qt/trayicon.py +19 -19
  41. plover/gui_qt/utils.py +19 -9
  42. plover/i18n.py +9 -8
  43. plover/key_combo.py +130 -130
  44. plover/log.py +26 -26
  45. plover/machine/base.py +40 -35
  46. plover/machine/geminipr.py +7 -7
  47. plover/machine/keyboard.py +16 -14
  48. plover/machine/keyboard_capture/__init__.py +0 -1
  49. plover/machine/keymap.py +24 -20
  50. plover/machine/passport.py +6 -5
  51. plover/machine/procat.py +12 -16
  52. plover/machine/stentura.py +45 -29
  53. plover/machine/txbolt.py +5 -3
  54. plover/macro/repeat.py +0 -1
  55. plover/macro/retro.py +9 -9
  56. plover/macro/undo.py +4 -3
  57. plover/meta/attach.py +12 -10
  58. plover/meta/case.py +2 -1
  59. plover/meta/conditional.py +3 -3
  60. plover/meta/currency.py +4 -4
  61. plover/meta/mode.py +15 -15
  62. plover/meta/punctuation.py +1 -0
  63. plover/misc.py +21 -17
  64. plover/orthography.py +12 -10
  65. plover/oslayer/__init__.py +7 -5
  66. plover/oslayer/config.py +16 -15
  67. plover/oslayer/controller.py +13 -13
  68. plover/oslayer/linux/i18n.py +2 -1
  69. plover/oslayer/linux/keyboardcontrol.py +2 -2
  70. plover/oslayer/linux/keyboardcontrol_uinput.py +48 -3
  71. plover/oslayer/linux/keyboardcontrol_x11.py +860 -851
  72. plover/oslayer/linux/log.py +1 -1
  73. plover/oslayer/linux/log_dbus.py +97 -65
  74. plover/oslayer/linux/serial.py +2 -2
  75. plover/oslayer/linux/wmctrl_x11.py +11 -15
  76. plover/oslayer/osx/keyboardcontrol.py +194 -99
  77. plover/oslayer/osx/keyboardlayout.py +138 -119
  78. plover/oslayer/osx/log.py +14 -8
  79. plover/oslayer/osx/serial.py +1 -1
  80. plover/oslayer/osx/wmctrl.py +6 -1
  81. plover/oslayer/windows/keyboardcontrol.py +195 -89
  82. plover/oslayer/windows/keyboardlayout.py +367 -334
  83. plover/oslayer/windows/log.py +5 -3
  84. plover/oslayer/windows/serial.py +4 -5
  85. plover/oslayer/windows/wmctrl.py +1 -1
  86. plover/output/__init__.py +1 -2
  87. plover/output/keyboard.py +15 -15
  88. plover/plugins_manager/__main__.py +42 -39
  89. plover/plugins_manager/global_registry.py +2 -5
  90. plover/plugins_manager/local_registry.py +11 -13
  91. plover/plugins_manager/package_index.py +12 -18
  92. plover/plugins_manager/pip_wrapper.py +5 -5
  93. plover/plugins_manager/plugin_metadata.py +17 -9
  94. plover/plugins_manager/registry.py +39 -28
  95. plover/plugins_manager/requests.py +2 -4
  96. plover/plugins_manager/utils.py +9 -7
  97. plover/registry.py +28 -26
  98. plover/resource.py +13 -10
  99. plover/scripts/dist_main.py +7 -7
  100. plover/scripts/main.py +57 -34
  101. plover/scripts/send_command.py +13 -7
  102. plover/steno.py +16 -9
  103. plover/steno_dictionary.py +47 -21
  104. plover/suggestions.py +11 -11
  105. plover/system/__init__.py +39 -23
  106. plover/system/english_stenotype.py +231 -229
  107. plover/translation.py +67 -51
  108. {plover-5.0.0.dev2.dist-info → plover-5.0.0.dev3.dist-info}/METADATA +1 -1
  109. plover-5.0.0.dev3.dist-info/RECORD +216 -0
  110. plover_build_utils/check_requirements.py +5 -6
  111. plover_build_utils/download.py +10 -8
  112. plover_build_utils/get_pip.py +10 -5
  113. plover_build_utils/install_wheels.py +33 -31
  114. plover_build_utils/pyqt.py +24 -22
  115. plover_build_utils/setup.py +64 -54
  116. plover_build_utils/source_less.py +6 -6
  117. plover_build_utils/testing/blackbox.py +31 -31
  118. plover_build_utils/testing/dict.py +3 -3
  119. plover_build_utils/testing/output.py +5 -6
  120. plover_build_utils/testing/parametrize.py +5 -3
  121. plover_build_utils/testing/steno_dictionary.py +145 -124
  122. plover_build_utils/tree.py +21 -19
  123. plover_build_utils/trim.py +5 -5
  124. plover_build_utils/zipdir.py +3 -3
  125. plover-5.0.0.dev2.dist-info/RECORD +0 -216
  126. {plover-5.0.0.dev2.dist-info → plover-5.0.0.dev3.dist-info}/WHEEL +0 -0
  127. {plover-5.0.0.dev2.dist-info → plover-5.0.0.dev3.dist-info}/entry_points.txt +0 -0
  128. {plover-5.0.0.dev2.dist-info → plover-5.0.0.dev3.dist-info}/licenses/LICENSE.txt +0 -0
  129. {plover-5.0.0.dev2.dist-info → plover-5.0.0.dev3.dist-info}/top_level.txt +0 -0
  130. {plover-5.0.0.dev2.dist-info → plover-5.0.0.dev3.dist-info}/zip-safe +0 -0
@@ -11,17 +11,19 @@ from .config import PLATFORM
11
11
 
12
12
 
13
13
  PLATFORM_PACKAGE = {
14
- 'bsd' : 'linux',
15
- 'linux': 'linux',
16
- 'mac' : 'osx',
17
- 'win' : 'windows',
14
+ "bsd": "linux",
15
+ "linux": "linux",
16
+ "mac": "osx",
17
+ "win": "windows",
18
18
  }
19
19
 
20
+
20
21
  def _add_platform_package_to_path():
21
22
  platform_package = PLATFORM_PACKAGE.get(PLATFORM)
22
23
  if platform_package is None:
23
- log.warning('No platform-specific oslayer package for: %s' % PLATFORM)
24
+ log.warning("No platform-specific oslayer package for: %s" % PLATFORM)
24
25
  return
25
26
  __path__.insert(0, os.path.join(__path__[0], platform_package))
26
27
 
28
+
27
29
  _add_platform_package_to_path()
plover/oslayer/config.py CHANGED
@@ -9,14 +9,14 @@ import sys
9
9
  import appdirs
10
10
 
11
11
 
12
- if sys.platform.startswith('darwin'):
13
- PLATFORM = 'mac'
14
- elif sys.platform.startswith('linux'):
15
- PLATFORM = 'linux'
16
- elif sys.platform.startswith('win'):
17
- PLATFORM = 'win'
18
- elif sys.platform.startswith(('freebsd', 'openbsd')):
19
- PLATFORM = 'bsd'
12
+ if sys.platform.startswith("darwin"):
13
+ PLATFORM = "mac"
14
+ elif sys.platform.startswith("linux"):
15
+ PLATFORM = "linux"
16
+ elif sys.platform.startswith("win"):
17
+ PLATFORM = "win"
18
+ elif sys.platform.startswith(("freebsd", "openbsd")):
19
+ PLATFORM = "bsd"
20
20
  else:
21
21
  PLATFORM = None
22
22
 
@@ -25,20 +25,21 @@ else:
25
25
  # keeping all Plover files in a portable drive.
26
26
  #
27
27
  # Note: the special case when run from an app bundle on macOS.
28
- if PLATFORM == 'mac' and '.app/' in os.path.realpath(__file__):
29
- PROGRAM_DIR = os.path.abspath(os.path.join(os.path.dirname(sys.executable),
30
- *[os.path.pardir] * 3))
28
+ if PLATFORM == "mac" and ".app/" in os.path.realpath(__file__):
29
+ PROGRAM_DIR = os.path.abspath(
30
+ os.path.join(os.path.dirname(sys.executable), *[os.path.pardir] * 3)
31
+ )
31
32
  else:
32
33
  PROGRAM_DIR = os.getcwd()
33
34
 
34
35
  # Setup configuration directory.
35
- CONFIG_BASENAME = 'plover.cfg'
36
+ CONFIG_BASENAME = "plover.cfg"
36
37
  if os.path.isfile(os.path.join(PROGRAM_DIR, CONFIG_BASENAME)):
37
38
  CONFIG_DIR = PROGRAM_DIR
38
39
  else:
39
40
  config_directories = [
40
- getattr(appdirs, directory_type)('plover')
41
- for directory_type in ('user_config_dir', 'user_data_dir')
41
+ getattr(appdirs, directory_type)("plover")
42
+ for directory_type in ("user_config_dir", "user_data_dir")
42
43
  ]
43
44
  for CONFIG_DIR in config_directories:
44
45
  if os.path.isfile(os.path.join(CONFIG_DIR, CONFIG_BASENAME)):
@@ -50,4 +51,4 @@ CONFIG_FILE = os.path.join(CONFIG_DIR, CONFIG_BASENAME)
50
51
  # Setup plugins directory.
51
52
  PLUGINS_PLATFORM = PLATFORM
52
53
 
53
- ASSETS_DIR = os.path.realpath(os.path.join(__file__, '../../assets'))
54
+ ASSETS_DIR = os.path.realpath(os.path.join(__file__, "../../assets"))
@@ -9,14 +9,13 @@ from plover.oslayer.config import PLATFORM
9
9
 
10
10
 
11
11
  class Controller:
12
-
13
- def __init__(self, instance='plover', authkey=b'plover'):
14
- if PLATFORM == 'win':
15
- self._address = r'\\.\pipe' + '\\' + instance
16
- self._family = 'AF_PIPE'
12
+ def __init__(self, instance="plover", authkey=b"plover"):
13
+ if PLATFORM == "win":
14
+ self._address = r"\\.\pipe" + "\\" + instance
15
+ self._family = "AF_PIPE"
17
16
  else:
18
- self._address = os.path.join(tempfile.gettempdir(), instance + '_socket')
19
- self._family = 'AF_UNIX'
17
+ self._address = os.path.join(tempfile.gettempdir(), instance + "_socket")
18
+ self._family = "AF_UNIX"
20
19
  self._authkey = authkey
21
20
  self._listen = None
22
21
  self._thread = None
@@ -28,7 +27,7 @@ class Controller:
28
27
 
29
28
  def force_cleanup(self):
30
29
  assert not self.is_owner
31
- if PLATFORM != 'win' and os.path.exists(self._address):
30
+ if PLATFORM != "win" and os.path.exists(self._address):
32
31
  os.unlink(self._address)
33
32
  return True
34
33
  return False
@@ -36,10 +35,11 @@ class Controller:
36
35
  def __enter__(self):
37
36
  assert self._listen is None
38
37
  try:
39
- self._listen = connection.Listener(self._address, self._family,
40
- authkey=self._authkey)
38
+ self._listen = connection.Listener(
39
+ self._address, self._family, authkey=self._authkey
40
+ )
41
41
  except Exception as e:
42
- if PLATFORM == 'win':
42
+ if PLATFORM == "win":
43
43
  if not isinstance(e, PermissionError):
44
44
  raise
45
45
  else:
@@ -68,7 +68,7 @@ class Controller:
68
68
  if self._accept():
69
69
  break
70
70
  except Exception as e:
71
- log.error('handling client failed', exc_info=True)
71
+ log.error("handling client failed", exc_info=True)
72
72
 
73
73
  def _send_message(self, msg):
74
74
  conn = connection.Client(self._address, self._family, authkey=self._authkey)
@@ -78,7 +78,7 @@ class Controller:
78
78
  conn.close()
79
79
 
80
80
  def send_command(self, command):
81
- self._send_message(('command', command))
81
+ self._send_message(("command", command))
82
82
 
83
83
  def start(self, message_cb):
84
84
  assert self.is_owner
@@ -3,7 +3,8 @@ import os
3
3
 
4
4
 
5
5
  # Note: highest priority first.
6
- LANG_ENV_VARS = ('LC_ALL', 'LC_MESSAGES', 'LANG')
6
+ LANG_ENV_VARS = ("LC_ALL", "LC_MESSAGES", "LANG")
7
+
7
8
 
8
9
  def get_system_language():
9
10
  try:
@@ -1,6 +1,6 @@
1
1
  from .display_server import DISPLAY_SERVER
2
2
 
3
3
  if DISPLAY_SERVER == "x11":
4
- from .keyboardcontrol_x11 import KeyboardCapture, KeyboardEmulation # pylint: disable=unused-import
4
+ from .keyboardcontrol_x11 import KeyboardCapture, KeyboardEmulation # pylint: disable=unused-import
5
5
  else:
6
- from .keyboardcontrol_uinput import KeyboardCapture, KeyboardEmulation #pylint: disable=unused-import
6
+ from .keyboardcontrol_uinput import KeyboardCapture, KeyboardEmulation # pylint: disable=unused-import
@@ -275,9 +275,50 @@ LAYOUTS = {
275
275
  "k": e.KEY_N,
276
276
  "h": e.KEY_M,
277
277
  },
278
+ "dvorak": {
279
+ **BASE_LAYOUT,
280
+ # Top row
281
+ "'": e.KEY_Q,
282
+ ",": e.KEY_W,
283
+ ".": e.KEY_E,
284
+ "p": e.KEY_R,
285
+ "y": e.KEY_T,
286
+ "f": e.KEY_Y,
287
+ "g": e.KEY_U,
288
+ "c": e.KEY_I,
289
+ "r": e.KEY_O,
290
+ "l": e.KEY_P,
291
+ "/": e.KEY_LEFTBRACE,
292
+ "=": e.KEY_RIGHTBRACE,
293
+ # Middle row
294
+ "a": e.KEY_A,
295
+ "o": e.KEY_S,
296
+ "e": e.KEY_D,
297
+ "u": e.KEY_F,
298
+ "i": e.KEY_G,
299
+ "d": e.KEY_H,
300
+ "h": e.KEY_J,
301
+ "t": e.KEY_K,
302
+ "n": e.KEY_L,
303
+ "s": e.KEY_SEMICOLON,
304
+ "-": e.KEY_APOSTROPHE,
305
+ # Bottom row
306
+ ";": e.KEY_Z,
307
+ "q": e.KEY_X,
308
+ "j": e.KEY_C,
309
+ "k": e.KEY_V,
310
+ "x": e.KEY_B,
311
+ "b": e.KEY_N,
312
+ "m": e.KEY_M,
313
+ "w": e.KEY_COMMA,
314
+ "v": e.KEY_DOT,
315
+ "z": e.KEY_SLASH,
316
+ },
278
317
  }
279
318
 
280
- KEYCODE_TO_KEY = dict(zip(LAYOUTS[DEFAULT_LAYOUT].values(), LAYOUTS[DEFAULT_LAYOUT].keys()))
319
+ KEYCODE_TO_KEY = dict(
320
+ zip(LAYOUTS[DEFAULT_LAYOUT].values(), LAYOUTS[DEFAULT_LAYOUT].keys())
321
+ )
281
322
 
282
323
 
283
324
  class KeyboardEmulation(GenericKeyboardEmulation):
@@ -289,7 +330,9 @@ class KeyboardEmulation(GenericKeyboardEmulation):
289
330
 
290
331
  # Check that ibus or fcitx5 is running
291
332
  if not any(p.name() in ["ibus-daemon", "fcitx5"] for p in process_iter()):
292
- log.warning("It appears that an input method, such as ibus or fcitx5, is not running on your system. Without this, some text may not be output correctly.")
333
+ log.warning(
334
+ "It appears that an input method, such as ibus or fcitx5, is not running on your system. Without this, some text may not be output correctly."
335
+ )
293
336
 
294
337
  def _update_layout(self, layout):
295
338
  if not layout in LAYOUTS:
@@ -464,7 +507,9 @@ class KeyboardCapture(Capture):
464
507
  key_name = KEYCODE_TO_KEY[event.code]
465
508
  if key_name in self._suppressed_keys:
466
509
  pressed = event.value == 1
467
- (self.key_down if pressed else self.key_up)(key_name)
510
+ (self.key_down if pressed else self.key_up)(
511
+ key_name
512
+ )
468
513
  continue # Go to the next iteration, skipping the below code:
469
514
  self._ui.write(e.EV_KEY, event.code, event.value)
470
515
  self._ui.syn()