amalgam-lang 16.0.0__tar.gz → 16.1.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.
Potentially problematic release.
This version of amalgam-lang might be problematic. Click here for more details.
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/PKG-INFO +2 -2
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/api.py +127 -3
- amalgam_lang-16.1.1/amalgam/lib/darwin/amd64/amalgam-mt-noavx.dylib +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/lib/darwin/amd64/amalgam-mt.dylib +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/lib/darwin/amd64/amalgam-omp.dylib +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/lib/darwin/amd64/amalgam-st.dylib +0 -0
- amalgam_lang-16.1.1/amalgam/lib/darwin/amd64/docs/version.json +3 -0
- amalgam_lang-16.1.1/amalgam/lib/darwin/arm64/amalgam-mt.dylib +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/lib/darwin/arm64/amalgam-omp.dylib +0 -0
- amalgam_lang-16.1.1/amalgam/lib/darwin/arm64/amalgam-st.dylib +0 -0
- amalgam_lang-16.1.1/amalgam/lib/darwin/arm64/docs/version.json +3 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/lib/linux/amd64/amalgam-mt-afmi.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/amd64/amalgam-mt-noavx.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/amd64/amalgam-mt.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/amd64/amalgam-omp.so +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/lib/linux/amd64/amalgam-st-afmi.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/amd64/amalgam-st.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/amd64/docs/version.json +3 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/arm64/amalgam-mt.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/arm64/amalgam-omp.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/arm64/amalgam-st.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/arm64/docs/version.json +3 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/arm64_8a/amalgam-st.so +0 -0
- amalgam_lang-16.1.1/amalgam/lib/linux/arm64_8a/docs/version.json +3 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/lib/version.json +3 -3
- amalgam_lang-16.1.1/amalgam/lib/windows/amd64/amalgam-mt-noavx.dll +0 -0
- amalgam_lang-16.1.1/amalgam/lib/windows/amd64/amalgam-mt.dll +0 -0
- amalgam_lang-16.1.1/amalgam/lib/windows/amd64/amalgam-omp.dll +0 -0
- amalgam_lang-16.1.1/amalgam/lib/windows/amd64/amalgam-st.dll +0 -0
- amalgam_lang-16.1.1/amalgam/lib/windows/amd64/docs/version.json +3 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam_lang.egg-info/PKG-INFO +2 -2
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/version.json +1 -1
- amalgam_lang-16.0.0/amalgam/lib/darwin/amd64/amalgam-mt-noavx.dylib +0 -0
- amalgam_lang-16.0.0/amalgam/lib/darwin/amd64/docs/version.json +0 -3
- amalgam_lang-16.0.0/amalgam/lib/darwin/arm64/amalgam-mt.dylib +0 -0
- amalgam_lang-16.0.0/amalgam/lib/darwin/arm64/amalgam-st.dylib +0 -0
- amalgam_lang-16.0.0/amalgam/lib/darwin/arm64/docs/version.json +0 -3
- amalgam_lang-16.0.0/amalgam/lib/linux/amd64/amalgam-mt-noavx.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/amd64/amalgam-mt.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/amd64/amalgam-omp.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/amd64/amalgam-st.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/amd64/docs/version.json +0 -3
- amalgam_lang-16.0.0/amalgam/lib/linux/arm64/amalgam-mt.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/arm64/amalgam-omp.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/arm64/amalgam-st.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/arm64/docs/version.json +0 -3
- amalgam_lang-16.0.0/amalgam/lib/linux/arm64_8a/amalgam-st.so +0 -0
- amalgam_lang-16.0.0/amalgam/lib/linux/arm64_8a/docs/version.json +0 -3
- amalgam_lang-16.0.0/amalgam/lib/windows/amd64/amalgam-mt-noavx.dll +0 -0
- amalgam_lang-16.0.0/amalgam/lib/windows/amd64/amalgam-mt.dll +0 -0
- amalgam_lang-16.0.0/amalgam/lib/windows/amd64/amalgam-omp.dll +0 -0
- amalgam_lang-16.0.0/amalgam/lib/windows/amd64/amalgam-st.dll +0 -0
- amalgam_lang-16.0.0/amalgam/lib/windows/amd64/docs/version.json +0 -3
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.coveragerc +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.flake8 +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.github/CODEOWNERS +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.github/templates/version_summary.md +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.github/workflows/build-pr.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.github/workflows/build-release.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.github/workflows/build.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.gitignore +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/.pylintrc +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/CONTRIBUTING.md +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/LICENSE.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/MANIFEST.in +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/README.md +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam/__init__.py +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam_lang.egg-info/SOURCES.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam_lang.egg-info/dependency_links.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam_lang.egg-info/requires.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/amalgam_lang.egg-info/top_level.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/bin/build.sh +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/config/latest-mt-debug-howso.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/config/latest-mt-howso.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/config/latest-mt-traces-howso.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/config/latest-st-howso.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/config/latest-st-traces-howso.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/doc/dependency_decisions.yml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/pyproject.toml +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/requirements-3.10-dev.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/requirements-3.11-dev.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/requirements-3.12-dev.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/requirements-3.9-dev.txt +0 -0
- {amalgam_lang-16.0.0 → amalgam_lang-16.1.1}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from ctypes import (
|
|
4
|
-
_Pointer, Array, byref, c_bool, c_char, c_char_p,
|
|
4
|
+
_Pointer, Array, byref, c_bool, c_char, c_char_p, c_size_t, c_uint64, c_void_p,
|
|
5
5
|
cast, cdll, POINTER, Structure
|
|
6
6
|
)
|
|
7
7
|
from datetime import datetime
|
|
@@ -55,8 +55,8 @@ class LoadEntityStatus:
|
|
|
55
55
|
self.version = ""
|
|
56
56
|
else:
|
|
57
57
|
self.loaded = bool(c_status.loaded)
|
|
58
|
-
self.message = api.
|
|
59
|
-
self.version = api.
|
|
58
|
+
self.message = api.char_p_to_str(c_status.message)
|
|
59
|
+
self.version = api.char_p_to_str(c_status.version)
|
|
60
60
|
|
|
61
61
|
def __str__(self) -> str:
|
|
62
62
|
"""
|
|
@@ -70,6 +70,57 @@ class LoadEntityStatus:
|
|
|
70
70
|
return f"{self.loaded},\"{self.message}\",\"{self.version}\""
|
|
71
71
|
|
|
72
72
|
|
|
73
|
+
class _ResultWithLog(Structure):
|
|
74
|
+
"""The C-native version of :class:`ResultWithLog`."""
|
|
75
|
+
_fields_ = [
|
|
76
|
+
("json", POINTER(c_char)),
|
|
77
|
+
("log", POINTER(c_char))
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class ResultWithLog:
|
|
82
|
+
"""
|
|
83
|
+
Return value from :func:`~api.Amalgam.execute_entity_json_logged`.
|
|
84
|
+
|
|
85
|
+
Parameters
|
|
86
|
+
----------
|
|
87
|
+
json : str | None
|
|
88
|
+
The JSON-format response from the Amalgam invocation.
|
|
89
|
+
log : str | None
|
|
90
|
+
The Amalgam-syntax transaction-log entry.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
def __init__(self, *, json: str | None, log: str | None):
|
|
94
|
+
self.json = json
|
|
95
|
+
"""The JSON-format response from the Amalgam invocation."""
|
|
96
|
+
|
|
97
|
+
self.log = log
|
|
98
|
+
"""The Amalgam-syntax transaction-log entry."""
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_c_result(cls, api: Amalgam, c_result: _ResultWithLog) -> t.Self:
|
|
102
|
+
"""
|
|
103
|
+
Construct a `ResultWithLog` from the raw C result.
|
|
104
|
+
|
|
105
|
+
Frees the strings in the C result.
|
|
106
|
+
|
|
107
|
+
Parameters
|
|
108
|
+
----------
|
|
109
|
+
api : Amalgam
|
|
110
|
+
The Amalgam API layer.
|
|
111
|
+
c_result: _ResultWithLog
|
|
112
|
+
The raw C result structure.
|
|
113
|
+
|
|
114
|
+
Returns
|
|
115
|
+
-------
|
|
116
|
+
ResultWithLog
|
|
117
|
+
A populated Python-side structure.
|
|
118
|
+
"""
|
|
119
|
+
json = api.char_p_to_str(c_result.json)
|
|
120
|
+
log = api.char_p_to_str(c_result.log)
|
|
121
|
+
return cls(json=json, log=log)
|
|
122
|
+
|
|
123
|
+
|
|
73
124
|
class Amalgam:
|
|
74
125
|
"""
|
|
75
126
|
A general python direct interface to the Amalgam library.
|
|
@@ -625,6 +676,29 @@ class Amalgam:
|
|
|
625
676
|
|
|
626
677
|
return bytes_str
|
|
627
678
|
|
|
679
|
+
def char_p_to_str(self, p: _Pointer[c_char] | c_char_p) -> str | None:
|
|
680
|
+
"""
|
|
681
|
+
Copy native C char pointer to UTF-8-encoded string, cleaning up memory correctly.
|
|
682
|
+
|
|
683
|
+
Parameters
|
|
684
|
+
----------
|
|
685
|
+
p : c_char_p
|
|
686
|
+
The char pointer to convert
|
|
687
|
+
|
|
688
|
+
Returns
|
|
689
|
+
-------
|
|
690
|
+
str or None
|
|
691
|
+
The resulting string
|
|
692
|
+
"""
|
|
693
|
+
b = self.char_p_to_bytes(p)
|
|
694
|
+
s: str | None = None
|
|
695
|
+
if b is not None:
|
|
696
|
+
try:
|
|
697
|
+
s = b.decode("UTF-8")
|
|
698
|
+
except UnicodeDecodeError:
|
|
699
|
+
s = None
|
|
700
|
+
return s
|
|
701
|
+
|
|
628
702
|
def get_json_from_label(self, handle: str, label: str) -> bytes:
|
|
629
703
|
"""
|
|
630
704
|
Get a label from amalgam and returns it in json format.
|
|
@@ -1058,6 +1132,56 @@ class Amalgam:
|
|
|
1058
1132
|
|
|
1059
1133
|
return result
|
|
1060
1134
|
|
|
1135
|
+
def execute_entity_json_logged(
|
|
1136
|
+
self,
|
|
1137
|
+
handle: str,
|
|
1138
|
+
label: str,
|
|
1139
|
+
json: str | bytes
|
|
1140
|
+
) -> ResultWithLog:
|
|
1141
|
+
"""
|
|
1142
|
+
Execute a label, and also return a transaction log.
|
|
1143
|
+
|
|
1144
|
+
Parameters
|
|
1145
|
+
----------
|
|
1146
|
+
handle : str
|
|
1147
|
+
The handle of the amalgam entity.
|
|
1148
|
+
|
|
1149
|
+
label : str
|
|
1150
|
+
The label to execute.
|
|
1151
|
+
json : str or bytes
|
|
1152
|
+
A json representation of parameters for the label to be executed.
|
|
1153
|
+
|
|
1154
|
+
Returns
|
|
1155
|
+
-------
|
|
1156
|
+
ResultWithLog
|
|
1157
|
+
Both a JSON-encoded response and the Amalgam-format transaction log entry.
|
|
1158
|
+
|
|
1159
|
+
"""
|
|
1160
|
+
self.amlg.ExecuteEntityJsonPtrLogged.restype = _ResultWithLog
|
|
1161
|
+
self.amlg.ExecuteEntityJsonPtrLogged.argtypes = [
|
|
1162
|
+
c_char_p, c_char_p, c_char_p]
|
|
1163
|
+
handle_buf = self.str_to_char_p(handle)
|
|
1164
|
+
label_buf = self.str_to_char_p(label)
|
|
1165
|
+
json_buf = self.str_to_char_p(json)
|
|
1166
|
+
|
|
1167
|
+
self._log_time("EXECUTION START")
|
|
1168
|
+
self._log_execution((
|
|
1169
|
+
"EXECUTE_ENTITY_JSON_LOGGED "
|
|
1170
|
+
f"\"{self.escape_double_quotes(handle)}\" "
|
|
1171
|
+
f"\"{self.escape_double_quotes(label)}\" "
|
|
1172
|
+
f"{json}"
|
|
1173
|
+
))
|
|
1174
|
+
result = ResultWithLog.from_c_result(self, self.amlg.ExecuteEntityJsonPtrLogged(
|
|
1175
|
+
handle_buf, label_buf, json_buf))
|
|
1176
|
+
self._log_time("EXECUTION STOP")
|
|
1177
|
+
self._log_reply(result)
|
|
1178
|
+
|
|
1179
|
+
del handle_buf
|
|
1180
|
+
del label_buf
|
|
1181
|
+
del json_buf
|
|
1182
|
+
|
|
1183
|
+
return result
|
|
1184
|
+
|
|
1061
1185
|
def eval_on_entity(
|
|
1062
1186
|
self,
|
|
1063
1187
|
handle: str,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": {
|
|
3
|
-
"amalgam": "58.
|
|
4
|
-
"amalgam_sha": "
|
|
5
|
-
"amalgam_url": "https://github.com/howsoai/amalgam/releases/tag/58.
|
|
3
|
+
"amalgam": "58.1.2",
|
|
4
|
+
"amalgam_sha": "958716b45d285cf601eed89ecd65bd56ca0be639",
|
|
5
|
+
"amalgam_url": "https://github.com/howsoai/amalgam/releases/tag/58.1.2",
|
|
6
6
|
"amalgam_build_date": "",
|
|
7
7
|
"amalgam_display_title": ""
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|