pyact-cli 0.7.0__tar.gz → 0.7.1__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.
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/PKG-INFO +1 -1
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact/core.py +16 -5
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact_cli.egg-info/PKG-INFO +1 -1
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/setup.py +1 -1
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/README.md +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pamd_helpers/__init__.py +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact/__init__.py +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact/cli.py +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact/css2json.py +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact/linter.py +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact/mdTOword.py +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact/py2tex.py +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact_cli.egg-info/SOURCES.txt +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact_cli.egg-info/dependency_links.txt +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact_cli.egg-info/entry_points.txt +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact_cli.egg-info/requires.txt +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/pyact_cli.egg-info/top_level.txt +0 -0
- {pyact_cli-0.7.0 → pyact_cli-0.7.1}/setup.cfg +0 -0
|
@@ -2,6 +2,7 @@ import re
|
|
|
2
2
|
import json
|
|
3
3
|
import time
|
|
4
4
|
import os
|
|
5
|
+
import linecache
|
|
5
6
|
|
|
6
7
|
build_logs = []
|
|
7
8
|
|
|
@@ -74,14 +75,23 @@ def get_imports(file: str, code_text: str):
|
|
|
74
75
|
Outputs:
|
|
75
76
|
dict: The dictionary of variables returned by the user's `context()` function.
|
|
76
77
|
"""
|
|
77
|
-
|
|
78
|
+
filename = f"{file}.pamd"
|
|
79
|
+
file_namespace = {"__file__": filename}
|
|
78
80
|
if not code_text.strip():
|
|
79
|
-
raise ValueError(f"The file {
|
|
81
|
+
raise ValueError(f"The file {filename} needs a 'context()' function but has no code cell.")
|
|
80
82
|
|
|
81
83
|
try:
|
|
82
|
-
|
|
84
|
+
# Mock linecache so inspect.getsource works on dynamically executed code
|
|
85
|
+
linecache.cache[filename] = (
|
|
86
|
+
len(code_text),
|
|
87
|
+
None,
|
|
88
|
+
[line + '\n' for line in code_text.splitlines()],
|
|
89
|
+
filename
|
|
90
|
+
)
|
|
91
|
+
compiled_code = compile(code_text, filename, "exec")
|
|
92
|
+
exec(compiled_code, file_namespace)
|
|
83
93
|
except Exception as e:
|
|
84
|
-
raise RuntimeError(f"Error executing code in {
|
|
94
|
+
raise RuntimeError(f"Error executing code in {filename}: {e}")
|
|
85
95
|
|
|
86
96
|
if "context" not in file_namespace:
|
|
87
97
|
raise ValueError(f"The file {file}.pamd is missing the required 'context()' function.")
|
|
@@ -111,7 +121,8 @@ def get_globals(directory: str):
|
|
|
111
121
|
|
|
112
122
|
file_namespace = {"__file__": global_path}
|
|
113
123
|
try:
|
|
114
|
-
|
|
124
|
+
compiled_code = compile(code_text, global_path, "exec")
|
|
125
|
+
exec(compiled_code, file_namespace)
|
|
115
126
|
except Exception as e:
|
|
116
127
|
raise RuntimeError(f"Error executing global.py: {e}")
|
|
117
128
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|