@jpetit/toolkit 3.1.4 → 3.1.6
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.
- package/assets/python/pyexec.py +29 -0
- package/dist/index.js +4236 -0
- package/package.json +6 -6
- package/lib/ai.ts +0 -200
- package/lib/cleaner.ts +0 -77
- package/lib/compilers/base.ts +0 -159
- package/lib/compilers/clojure.ts +0 -87
- package/lib/compilers/gcc.ts +0 -39
- package/lib/compilers/ghc.ts +0 -39
- package/lib/compilers/gxx.ts +0 -39
- package/lib/compilers/index.ts +0 -81
- package/lib/compilers/java.ts +0 -105
- package/lib/compilers/python3.ts +0 -112
- package/lib/compilers/run-clojure.ts +0 -101
- package/lib/compilers/run-haskell.ts +0 -117
- package/lib/compilers/run-python.ts +0 -103
- package/lib/compilers/rust.ts +0 -39
- package/lib/create-with-jutgeai.ts +0 -407
- package/lib/create-with-template.ts +0 -55
- package/lib/data.ts +0 -25
- package/lib/doctor.ts +0 -238
- package/lib/generate.ts +0 -171
- package/lib/helpers.ts +0 -48
- package/lib/inspector.ts +0 -253
- package/lib/jutge_api_client.ts +0 -4631
- package/lib/maker.ts +0 -613
- package/lib/settings.ts +0 -51
- package/lib/tui.ts +0 -152
- package/lib/types.ts +0 -55
- package/lib/upload.ts +0 -216
- package/lib/utils.ts +0 -201
- package/lib/versions.ts +0 -47
- package/toolkit/about.ts +0 -40
- package/toolkit/ai.ts +0 -56
- package/toolkit/check.ts +0 -16
- package/toolkit/clean.ts +0 -27
- package/toolkit/compilers.ts +0 -29
- package/toolkit/config.ts +0 -91
- package/toolkit/create.ts +0 -37
- package/toolkit/doctor.ts +0 -22
- package/toolkit/generate.ts +0 -213
- package/toolkit/index.ts +0 -59
- package/toolkit/make.ts +0 -82
- package/toolkit/upgrade.ts +0 -9
- package/toolkit/upload.ts +0 -19
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# type: ignore
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Execute some Python code given from stdin
|
|
5
|
+
and print all resulting global variables as JSON.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
import sys
|
|
10
|
+
import types
|
|
11
|
+
|
|
12
|
+
# Read the code from stdin
|
|
13
|
+
code = sys.stdin.read()
|
|
14
|
+
|
|
15
|
+
# Create a namespace for execution
|
|
16
|
+
namespace = {}
|
|
17
|
+
|
|
18
|
+
# Execute the code in the namespace
|
|
19
|
+
exec(code, namespace)
|
|
20
|
+
|
|
21
|
+
# Filter out built-in variables and imported modules
|
|
22
|
+
variables = {
|
|
23
|
+
key: value
|
|
24
|
+
for key, value in namespace.items()
|
|
25
|
+
if not key.startswith('__') and not isinstance(value, types.ModuleType)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# Print the variables as JSON
|
|
29
|
+
print(json.dumps(variables, indent=4))
|