robotframework-debug 3.5.3__tar.gz → 3.6.0__tar.gz

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 (37) hide show
  1. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/PKG-INFO +1 -1
  2. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/prompttoolkitcmd.py +10 -0
  3. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/robotkeyword.py +15 -1
  4. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/styles.py +16 -12
  5. robotframework-debug-3.6.0/RobotDebug/version.py +1 -0
  6. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/robotframework_debug.egg-info/PKG-INFO +1 -1
  7. robotframework-debug-3.5.3/RobotDebug/version.py +0 -1
  8. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/.coveragerc +0 -0
  9. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/.gitpod.yml +0 -0
  10. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/ChangeLog +0 -0
  11. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/CreateWheel.sh +0 -0
  12. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/LICENSE +0 -0
  13. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/MANIFEST.in +0 -0
  14. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/README.rst +0 -0
  15. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/__init__.py +0 -0
  16. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/cmdcompleter.py +0 -0
  17. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/debugcmd.py +0 -0
  18. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/globals.py +0 -0
  19. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/keywords.py +0 -0
  20. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/robotapp.py +0 -0
  21. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/robotlib.py +0 -0
  22. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/robotvar.py +0 -0
  23. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/shell.py +0 -0
  24. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/sourcelines.py +0 -0
  25. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/RobotDebug/steplistener.py +0 -0
  26. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/_config.yml +0 -0
  27. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/robotframework_debug.egg-info/SOURCES.txt +0 -0
  28. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/robotframework_debug.egg-info/dependency_links.txt +0 -0
  29. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/robotframework_debug.egg-info/entry_points.txt +0 -0
  30. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/robotframework_debug.egg-info/not-zip-safe +0 -0
  31. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/robotframework_debug.egg-info/requires.txt +0 -0
  32. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/robotframework_debug.egg-info/top_level.txt +0 -0
  33. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/setup.cfg +0 -0
  34. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/setup.py +0 -0
  35. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/tests/__init__.py +0 -0
  36. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/tests/step.robot +0 -0
  37. {robotframework-debug-3.5.3 → robotframework-debug-3.6.0}/tests/test_debuglibrary.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotframework-debug
3
- Version: 3.5.3
3
+ Version: 3.6.0
4
4
  Summary: RobotFramework debug shell
5
5
  Home-page: https://github.com/imbus/robotframework-debug/
6
6
  Author: René Rohner
@@ -4,6 +4,7 @@ import re
4
4
 
5
5
  from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
6
6
  from prompt_toolkit.buffer import Buffer
7
+ from prompt_toolkit.cursor_shapes import CursorShape
7
8
  from prompt_toolkit.history import FileHistory
8
9
  from prompt_toolkit.key_binding import KeyBindings
9
10
  from prompt_toolkit.lexers import PygmentsLexer
@@ -22,6 +23,8 @@ from pygments.lexers.robotframework import (
22
23
  _Table,
23
24
  )
24
25
 
26
+ from .robotkeyword import get_rprompt_text
27
+
25
28
 
26
29
  class KeywordCall(Tokenizer):
27
30
  _tokens = (KEYWORD, ARGUMENT)
@@ -307,6 +310,9 @@ Type "help" for more information.\
307
310
  BaseCmd.__init__(self, completekey, stdin, stdout)
308
311
  self.history = FileHistory(os.path.expanduser(history_path))
309
312
 
313
+ def prompt_continuation(self, width, line_number, is_soft_wrap):
314
+ return " " * width
315
+
310
316
  def get_input(self):
311
317
  kwargs = {}
312
318
  if self.get_prompt_tokens:
@@ -325,6 +331,10 @@ Type "help" for more information.\
325
331
  complete_style=CompleteStyle.COLUMN,
326
332
  key_bindings=kb,
327
333
  lexer=PygmentsLexer(RobotFrameworkLexer),
334
+ rprompt=get_rprompt_text(),
335
+ prompt_continuation=self.prompt_continuation,
336
+ mouse_support=True,
337
+ cursor=CursorShape.BLINKING_BEAM,
328
338
  **kwargs
329
339
  )
330
340
  except EOFError:
@@ -1,5 +1,6 @@
1
1
  import re
2
2
  import tempfile
3
+ import time
3
4
  from pathlib import Path
4
5
  from typing import List, Tuple
5
6
 
@@ -14,6 +15,7 @@ KEYWORD_SEP = re.compile(" +|\t")
14
15
 
15
16
  _lib_keywords_cache = {}
16
17
  temp_resources = []
