@jpetit/toolkit 3.1.4 → 3.1.5

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 (45) hide show
  1. package/assets/python/pyexec.py +29 -0
  2. package/dist/index.js +4236 -0
  3. package/package.json +6 -6
  4. package/lib/ai.ts +0 -200
  5. package/lib/cleaner.ts +0 -77
  6. package/lib/compilers/base.ts +0 -159
  7. package/lib/compilers/clojure.ts +0 -87
  8. package/lib/compilers/gcc.ts +0 -39
  9. package/lib/compilers/ghc.ts +0 -39
  10. package/lib/compilers/gxx.ts +0 -39
  11. package/lib/compilers/index.ts +0 -81
  12. package/lib/compilers/java.ts +0 -105
  13. package/lib/compilers/python3.ts +0 -112
  14. package/lib/compilers/run-clojure.ts +0 -101
  15. package/lib/compilers/run-haskell.ts +0 -117
  16. package/lib/compilers/run-python.ts +0 -103
  17. package/lib/compilers/rust.ts +0 -39
  18. package/lib/create-with-jutgeai.ts +0 -407
  19. package/lib/create-with-template.ts +0 -55
  20. package/lib/data.ts +0 -25
  21. package/lib/doctor.ts +0 -238
  22. package/lib/generate.ts +0 -171
  23. package/lib/helpers.ts +0 -48
  24. package/lib/inspector.ts +0 -253
  25. package/lib/jutge_api_client.ts +0 -4631
  26. package/lib/maker.ts +0 -613
  27. package/lib/settings.ts +0 -51
  28. package/lib/tui.ts +0 -152
  29. package/lib/types.ts +0 -55
  30. package/lib/upload.ts +0 -216
  31. package/lib/utils.ts +0 -201
  32. package/lib/versions.ts +0 -47
  33. package/toolkit/about.ts +0 -40
  34. package/toolkit/ai.ts +0 -56
  35. package/toolkit/check.ts +0 -16
  36. package/toolkit/clean.ts +0 -27
  37. package/toolkit/compilers.ts +0 -29
  38. package/toolkit/config.ts +0 -91
  39. package/toolkit/create.ts +0 -37
  40. package/toolkit/doctor.ts +0 -22
  41. package/toolkit/generate.ts +0 -213
  42. package/toolkit/index.ts +0 -59
  43. package/toolkit/make.ts +0 -82
  44. package/toolkit/upgrade.ts +0 -9
  45. 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))