robotcode-repl-server 0.101.0__tar.gz → 0.103.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: robotcode-repl-server
3
- Version: 0.101.0
3
+ Version: 0.103.0
4
4
  Summary: RobotCode REPL Server for Robot Framework
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://opencollective.com/robotcode
@@ -10,6 +10,7 @@ Project-URL: Issues, https://github.com/robotcodedev/robotcode/issues
10
10
  Project-URL: Source, https://github.com/robotcodedev/robotcode
11
11
  Author-email: Daniel Biehl <dbiehl@live.de>
12
12
  License: Apache-2.0
13
+ License-File: LICENSE.txt
13
14
  Classifier: Development Status :: 5 - Production/Stable
14
15
  Classifier: Framework :: Robot Framework
15
16
  Classifier: Framework :: Robot Framework :: Tool
@@ -24,8 +25,8 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
24
25
  Classifier: Topic :: Utilities
25
26
  Classifier: Typing :: Typed
26
27
  Requires-Python: >=3.8
27
- Requires-Dist: robotcode-jsonrpc2==0.101.0
28
- Requires-Dist: robotcode-runner==0.101.0
28
+ Requires-Dist: robotcode-jsonrpc2==0.103.0
29
+ Requires-Dist: robotcode-runner==0.103.0
29
30
  Description-Content-Type: text/markdown
30
31
 
31
32
  # robotcode-repl-server
@@ -27,8 +27,8 @@ classifiers = [
27
27
  ]
28
28
  dynamic = ["version"]
29
29
  dependencies = [
30
- "robotcode-jsonrpc2==0.101.0",
31
- "robotcode-runner==0.101.0"
30
+ "robotcode-jsonrpc2==0.103.0",
31
+ "robotcode-runner==0.103.0"
32
32
  ]
33
33
 
34
34
  [project.entry-points.robotcode]
@@ -0,0 +1 @@
1
+ __version__ = "0.103.0"
@@ -108,11 +108,14 @@ class Interpreter(BaseInterpreter):
108
108
  self.files = files
109
109
  self.has_input = Event()
110
110
  self.executed = Event()
111
+ self.no_execution = Event()
112
+ self.no_execution.set()
111
113
  self._code: List[str] = []
112
114
  self._success: Optional[bool] = None
113
115
  self._result_data: Optional[ResultData] = None
114
116
  self._result_data_stack: List[ResultData] = []
115
117
  self.collect_messages: bool = False
118
+ self._interrupted = False
116
119
  self._has_shutdown = False
117
120
  self._cell_errors: List[str] = []
118
121
 
@@ -122,11 +125,17 @@ class Interpreter(BaseInterpreter):
122
125
  self.has_input.set()
123
126
 
124
127
  def execute(self, source: str) -> ExecutionResult:
128
+ self.no_execution.wait()
129
+
130
+ self.no_execution.clear()
131
+
125
132
  self._result_data_stack = []
126
133
 
127
134
  self._success = None
128
135
  try:
129
136
  self._cell_errors = []
137
+ self._interrupted = False
138
+
130
139
  self._result_data = RootResultData()
131
140
 
132
141
  self.executed.clear()
@@ -159,6 +168,8 @@ class Interpreter(BaseInterpreter):
159
168
  )
160
169
  except BaseException as e:
161
170
  return ExecutionResult(False, [ExecutionOutput("application/vnd.code.notebook.stderr", str(e))])
171
+ finally:
172
+ self.no_execution.set()
162
173
 
163
174
  def get_input(self) -> Iterator[Optional[Keyword]]:
164
175
  while self._code:
@@ -17,9 +17,13 @@ class ReplServerProtocol(JsonRPCProtocol):
17
17
  return "yeah initialized " + message
18
18
 
19
19
  @rpc_method(name="executeCell", threaded=True)
20
- def execute_cell(self, source: str) -> Optional[ExecutionResult]:
20
+ def execute_cell(self, source: str, language_id: str) -> Optional[ExecutionResult]:
21
21
  return self.interpreter.execute(source)
22
22
 
23
+ @rpc_method(name="interrupt", threaded=True)
24
+ def interrupt(self) -> None:
25
+ self.interpreter.interrupt()
26
+
23
27
  @rpc_method(name="shutdown", threaded=True)
24
28
  def shutdown(self) -> None:
25
29
  try:
@@ -1 +0,0 @@
1
- __version__ = "0.101.0"