ReForma 0.225__tar.gz → 0.295__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.
- {reforma-0.225 → reforma-0.295}/PKG-INFO +1 -1
- {reforma-0.225 → reforma-0.295}/ReForma.egg-info/PKG-INFO +1 -1
- {reforma-0.225 → reforma-0.295}/pyproject.toml +1 -1
- {reforma-0.225 → reforma-0.295}/reforma/bin/RePATool.jar +0 -0
- {reforma-0.225 → reforma-0.295}/reforma/client.py +19 -8
- {reforma-0.225 → reforma-0.295}/reforma/jar_bridge.py +6 -3
- {reforma-0.225 → reforma-0.295}/MANIFEST.in +0 -0
- {reforma-0.225 → reforma-0.295}/README.md +0 -0
- {reforma-0.225 → reforma-0.295}/ReForma.egg-info/SOURCES.txt +0 -0
- {reforma-0.225 → reforma-0.295}/ReForma.egg-info/dependency_links.txt +0 -0
- {reforma-0.225 → reforma-0.295}/ReForma.egg-info/requires.txt +0 -0
- {reforma-0.225 → reforma-0.295}/ReForma.egg-info/top_level.txt +0 -0
- {reforma-0.225 → reforma-0.295}/reforma/__init__.py +0 -0
- {reforma-0.225 → reforma-0.295}/reforma/bin/js/cytoscape-dagre.js +0 -0
- {reforma-0.225 → reforma-0.295}/reforma/bin/js/cytoscape.min.js +0 -0
- {reforma-0.225 → reforma-0.295}/reforma/bin/js/dagre.js +0 -0
- {reforma-0.225 → reforma-0.295}/reforma/model.py +0 -0
- {reforma-0.225 → reforma-0.295}/setup.cfg +0 -0
- {reforma-0.225 → reforma-0.295}/tests/test_reforma.py +0 -0
|
Binary file
|
|
@@ -869,17 +869,29 @@ class ReForma:
|
|
|
869
869
|
enabled: list[Transition] = []
|
|
870
870
|
variables: dict[str, int] = {}
|
|
871
871
|
|
|
872
|
+
import re
|
|
873
|
+
|
|
872
874
|
for line in lines:
|
|
873
875
|
if line.startswith("Estado Atual:"):
|
|
874
|
-
|
|
875
|
-
current_states = [s.strip() for s in
|
|
876
|
+
st_parts = line.split(":", 1)[1].strip()
|
|
877
|
+
current_states = [s.strip() for s in st_parts.split(",")]
|
|
876
878
|
|
|
877
879
|
elif line.startswith("Variaveis:"):
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
880
|
+
var_parts = line.split(":", 1)[1].strip()
|
|
881
|
+
matches = re.finditer(r"([a-zA-Z0-9_]+)\s*=\s*(?:VInt\(\s*([^,)]+)|VFloat\(\s*([^,)]+)|VBool\(\s*([^,)]+)|([^,]+))", var_parts)
|
|
882
|
+
|
|
883
|
+
for m in matches:
|
|
884
|
+
k = m.group(1)
|
|
885
|
+
val_str = m.group(2) or m.group(3) or m.group(4) or m.group(5)
|
|
886
|
+
if val_str:
|
|
887
|
+
val_str = val_str.strip()
|
|
888
|
+
try:
|
|
889
|
+
variables[k] = int(val_str)
|
|
890
|
+
except ValueError:
|
|
891
|
+
try:
|
|
892
|
+
variables[k] = float(val_str)
|
|
893
|
+
except ValueError:
|
|
894
|
+
variables[k] = val_str
|
|
883
895
|
|
|
884
896
|
m = re.match(
|
|
885
897
|
r"\s*-\s*\[(.+?)\]\s+de\s+(\S+)\s+para\s+(\S+)\s+\(P=([\d.,]+)\)",
|
|
@@ -901,7 +913,6 @@ class ReForma:
|
|
|
901
913
|
raw={},
|
|
902
914
|
)
|
|
903
915
|
|
|
904
|
-
|
|
905
916
|
def _get_local_js(filename: str) -> str:
|
|
906
917
|
"""Reads the local JS file to be injected into HTML."""
|
|
907
918
|
base_dir = os.path.dirname(__file__)
|
|
@@ -99,13 +99,15 @@ class JarBridge:
|
|
|
99
99
|
Run: java -jar <jar> <args...>
|
|
100
100
|
Returns stdout. Raises JarError on non-zero exit.
|
|
101
101
|
"""
|
|
102
|
-
|
|
102
|
+
# Forçamos o Java a usar UTF-8 no Windows
|
|
103
|
+
cmd = [self.java_bin, "-Dfile.encoding=UTF-8", "-jar", self.jar_path, *args]
|
|
103
104
|
result = subprocess.run(
|
|
104
105
|
cmd,
|
|
105
106
|
input=stdin_data,
|
|
106
107
|
capture_output=True,
|
|
107
108
|
text=True,
|
|
108
109
|
encoding="utf-8",
|
|
110
|
+
errors="replace"
|
|
109
111
|
)
|
|
110
112
|
if result.returncode != 0:
|
|
111
113
|
raise JarError(
|
|
@@ -179,12 +181,13 @@ class JarBridge:
|
|
|
179
181
|
Reads and returns the content of this output file.
|
|
180
182
|
JAR progress/logs go to stderr — ignored here.
|
|
181
183
|
"""
|
|
182
|
-
cmd = [self.java_bin, "-jar", self.jar_path, *args]
|
|
184
|
+
cmd = [self.java_bin, "-Dfile.encoding=UTF-8", "-jar", self.jar_path, *args]
|
|
183
185
|
result = subprocess.run(
|
|
184
186
|
cmd,
|
|
185
187
|
capture_output=True,
|
|
186
188
|
text=True,
|
|
187
189
|
encoding="utf-8",
|
|
190
|
+
errors="replace"
|
|
188
191
|
)
|
|
189
192
|
if result.returncode != 0:
|
|
190
193
|
raise JarError(
|
|
@@ -196,7 +199,7 @@ class JarBridge:
|
|
|
196
199
|
f"JAR did not generate the expected output file: {out_path}\n"
|
|
197
200
|
f"stderr: {result.stderr.strip()}"
|
|
198
201
|
)
|
|
199
|
-
with open(out_path, "r", encoding="utf-8") as f:
|
|
202
|
+
with open(out_path, "r", encoding="utf-8", errors="replace") as f:
|
|
200
203
|
return f.read()
|
|
201
204
|
|
|
202
205
|
def merge_models(self, sourceA: str, sourceB: str, op_type: str, agg: str) -> str:
|
|
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
|