18
+ last_keyword_exec_time = 0
17
19
 
18
20
 
19
21
  def parse_keyword(command) -> Tuple[List[str], str, List[str]]:
@@ -72,6 +74,8 @@ def find_keyword(keyword_name):
72
74
 
73
75
  def run_command(builtin, command: str) -> List[Tuple[str, str]]:
74
76
  """Run a command in robotframewrk environment."""
77
+ global last_keyword_exec_time
78
+ last_keyword_exec_time = 0
75
79
  if not command:
76
80
  return []
77
81
  if is_variable(command):
@@ -80,15 +84,18 @@ def run_command(builtin, command: str) -> List[Tuple[str, str]]:
80
84
  if command.startswith("***"):
81
85
  _import_resource_from_string(command)
82
86
  return []
83
-
84
87
  test = get_test_body_from_string(command)
85
88
  if len(test.body) > 1:
89
+ start = time.monotonic()
86
90
  for kw in test.body:
87
91
  kw.run(ctx)
92
+ last_keyword_exec_time = time.monotonic() - start
88
93
  return_val = None
89
94
  else:
90
95
  kw = test.body[0]
96
+ start = time.monotonic()
91
97
  return_val = kw.run(ctx)
98
+ last_keyword_exec_time = time.monotonic() - start
92
99
  assign = set(_get_assignments(test))
93
100
  if not assign and return_val is not None:
94
101
  return [("<", repr(return_val))]
@@ -103,6 +110,13 @@ def run_command(builtin, command: str) -> List[Tuple[str, str]]:
103
110
  return []
104
111
 
105
112
 
113
+ def get_rprompt_text():
114
+ """Get text for bottom toolbar."""
115
+ if last_keyword_exec_time == 0:
116
+ return
117
+ return [("class:pygments.comment", f"# ΔT: {last_keyword_exec_time:.3f}s")]
118
+
119
+
106
120
  def get_test_body_from_string(command):
107
121
  if "\n" in command:
108
122
  command = "\n ".join(command.split("\n"))
@@ -1,7 +1,7 @@
1
1
  from prompt_toolkit import print_formatted_text
2
2
  from prompt_toolkit.completion import Completion
3
3
  from prompt_toolkit.formatted_text import FormattedText
4
- from prompt_toolkit.styles import Style, style_from_pygments_cls, merge_styles
4
+ from prompt_toolkit.styles import Style, merge_styles, style_from_pygments_cls
5
5
  from pygments.styles import get_all_styles, get_style_by_name
6
6
 
7
7
  NORMAL_STYLE = Style.from_dict(
@@ -11,18 +11,19 @@ NORMAL_STYLE = Style.from_dict(
11
11
  }
12
12
  )
13
13
 
14
- ERROR_STYLE = Style.from_dict(
15
- {
16
- "head": "fg:red"
17
- }
18
- )
14
+ ERROR_STYLE = Style.from_dict({"head": "fg:red"})
19
15
 
20
- DEBUG_PROMPT_STYLE = merge_styles([Style.from_dict(
21
- {
22
- "pygments.name.function": "bold",
23
- "pygments.literal.string": "italic",
24
- }
25
- ), style_from_pygments_cls(get_style_by_name("solarized-dark"))])
16
+ DEBUG_PROMPT_STYLE = merge_styles(
17
+ [
18
+ Style.from_dict(
19
+ {
20
+ "pygments.name.function": "bold",
21
+ "pygments.literal.string": "italic",
22
+ }
23
+ ),
24
+ style_from_pygments_cls(get_style_by_name("solarized-dark")),
25
+ ]
26
+ )
26
27
 
27
28
 
28
29
  def get_pygments_styles():
@@ -70,6 +71,9 @@ def _get_style_completions(text):
70
71
  start,
71
72
  display=name,
72
73
  display_meta="",
74
+ style=dict(style_from_pygments_cls(get_style_by_name(name)).style_rules).get(
75
+ "pygments.name.function"
76
+ ),
73
77
  )
74
78
  for name in get_pygments_styles()
75
79
  if (name.lower().strip().startswith(style_part))
@@ -0,0 +1 @@
1
+ VERSION = "3.6.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotframework-debug
3
- Version: 3.5.3
3
+ Version: 3.6.0
4
4
  Summary: RobotFramework debug shell
5
5
  Home-page: https://github.com/imbus/robotframework-debug/
6
6
  Author: René Rohner
@@ -1 +0,0 @@
1
- VERSION = "3.5.3"