mumuki-python-runner 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/base/query_hook.rb +14 -2
- data/lib/base/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '039cd7e8daf34032853b80ad08223b1af629432395e1036d0c141bcd2a81cb4c'
|
4
|
+
data.tar.gz: eb45b266b689d2d13a18d54a1815a6d2f1b5d255c0dea700f67a17b5a34a5b40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a154c8202c04203bfd5a577d2a70d407ebfd98f24a3050fc524f97bbcb60c724f6944fd613911869160418590a80acf9abdf0aef3dd5b3a7e41904e752cb41f7
|
7
|
+
data.tar.gz: b609e0a9fa6624bb99e1e3b5a2db1ed63d5c131af554feee56e488eb6da67fcfb41abe607a8d2ada3ef0dbd38cfd583be8503388bcb1c658408cf64281b26dbc
|
data/lib/base/query_hook.rb
CHANGED
@@ -27,7 +27,19 @@ python
|
|
27
27
|
if query.match /print *(\(| ).*|^[a-zA-Z_]\w*\s*=[^=].*|^raise\b/
|
28
28
|
query
|
29
29
|
else
|
30
|
-
|
30
|
+
<<~python
|
31
|
+
__mumuki_error__ = None
|
32
|
+
try:
|
33
|
+
__mumuki_args__ = {'mumuki_query_result': eval("""#{query.gsub('"', '\"')}""")}
|
34
|
+
print(string.Template(\"#{output_prefix}\${mumuki_query_result}\").safe_substitute(**__mumuki_args__))
|
35
|
+
except SyntaxError as e:
|
36
|
+
__mumuki_error__ = SyntaxError(e.msg, ('<console>', e.lineno, e.offset, e.text))
|
37
|
+
if __mumuki_error__:
|
38
|
+
print(__mumuki_error__.text)
|
39
|
+
print(" "*(__mumuki_error__.offset - 1) + "^")
|
40
|
+
print('SyntheticMumukiSyntaxError: SyntaxError: ' + str(__mumuki_error__))
|
41
|
+
exit(1)
|
42
|
+
python
|
31
43
|
end
|
32
44
|
end
|
33
45
|
|
@@ -53,7 +65,7 @@ python
|
|
53
65
|
end
|
54
66
|
|
55
67
|
def syntax_error_regexp
|
56
|
-
|
68
|
+
/(SyntheticMumukiSyntaxError: )|(\A File .*\n(?m)(?=.*(SyntaxError|IndentationError)))/
|
57
69
|
end
|
58
70
|
end
|
59
71
|
|
data/lib/base/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-python-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|