amalgam-lang 6.1.4__tar.gz → 7.0.0__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-6.1.4 → amalgam-lang-7.0.0}/.github/workflows/build.yml +5 -5
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/PKG-INFO +1 -1
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/api.py +205 -29
- amalgam-lang-7.0.0/amalgam/lib/darwin/amd64/amalgam-mt-noavx.dylib +0 -0
- amalgam-lang-7.0.0/amalgam/lib/darwin/amd64/amalgam-mt.dylib +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/lib/darwin/amd64/amalgam-omp.dylib +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/lib/darwin/amd64/amalgam-st.dylib +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/lib/darwin/arm64/amalgam-mt.dylib +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/lib/darwin/arm64/amalgam-omp.dylib +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/lib/darwin/arm64/amalgam-st.dylib +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/amd64/amalgam-mt-noavx.so +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/amd64/amalgam-mt.so +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/amd64/amalgam-omp.so +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/amd64/amalgam-st.so +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/arm64/amalgam-mt.so +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/arm64/amalgam-omp.so +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/arm64/amalgam-st.so +0 -0
- amalgam-lang-7.0.0/amalgam/lib/linux/arm64_8a/amalgam-st.so +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/lib/version.json +3 -3
- amalgam-lang-7.0.0/amalgam/lib/windows/amd64/amalgam-mt-noavx.dll +0 -0
- amalgam-lang-7.0.0/amalgam/lib/windows/amd64/amalgam-mt.dll +0 -0
- amalgam-lang-7.0.0/amalgam/lib/windows/amd64/amalgam-omp.dll +0 -0
- amalgam-lang-7.0.0/amalgam/lib/windows/amd64/amalgam-st.dll +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam_lang.egg-info/PKG-INFO +1 -1
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/bin/build.sh +2 -2
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/version.json +1 -1
- amalgam-lang-6.1.4/amalgam/lib/darwin/amd64/amalgam-mt-noavx.dylib +0 -0
- amalgam-lang-6.1.4/amalgam/lib/darwin/amd64/amalgam-mt.dylib +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/amd64/amalgam-mt-noavx.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/amd64/amalgam-mt.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/amd64/amalgam-omp.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/amd64/amalgam-st.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/arm64/amalgam-mt.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/arm64/amalgam-omp.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/arm64/amalgam-st.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/linux/arm64_8a/amalgam-st.so +0 -0
- amalgam-lang-6.1.4/amalgam/lib/windows/amd64/amalgam-mt-noavx.dll +0 -0
- amalgam-lang-6.1.4/amalgam/lib/windows/amd64/amalgam-mt.dll +0 -0
- amalgam-lang-6.1.4/amalgam/lib/windows/amd64/amalgam-omp.dll +0 -0
- amalgam-lang-6.1.4/amalgam/lib/windows/amd64/amalgam-st.dll +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.coveragerc +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.flake8 +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.github/CODEOWNERS +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.github/templates/version_summary.md +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.github/workflows/build-pr.yml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.github/workflows/build-release.yml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.gitignore +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/.pylintrc +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/CONTRIBUTING.md +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/LICENSE.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/MANIFEST.in +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/README.md +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam/__init__.py +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam_lang.egg-info/SOURCES.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam_lang.egg-info/dependency_links.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam_lang.egg-info/requires.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/amalgam_lang.egg-info/top_level.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/config/latest-mt-debug-howso.yml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/config/latest-mt-howso.yml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/config/latest-st-debug-howso.yml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/config/latest-st-howso.yml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/doc/dependency_decisions.yml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/pyproject.toml +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/requirements-3.10-dev.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/requirements-3.11-dev.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/requirements-3.8-dev.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/requirements-3.9-dev.txt +0 -0
- {amalgam-lang-6.1.4 → amalgam-lang-7.0.0}/setup.cfg +0 -0
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
- uses: actions/checkout@v4
|
|
51
51
|
|
|
52
52
|
- name: Set up Python
|
|
53
|
-
uses: actions/setup-python@
|
|
53
|
+
uses: actions/setup-python@v5
|
|
54
54
|
with:
|
|
55
55
|
python-version: "3.8"
|
|
56
56
|
|
|
@@ -179,14 +179,14 @@ jobs:
|
|
|
179
179
|
|
|
180
180
|
- name: Upload Tarball Artifact
|
|
181
181
|
if: matrix.plat == 'any'
|
|
182
|
-
uses: actions/upload-artifact@
|
|
182
|
+
uses: actions/upload-artifact@v4
|
|
183
183
|
with:
|
|
184
184
|
name: amalgam-lang-${{ needs.metadata.outputs.version }}
|
|
185
185
|
path: dist/amalgam-lang-*.tar.gz
|
|
186
186
|
if-no-files-found: error
|
|
187
187
|
|
|
188
188
|
- name: Upload Wheel Artifact
|
|
189
|
-
uses: actions/upload-artifact@
|
|
189
|
+
uses: actions/upload-artifact@v4
|
|
190
190
|
with:
|
|
191
191
|
name: amalgam_lang-${{ needs.metadata.outputs.version }}-py3-none-${{ matrix.plat }}
|
|
192
192
|
path: dist/amalgam_lang-*.whl
|
|
@@ -300,7 +300,7 @@ jobs:
|
|
|
300
300
|
- uses: actions/checkout@v4
|
|
301
301
|
|
|
302
302
|
- name: Download Artifacts
|
|
303
|
-
uses: actions/download-artifact@
|
|
303
|
+
uses: actions/download-artifact@v4
|
|
304
304
|
with:
|
|
305
305
|
path: ./tmp
|
|
306
306
|
|
|
@@ -324,7 +324,7 @@ jobs:
|
|
|
324
324
|
artifactContentType: application/gzip
|
|
325
325
|
|
|
326
326
|
- name: Set up Python
|
|
327
|
-
uses: actions/setup-python@
|
|
327
|
+
uses: actions/setup-python@v5
|
|
328
328
|
with:
|
|
329
329
|
python-version: "3.11"
|
|
330
330
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from ctypes import (
|
|
2
|
-
byref, c_bool, c_char, c_char_p, c_double, c_size_t, c_uint64, c_void_p,
|
|
3
|
-
cdll, POINTER
|
|
2
|
+
byref, cast, c_bool, c_char, c_char_p, c_double, c_size_t, c_uint64, c_void_p,
|
|
3
|
+
cdll, POINTER, Structure
|
|
4
4
|
)
|
|
5
5
|
from datetime import datetime
|
|
6
6
|
import gc
|
|
@@ -15,12 +15,45 @@ import warnings
|
|
|
15
15
|
_logger = logging.getLogger('amalgam')
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
class _LoadEntityStatus(Structure):
|
|
19
|
+
"""
|
|
20
|
+
A private status returned from Amalgam binary LoadEntity C API.
|
|
21
|
+
|
|
22
|
+
This is implemented with ctypes for accessing binary Amalgam builds.
|
|
23
|
+
"""
|
|
24
|
+
_fields_ = [
|
|
25
|
+
("loaded", c_bool),
|
|
26
|
+
("message", POINTER(c_char)),
|
|
27
|
+
("version", POINTER(c_char))
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class LoadEntityStatus:
|
|
32
|
+
"""
|
|
33
|
+
Status returned by :func:`~api.Amalgam.load_entity`.
|
|
34
|
+
|
|
35
|
+
This is implemented with python types and is meant to wrap _LoadEntityStatus
|
|
36
|
+
which uses ctypes and directly interacts with the Amalgam binaries.
|
|
37
|
+
"""
|
|
38
|
+
def __init__(self, api, c_status: _LoadEntityStatus = None):
|
|
39
|
+
if c_status is None:
|
|
40
|
+
self.loaded = True
|
|
41
|
+
self.message = ""
|
|
42
|
+
self.version = ""
|
|
43
|
+
else:
|
|
44
|
+
self.loaded = bool(c_status.loaded)
|
|
45
|
+
self.message = api.char_p_to_bytes(c_status.message).decode("utf-8")
|
|
46
|
+
self.version = api.char_p_to_bytes(c_status.version).decode("utf-8")
|
|
47
|
+
|
|
48
|
+
def __str__(self):
|
|
49
|
+
return f"{self.loaded},\"{self.message}\",\"{self.version}\""
|
|
50
|
+
|
|
51
|
+
|
|
18
52
|
class Amalgam:
|
|
19
53
|
"""
|
|
20
54
|
A general python direct interface to the Amalgam library.
|
|
21
55
|
|
|
22
|
-
This is implemented with ctypes for accessing binary
|
|
23
|
-
Linux, MacOS and Windows.
|
|
56
|
+
This is implemented with ctypes for accessing binary Amalgam builds.
|
|
24
57
|
|
|
25
58
|
Parameters
|
|
26
59
|
----------
|
|
@@ -111,7 +144,7 @@ class Amalgam:
|
|
|
111
144
|
execution_trace_dir).expanduser().absolute()
|
|
112
145
|
# Create the trace directory if needed
|
|
113
146
|
if not self.execution_trace_dir.exists():
|
|
114
|
-
self.execution_trace_dir.mkdir(parents=True)
|
|
147
|
+
self.execution_trace_dir.mkdir(parents=True, exist_ok=True)
|
|
115
148
|
|
|
116
149
|
# increment a counter on the file name, if file already exists..
|
|
117
150
|
self.execution_trace_filepath = Path(
|
|
@@ -496,7 +529,9 @@ class Amalgam:
|
|
|
496
529
|
size: Optional[int] = None
|
|
497
530
|
) -> c_char:
|
|
498
531
|
"""
|
|
499
|
-
Convert a string to a
|
|
532
|
+
Convert a string to a C char pointer.
|
|
533
|
+
|
|
534
|
+
User must call `del` on returned buffer
|
|
500
535
|
|
|
501
536
|
Parameters
|
|
502
537
|
----------
|
|
@@ -509,7 +544,7 @@ class Amalgam:
|
|
|
509
544
|
Returns
|
|
510
545
|
-------
|
|
511
546
|
c_char
|
|
512
|
-
A
|
|
547
|
+
A C char pointer for the string.
|
|
513
548
|
"""
|
|
514
549
|
if isinstance(value, str):
|
|
515
550
|
value = value.encode('utf-8')
|
|
@@ -518,6 +553,28 @@ class Amalgam:
|
|
|
518
553
|
buf.value = value
|
|
519
554
|
return buf
|
|
520
555
|
|
|
556
|
+
def char_p_to_bytes(self, p: POINTER(c_char)) -> bytes:
|
|
557
|
+
"""
|
|
558
|
+
Copies a native C char pointer to bytes, cleaning up native memory correctly.
|
|
559
|
+
|
|
560
|
+
Parameters
|
|
561
|
+
----------
|
|
562
|
+
p : LP_char_p
|
|
563
|
+
C pointer to string to convert
|
|
564
|
+
|
|
565
|
+
Returns
|
|
566
|
+
-------
|
|
567
|
+
bytes
|
|
568
|
+
The byte-encoded string from C pointer
|
|
569
|
+
"""
|
|
570
|
+
bytes = cast(p, c_char_p).value
|
|
571
|
+
|
|
572
|
+
self.amlg.DeleteString.argtypes = c_char_p,
|
|
573
|
+
self.amlg.DeleteString.restype = None
|
|
574
|
+
self.amlg.DeleteString(p)
|
|
575
|
+
|
|
576
|
+
return bytes
|
|
577
|
+
|
|
521
578
|
def get_json_from_label(self, handle: str, label: str) -> bytes:
|
|
522
579
|
"""
|
|
523
580
|
Get a label from amalgam and returns it in json format.
|
|
@@ -534,15 +591,19 @@ class Amalgam:
|
|
|
534
591
|
bytes
|
|
535
592
|
The byte-encoded json representation of the amalgam label.
|
|
536
593
|
"""
|
|
537
|
-
self.amlg.GetJSONPtrFromLabel.restype =
|
|
594
|
+
self.amlg.GetJSONPtrFromLabel.restype = POINTER(c_char)
|
|
538
595
|
self.amlg.GetJSONPtrFromLabel.argtype = [c_char_p, c_char_p]
|
|
539
596
|
handle_buf = self.str_to_char_p(handle)
|
|
540
597
|
label_buf = self.str_to_char_p(label)
|
|
541
|
-
|
|
542
|
-
self._log_execution(f"GET_JSON_FROM_LABEL {handle} {label}")
|
|
598
|
+
|
|
599
|
+
self._log_execution(f"GET_JSON_FROM_LABEL \"{handle}\" \"{label}\"")
|
|
600
|
+
result = self.char_p_to_bytes(self.amlg.GetJSONPtrFromLabel(handle_buf, label_buf))
|
|
601
|
+
self._log_reply(result)
|
|
602
|
+
|
|
543
603
|
del handle_buf
|
|
544
604
|
del label_buf
|
|
545
605
|
self.gc()
|
|
606
|
+
|
|
546
607
|
return result
|
|
547
608
|
|
|
548
609
|
def set_json_to_label(
|
|
@@ -568,8 +629,11 @@ class Amalgam:
|
|
|
568
629
|
handle_buf = self.str_to_char_p(handle)
|
|
569
630
|
label_buf = self.str_to_char_p(label)
|
|
570
631
|
json_buf = self.str_to_char_p(json)
|
|
571
|
-
|
|
632
|
+
|
|
633
|
+
self._log_execution(f"SET_JSON_TO_LABEL \"{handle}\" \"{label}\" {json}")
|
|
572
634
|
self.amlg.SetJSONToLabel(handle_buf, label_buf, json_buf)
|
|
635
|
+
self._log_reply(None)
|
|
636
|
+
|
|
573
637
|
del handle_buf
|
|
574
638
|
del label_buf
|
|
575
639
|
del json_buf
|
|
@@ -583,7 +647,7 @@ class Amalgam:
|
|
|
583
647
|
load_contained: bool = False,
|
|
584
648
|
write_log: str = "",
|
|
585
649
|
print_log: str = ""
|
|
586
|
-
) ->
|
|
650
|
+
) -> LoadEntityStatus:
|
|
587
651
|
"""
|
|
588
652
|
Load an entity from an amalgam source file.
|
|
589
653
|
|
|
@@ -607,33 +671,126 @@ class Amalgam:
|
|
|
607
671
|
|
|
608
672
|
Returns
|
|
609
673
|
-------
|
|
610
|
-
|
|
611
|
-
|
|
674
|
+
LoadEntityStatus
|
|
675
|
+
Status of LoadEntity call.
|
|
612
676
|
"""
|
|
613
677
|
self.amlg.LoadEntity.argtype = [
|
|
614
678
|
c_char_p, c_char_p, c_bool, c_bool, c_char_p, c_char_p]
|
|
615
|
-
self.amlg.LoadEntity.restype =
|
|
679
|
+
self.amlg.LoadEntity.restype = _LoadEntityStatus
|
|
616
680
|
handle_buf = self.str_to_char_p(handle)
|
|
617
681
|
amlg_path_buf = self.str_to_char_p(amlg_path)
|
|
618
682
|
write_log_buf = self.str_to_char_p(write_log)
|
|
619
683
|
print_log_buf = self.str_to_char_p(print_log)
|
|
620
684
|
|
|
621
|
-
|
|
622
|
-
f"LOAD_ENTITY {handle} \"{amlg_path}\" {str(persist).lower()} "
|
|
623
|
-
f"{str(load_contained).lower()} {write_log} {print_log}"
|
|
685
|
+
load_command_log_entry = (
|
|
686
|
+
f"LOAD_ENTITY \"{handle}\" \"{amlg_path}\" {str(persist).lower()} "
|
|
687
|
+
f"{str(load_contained).lower()} \"{write_log}\" \"{print_log}\""
|
|
624
688
|
)
|
|
625
|
-
self._log_execution(
|
|
626
|
-
result = self.amlg.LoadEntity(
|
|
689
|
+
self._log_execution(load_command_log_entry)
|
|
690
|
+
result = LoadEntityStatus(self, self.amlg.LoadEntity(
|
|
627
691
|
handle_buf, amlg_path_buf, persist, load_contained,
|
|
628
|
-
write_log_buf, print_log_buf)
|
|
692
|
+
write_log_buf, print_log_buf))
|
|
629
693
|
self._log_reply(result)
|
|
694
|
+
|
|
630
695
|
del handle_buf
|
|
631
696
|
del amlg_path_buf
|
|
632
697
|
del write_log_buf
|
|
633
698
|
del print_log_buf
|
|
634
699
|
self.gc()
|
|
700
|
+
|
|
635
701
|
return result
|
|
636
702
|
|
|
703
|
+
def verify_entity(
|
|
704
|
+
self,
|
|
705
|
+
amlg_path: str
|
|
706
|
+
) -> LoadEntityStatus:
|
|
707
|
+
"""
|
|
708
|
+
Verify an entity from an amalgam source file.
|
|
709
|
+
|
|
710
|
+
Parameters
|
|
711
|
+
----------
|
|
712
|
+
amlg_path : str
|
|
713
|
+
The path to the filename.amlg/caml file.
|
|
714
|
+
|
|
715
|
+
Returns
|
|
716
|
+
-------
|
|
717
|
+
LoadEntityStatus
|
|
718
|
+
Status of VerifyEntity call.
|
|
719
|
+
"""
|
|
720
|
+
self.amlg.VerifyEntity.argtype = [c_char_p]
|
|
721
|
+
self.amlg.VerifyEntity.restype = _LoadEntityStatus
|
|
722
|
+
amlg_path_buf = self.str_to_char_p(amlg_path)
|
|
723
|
+
|
|
724
|
+
self._log_execution(f"VERIFY_ENTITY \"{amlg_path}\"")
|
|
725
|
+
result = LoadEntityStatus(self, self.amlg.VerifyEntity(amlg_path_buf))
|
|
726
|
+
self._log_reply(result)
|
|
727
|
+
|
|
728
|
+
del amlg_path_buf
|
|
729
|
+
self.gc()
|
|
730
|
+
|
|
731
|
+
return result
|
|
732
|
+
|
|
733
|
+
def store_entity(
|
|
734
|
+
self,
|
|
735
|
+
handle: str,
|
|
736
|
+
amlg_path: str,
|
|
737
|
+
update_persistence_location: bool = False,
|
|
738
|
+
store_contained: bool = False
|
|
739
|
+
) -> None:
|
|
740
|
+
"""
|
|
741
|
+
Stores an entity to the file type specified within amlg_path.
|
|
742
|
+
|
|
743
|
+
Parameters
|
|
744
|
+
----------
|
|
745
|
+
handle : str
|
|
746
|
+
The handle of the amalgam entity.
|
|
747
|
+
amlg_path : str
|
|
748
|
+
The path to the filename.amlg/caml file.
|
|
749
|
+
update_persistence_location : bool
|
|
750
|
+
If set to true, updates location entity is persisted to.
|
|
751
|
+
store_contained : bool
|
|
752
|
+
If set to true, contained entities will be stored.
|
|
753
|
+
"""
|
|
754
|
+
self.amlg.StoreEntity.argtype = [
|
|
755
|
+
c_char_p, c_char_p, c_bool, c_bool]
|
|
756
|
+
handle_buf = self.str_to_char_p(handle)
|
|
757
|
+
amlg_path_buf = self.str_to_char_p(amlg_path)
|
|
758
|
+
|
|
759
|
+
store_command_log_entry = (
|
|
760
|
+
f"STORE_ENTITY \"{handle}\" \"{amlg_path}\" {str(update_persistence_location).lower()} "
|
|
761
|
+
f"{str(store_contained).lower()}"
|
|
762
|
+
)
|
|
763
|
+
self._log_execution(store_command_log_entry)
|
|
764
|
+
self.amlg.StoreEntity(
|
|
765
|
+
handle_buf, amlg_path_buf, update_persistence_location, store_contained)
|
|
766
|
+
self._log_reply(None)
|
|
767
|
+
|
|
768
|
+
del handle_buf
|
|
769
|
+
del amlg_path_buf
|
|
770
|
+
self.gc()
|
|
771
|
+
|
|
772
|
+
def destroy_entity(
|
|
773
|
+
self,
|
|
774
|
+
handle: str
|
|
775
|
+
) -> None:
|
|
776
|
+
"""
|
|
777
|
+
Destroys an entity.
|
|
778
|
+
|
|
779
|
+
Parameters
|
|
780
|
+
----------
|
|
781
|
+
handle : str
|
|
782
|
+
The handle of the amalgam entity.
|
|
783
|
+
"""
|
|
784
|
+
self.amlg.DestroyEntity.argtype = [c_char_p]
|
|
785
|
+
handle_buf = self.str_to_char_p(handle)
|
|
786
|
+
|
|
787
|
+
self._log_execution(f"DESTROY_ENTITY \"{handle}\"")
|
|
788
|
+
self.amlg.DestroyEntity(handle_buf)
|
|
789
|
+
self._log_reply(None)
|
|
790
|
+
|
|
791
|
+
del handle_buf
|
|
792
|
+
self.gc()
|
|
793
|
+
|
|
637
794
|
def get_entities(self) -> List[str]:
|
|
638
795
|
"""
|
|
639
796
|
Get loaded top level entities.
|
|
@@ -648,9 +805,11 @@ class Amalgam:
|
|
|
648
805
|
num_entities = c_uint64()
|
|
649
806
|
entities = self.amlg.GetEntities(byref(num_entities))
|
|
650
807
|
result = [entities[i].decode() for i in range(num_entities.value)]
|
|
808
|
+
|
|
651
809
|
del entities
|
|
652
810
|
del num_entities
|
|
653
811
|
self.gc()
|
|
812
|
+
|
|
654
813
|
return result
|
|
655
814
|
|
|
656
815
|
def execute_entity_json(
|
|
@@ -676,21 +835,24 @@ class Amalgam:
|
|
|
676
835
|
bytes
|
|
677
836
|
A byte-encoded json representation of the response.
|
|
678
837
|
"""
|
|
679
|
-
self.amlg.ExecuteEntityJsonPtr.restype =
|
|
838
|
+
self.amlg.ExecuteEntityJsonPtr.restype = POINTER(c_char)
|
|
680
839
|
self.amlg.ExecuteEntityJsonPtr.argtype = [
|
|
681
840
|
c_char_p, c_char_p, c_char_p]
|
|
682
841
|
handle_buf = self.str_to_char_p(handle)
|
|
683
842
|
label_buf = self.str_to_char_p(label)
|
|
684
843
|
json_buf = self.str_to_char_p(json)
|
|
844
|
+
|
|
685
845
|
self._log_time("EXECUTION START")
|
|
686
|
-
self._log_execution(f"EXECUTE_ENTITY_JSON {handle} {label} {json}")
|
|
687
|
-
result = self.amlg.ExecuteEntityJsonPtr(
|
|
688
|
-
handle_buf, label_buf, json_buf)
|
|
846
|
+
self._log_execution(f"EXECUTE_ENTITY_JSON \"{handle}\" \"{label}\" {json}")
|
|
847
|
+
result = self.char_p_to_bytes(self.amlg.ExecuteEntityJsonPtr(
|
|
848
|
+
handle_buf, label_buf, json_buf))
|
|
689
849
|
self._log_time("EXECUTION STOP")
|
|
690
850
|
self._log_reply(result)
|
|
851
|
+
|
|
691
852
|
del handle_buf
|
|
692
853
|
del label_buf
|
|
693
854
|
del json_buf
|
|
855
|
+
|
|
694
856
|
return result
|
|
695
857
|
|
|
696
858
|
def set_number_value(self, handle: str, label: str, value: float) -> None:
|
|
@@ -711,7 +873,9 @@ class Amalgam:
|
|
|
711
873
|
handle_buf = self.str_to_char_p(handle)
|
|
712
874
|
label_buf = self.str_to_char_p(label)
|
|
713
875
|
val = c_double(value)
|
|
876
|
+
|
|
714
877
|
self.amlg.SetNumberValue(handle_buf, label_buf, val)
|
|
878
|
+
|
|
715
879
|
del handle_buf
|
|
716
880
|
del label_buf
|
|
717
881
|
del val
|
|
@@ -737,9 +901,12 @@ class Amalgam:
|
|
|
737
901
|
self.amlg.GetNumberValue.argtype = [c_char_p, c_char_p]
|
|
738
902
|
handle_buf = self.str_to_char_p(handle)
|
|
739
903
|
label_buf = self.str_to_char_p(label)
|
|
904
|
+
|
|
740
905
|
result = self.amlg.GetNumberValue(handle_buf, label_buf)
|
|
906
|
+
|
|
741
907
|
del handle_buf
|
|
742
908
|
del label_buf
|
|
909
|
+
|
|
743
910
|
return result
|
|
744
911
|
|
|
745
912
|
def set_string_value(
|
|
@@ -765,7 +932,9 @@ class Amalgam:
|
|
|
765
932
|
handle_buf = self.str_to_char_p(handle)
|
|
766
933
|
label_buf = self.str_to_char_p(label)
|
|
767
934
|
val_buf = self.str_to_char_p(value)
|
|
935
|
+
|
|
768
936
|
self.amlg.SetStringValue(handle_buf, label_buf, val_buf)
|
|
937
|
+
|
|
769
938
|
del handle_buf
|
|
770
939
|
del label_buf
|
|
771
940
|
del val_buf
|
|
@@ -791,15 +960,18 @@ class Amalgam:
|
|
|
791
960
|
self.amlg.GetStringListPtr.argtype = [c_char_p, c_char_p]
|
|
792
961
|
handle_buf = self.str_to_char_p(handle)
|
|
793
962
|
label_buf = self.str_to_char_p(label)
|
|
963
|
+
|
|
794
964
|
size = self.amlg.GetStringListLength(handle_buf, label_buf)
|
|
795
965
|
value_buf = self.amlg.GetStringListPtr(handle_buf, label_buf)
|
|
796
966
|
result = None
|
|
797
967
|
if value_buf is not None and size > 0:
|
|
798
968
|
result = value_buf[0]
|
|
969
|
+
|
|
799
970
|
del handle_buf
|
|
800
971
|
del label_buf
|
|
801
972
|
del value_buf
|
|
802
973
|
self.gc()
|
|
974
|
+
|
|
803
975
|
return result
|
|
804
976
|
|
|
805
977
|
def set_string_list(
|
|
@@ -835,6 +1007,7 @@ class Amalgam:
|
|
|
835
1007
|
handle_buf = self.str_to_char_p(handle)
|
|
836
1008
|
label_buf = self.str_to_char_p(label)
|
|
837
1009
|
self.amlg.SetStringList(handle_buf, label_buf, value_buf, size)
|
|
1010
|
+
|
|
838
1011
|
del handle_buf
|
|
839
1012
|
del label_buf
|
|
840
1013
|
del value_buf
|
|
@@ -863,13 +1036,16 @@ class Amalgam:
|
|
|
863
1036
|
self.amlg.GetStringListPtr.argtype = [c_char_p, c_char_p]
|
|
864
1037
|
handle_buf = self.str_to_char_p(handle)
|
|
865
1038
|
label_buf = self.str_to_char_p(label)
|
|
1039
|
+
|
|
866
1040
|
size = self.amlg.GetStringListLength(handle_buf, label_buf)
|
|
867
1041
|
value_buf = self.amlg.GetStringListPtr(handle_buf, label_buf)
|
|
868
1042
|
value = [value_buf[i] for i in range(size)]
|
|
1043
|
+
|
|
869
1044
|
del handle_buf
|
|
870
1045
|
del label_buf
|
|
871
1046
|
del value_buf
|
|
872
1047
|
self.gc()
|
|
1048
|
+
|
|
873
1049
|
return value
|
|
874
1050
|
|
|
875
1051
|
def get_version_string(self) -> bytes:
|
|
@@ -881,8 +1057,8 @@ class Amalgam:
|
|
|
881
1057
|
bytes
|
|
882
1058
|
A version byte-encoded string with semver.
|
|
883
1059
|
"""
|
|
884
|
-
self.amlg.GetVersionString.restype =
|
|
885
|
-
amlg_version = self.amlg.GetVersionString()
|
|
1060
|
+
self.amlg.GetVersionString.restype = POINTER(c_char)
|
|
1061
|
+
amlg_version = self.char_p_to_bytes(self.amlg.GetVersionString())
|
|
886
1062
|
self._log_comment(f"call to amlg.GetVersionString() - returned: "
|
|
887
1063
|
f"{amlg_version}\n")
|
|
888
1064
|
return amlg_version
|
|
@@ -897,8 +1073,8 @@ class Amalgam:
|
|
|
897
1073
|
A byte-encoded string with library concurrency type.
|
|
898
1074
|
Ex. b'MultiThreaded'
|
|
899
1075
|
"""
|
|
900
|
-
self.amlg.GetConcurrencyTypeString.restype =
|
|
901
|
-
amlg_concurrency_type = self.amlg.GetConcurrencyTypeString()
|
|
1076
|
+
self.amlg.GetConcurrencyTypeString.restype = POINTER(c_char)
|
|
1077
|
+
amlg_concurrency_type = self.char_p_to_bytes(self.amlg.GetConcurrencyTypeString())
|
|
902
1078
|
self._log_comment(
|
|
903
1079
|
f"call to amlg.GetConcurrencyTypeString() - returned: "
|
|
904
1080
|
f"{amlg_concurrency_type}\n")
|
|
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": "
|
|
4
|
-
"amalgam_sha": "
|
|
5
|
-
"amalgam_url": "https://github.com/howsoai/amalgam/releases/tag/
|
|
3
|
+
"amalgam": "48.0.0",
|
|
4
|
+
"amalgam_sha": "8e95a5c4869e99d23f9f9861a601cd4dcaa06890",
|
|
5
|
+
"amalgam_url": "https://github.com/howsoai/amalgam/releases/tag/48.0.0",
|
|
6
6
|
"amalgam_build_date": "",
|
|
7
7
|
"amalgam_display_title": ""
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,8 +4,8 @@ set -eux
|
|
|
4
4
|
# Install dependencies
|
|
5
5
|
install_deps() {
|
|
6
6
|
python --version
|
|
7
|
-
pip install -r requirements-${1}-dev.txt --user --no-deps
|
|
8
|
-
pip install --no-deps -e .
|
|
7
|
+
python -m pip install -r requirements-${1}-dev.txt --user --no-deps
|
|
8
|
+
python -m pip install --no-deps -e .
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
# Takes the cli params, and runs them, defaulting to 'help()'
|
|
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
|