MapleX 2.2.0a2__tar.gz → 2.2.0.dev1__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.
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/LICENSE +1 -1
- {maplex-2.2.0a2/src/MapleX.egg-info → maplex-2.2.0.dev1}/PKG-INFO +27 -325
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/README.md +3 -322
- maplex-2.2.0.dev1/pyproject.toml +34 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1/src/MapleX.egg-info}/PKG-INFO +27 -325
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/maplex/__init__.py +1 -7
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/maplex/mapleLogger.py +7 -20
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/maplex/mapleTreeEditor.py +12 -241
- maplex-2.2.0a2/pyproject.toml +0 -46
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/MANIFEST.in +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/setup.cfg +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/MapleX.egg-info/SOURCES.txt +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/MapleX.egg-info/dependency_links.txt +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/MapleX.egg-info/requires.txt +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/MapleX.egg-info/top_level.txt +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/maplex/mapleColors.py +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/maplex/mapleExceptions.py +0 -0
- {maplex-2.2.0a2 → maplex-2.2.0.dev1}/src/maplex/utils.py +0 -0
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MapleX
|
|
3
|
-
Version: 2.2.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 2.2.0.dev1
|
|
4
|
+
Summary: MapleX: A Python library for Maple file format operations, with logging and console color utilities
|
|
5
5
|
Author: Ryuji Hazama
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Ryuji Hazama
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
6
27
|
Project-URL: PyPI, https://pypi.org/project/MapleX/
|
|
7
|
-
Project-URL:
|
|
28
|
+
Project-URL: GitHub, https://github.com/Ryuji-Hazama
|
|
8
29
|
Project-URL: Repository, https://github.com/Ryuji-Hazama/MapleTree
|
|
9
30
|
Project-URL: Issues, https://github.com/Ryuji-Hazama/MapleTree/issues
|
|
10
31
|
Project-URL: YouTube, https://www.youtube.com/@ryujihazama
|
|
@@ -73,12 +94,11 @@ H Data Headers
|
|
|
73
94
|
# which is already used in the parent's header
|
|
74
95
|
E
|
|
75
96
|
E
|
|
76
|
-
H *NOTES
|
|
97
|
+
H *NOTES
|
|
77
98
|
# Note's header
|
|
78
99
|
NTE {strimg}
|
|
79
100
|
NTE ...
|
|
80
101
|
# Note's main strings for the multi-line data
|
|
81
|
-
# COMMENTS IN THE "*NOTES" BLOCK WILL BE DELETED WHEN SAVE VALUE!
|
|
82
102
|
E
|
|
83
103
|
H #*
|
|
84
104
|
This is a comment block.
|
|
@@ -148,30 +168,9 @@ E
|
|
|
148
168
|
EOF
|
|
149
169
|
```
|
|
150
170
|
|
|
151
|
-
### Notes (Multi-lined Data)
|
|
152
|
-
|
|
153
|
-
`v2.2.0` or newer
|
|
154
|
-
|
|
155
|
-
- You can save multi-lined data inside `H *NOTES` block.
|
|
156
|
-
- You must specify the header when you save notes value.
|
|
157
|
-
|
|
158
|
-
E.g.:
|
|
159
|
-
|
|
160
|
-
```text
|
|
161
|
-
MAPLE
|
|
162
|
-
|
|
163
|
-
H *NOTES NOTES_HEADER
|
|
164
|
-
NTE YOU CAN SAVE
|
|
165
|
-
NTE MULTI-LINED DATA
|
|
166
|
-
NTE INSIDE THIS BLOCK
|
|
167
|
-
E
|
|
168
|
-
|
|
169
|
-
EOF
|
|
170
|
-
```
|
|
171
|
-
|
|
172
171
|
### Comments
|
|
173
172
|
|
|
174
|
-
`v2.1.0
|
|
173
|
+
`v2.1.0 or newer`
|
|
175
174
|
|
|
176
175
|
#### Comment Line
|
|
177
176
|
|
|
@@ -478,30 +477,6 @@ E
|
|
|
478
477
|
EOF
|
|
479
478
|
```
|
|
480
479
|
|
|
481
|
-
### `saveValue()`
|
|
482
|
-
|
|
483
|
-
`v2.2.0` or newer
|
|
484
|
-
|
|
485
|
-
```python
|
|
486
|
-
def saveValue(
|
|
487
|
-
tag: str,
|
|
488
|
-
valueString: any,
|
|
489
|
-
*headers: str,
|
|
490
|
-
**kwargs
|
|
491
|
-
) -> bool
|
|
492
|
-
```
|
|
493
|
-
|
|
494
|
-
|Property|Required|Value|
|
|
495
|
-
|--------|--------|-----|
|
|
496
|
-
|**`tag`**|\*|Tag to delete|
|
|
497
|
-
|**`value`**|\*|Value to save|
|
|
498
|
-
|**`headers`**||Target headers|
|
|
499
|
-
|**`kwargs`**||Keyword arguments|
|
|
500
|
-
|
|
501
|
-
- Same as `saveTagLine()`
|
|
502
|
-
- Set `save=True` to save changes to the file.
|
|
503
|
-
- Default: `save=False`
|
|
504
|
-
|
|
505
480
|
### `deleteTag()`
|
|
506
481
|
|
|
507
482
|
```python
|
|
@@ -554,28 +529,6 @@ E
|
|
|
554
529
|
EOF
|
|
555
530
|
```
|
|
556
531
|
|
|
557
|
-
### `deleteValue()`
|
|
558
|
-
|
|
559
|
-
`v2.2.0` or newer
|
|
560
|
-
|
|
561
|
-
```python
|
|
562
|
-
def deleteValue(
|
|
563
|
-
delTag: str,
|
|
564
|
-
*headers: str,
|
|
565
|
-
**kwargs
|
|
566
|
-
) -> bool
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
|Property|Required|Value|
|
|
570
|
-
|--------|--------|-----|
|
|
571
|
-
|**`delTag`**|\*|Tag to delete|
|
|
572
|
-
|**`headers`**||Target headers|
|
|
573
|
-
|**`kwargs`**||Keyword arguments|
|
|
574
|
-
|
|
575
|
-
- Same as `deleteTag()`
|
|
576
|
-
- Set `save=True` to save changes to the file.
|
|
577
|
-
- Default: `save=False`
|
|
578
|
-
|
|
579
532
|
### `getTagValueDict()`
|
|
580
533
|
|
|
581
534
|
```python
|
|
@@ -668,7 +621,7 @@ def deleteHeader(
|
|
|
668
621
|
|--------|--------|-----|
|
|
669
622
|
|**`delHead`**|\*|Deleting header|
|
|
670
623
|
|**`willSave`**||Save to file flag|
|
|
671
|
-
|**`
|
|
624
|
+
|**`headers`**||Target headers|
|
|
672
625
|
|
|
673
626
|
This deletes an entire header block and its associated data, including child blocks.
|
|
674
627
|
|
|
@@ -711,28 +664,6 @@ E
|
|
|
711
664
|
EOF
|
|
712
665
|
```
|
|
713
666
|
|
|
714
|
-
### `removeHeader()`
|
|
715
|
-
|
|
716
|
-
`v2.2.0` or newer
|
|
717
|
-
|
|
718
|
-
```python
|
|
719
|
-
def removeHeader(
|
|
720
|
-
delHead: str,
|
|
721
|
-
*headers: str,
|
|
722
|
-
**kwargs
|
|
723
|
-
) -> bool
|
|
724
|
-
```
|
|
725
|
-
|
|
726
|
-
|Property|Required|Value|
|
|
727
|
-
|--------|--------|-----|
|
|
728
|
-
|**`delHead`**|\*|Deleting header|
|
|
729
|
-
|**`headers`**||Target headers|
|
|
730
|
-
|**`kwargs`**||Keyword arguments|
|
|
731
|
-
|
|
732
|
-
- Same as `deleteHeader()`
|
|
733
|
-
- Set `save=True` for save data to the file.
|
|
734
|
-
- Default: `save=False`
|
|
735
|
-
|
|
736
667
|
### `getHeaders()`
|
|
737
668
|
|
|
738
669
|
```python
|
|
@@ -777,235 +708,6 @@ print(headerList)
|
|
|
777
708
|
# Outputs "['FOO', 'QUUX']"
|
|
778
709
|
```
|
|
779
710
|
|
|
780
|
-
### `saveNotes()`
|
|
781
|
-
|
|
782
|
-
`v2.2.0` or newer
|
|
783
|
-
|
|
784
|
-
```python
|
|
785
|
-
def saveNotes(
|
|
786
|
-
noteValues: list[str],
|
|
787
|
-
*headers: str,
|
|
788
|
-
**kwargs
|
|
789
|
-
) -> None
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
|Property|Required|Value|
|
|
793
|
-
|--------|--------|-----|
|
|
794
|
-
|**`noteValues`**|\*|Data to save|
|
|
795
|
-
|**`headers`**|\*|Target headers|
|
|
796
|
-
|**`kwargs`**||Keyword arguments|
|
|
797
|
-
|
|
798
|
-
The function saves string list as a special notes block value. Set `save=True` to save the changes (Default: `save=False`)
|
|
799
|
-
|
|
800
|
-
E.g.:
|
|
801
|
-
|
|
802
|
-
```python
|
|
803
|
-
from maplex import MapleTree
|
|
804
|
-
|
|
805
|
-
mapleTree = MapleTree("SampleData.mpl", createBasaFile=True)
|
|
806
|
-
stringList = ["Hello", "there!"]
|
|
807
|
-
mapleTree.saveNotes(stringList, "FOO", "BAR", save=True)
|
|
808
|
-
```
|
|
809
|
-
|
|
810
|
-
This code creates a new file contains the following contents:
|
|
811
|
-
|
|
812
|
-
```text
|
|
813
|
-
MAPLE
|
|
814
|
-
|
|
815
|
-
H FOO
|
|
816
|
-
H *NOTES BAR
|
|
817
|
-
NTE Hello
|
|
818
|
-
NTE there!
|
|
819
|
-
E
|
|
820
|
-
E
|
|
821
|
-
|
|
822
|
-
EOF
|
|
823
|
-
```
|
|
824
|
-
|
|
825
|
-
### `saveNote()`
|
|
826
|
-
|
|
827
|
-
`v2.2.0` or newer
|
|
828
|
-
|
|
829
|
-
```python
|
|
830
|
-
def saveNote(
|
|
831
|
-
noteValues: str,
|
|
832
|
-
*headers: str,
|
|
833
|
-
**kwargs
|
|
834
|
-
) -> None
|
|
835
|
-
```
|
|
836
|
-
|
|
837
|
-
|Property|Required|Value|
|
|
838
|
-
|--------|--------|-----|
|
|
839
|
-
|**`noteValues`**|\*|Data to save|
|
|
840
|
-
|**`headers`**|\*|Target headers|
|
|
841
|
-
|**`kwargs`**||Keyword arguments|
|
|
842
|
-
|
|
843
|
-
The function saves multi-lined string as a special notes block value. Set `save=True` to save the changes (Default: `save=False`)
|
|
844
|
-
|
|
845
|
-
E.g.:
|
|
846
|
-
|
|
847
|
-
```python
|
|
848
|
-
from maplex import MapleTree
|
|
849
|
-
|
|
850
|
-
mapleTree = MapleTree("SampleData.mpl", createBasaFile=True)
|
|
851
|
-
dataString = "This is a\nmulti-lined data."
|
|
852
|
-
mapleTree.saveNotes(dataString, "FOO", "BAR", save=True)
|
|
853
|
-
```
|
|
854
|
-
|
|
855
|
-
This code creates a new file contains the following contents:
|
|
856
|
-
|
|
857
|
-
```text
|
|
858
|
-
MAPLE
|
|
859
|
-
|
|
860
|
-
H FOO
|
|
861
|
-
H *NOTES BAR
|
|
862
|
-
NTE This is a
|
|
863
|
-
NTE multi-lined data.
|
|
864
|
-
E
|
|
865
|
-
E
|
|
866
|
-
|
|
867
|
-
EOF
|
|
868
|
-
```
|
|
869
|
-
|
|
870
|
-
### `readNotes()`
|
|
871
|
-
|
|
872
|
-
`v2.2.0` or newer
|
|
873
|
-
|
|
874
|
-
```python
|
|
875
|
-
def readNotes(
|
|
876
|
-
*headers: str
|
|
877
|
-
) -> list[str]
|
|
878
|
-
```
|
|
879
|
-
|
|
880
|
-
|Property|Required|Value|
|
|
881
|
-
|--------|--------|-----|
|
|
882
|
-
|**`headers`**|\*|Target headers|
|
|
883
|
-
|
|
884
|
-
Read note block value which specified by the `headers` and return as a string list.
|
|
885
|
-
|
|
886
|
-
Sample data: `SampleData.mpl`
|
|
887
|
-
|
|
888
|
-
```text
|
|
889
|
-
MAPLE
|
|
890
|
-
|
|
891
|
-
H FOO
|
|
892
|
-
H *NOTES BAR
|
|
893
|
-
NTE This is a
|
|
894
|
-
NTE multi-lined data.
|
|
895
|
-
E
|
|
896
|
-
E
|
|
897
|
-
|
|
898
|
-
EOF
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
E.g.:
|
|
902
|
-
|
|
903
|
-
```python
|
|
904
|
-
from maplex import MapleTree
|
|
905
|
-
|
|
906
|
-
mapleFile = MapleTree("SampleData.mpl")
|
|
907
|
-
stringList = mapleFile.readNotes("FOO", "BAR")
|
|
908
|
-
|
|
909
|
-
print(stringList)
|
|
910
|
-
# Outputs "['This is a', 'multi-lined data.']"
|
|
911
|
-
```
|
|
912
|
-
|
|
913
|
-
### `readNote()`
|
|
914
|
-
|
|
915
|
-
`v2.2.0` or newer
|
|
916
|
-
|
|
917
|
-
```python
|
|
918
|
-
def readNote(
|
|
919
|
-
*headers: str
|
|
920
|
-
) -> str
|
|
921
|
-
```
|
|
922
|
-
|
|
923
|
-
|Property|Required|Value|
|
|
924
|
-
|--------|--------|-----|
|
|
925
|
-
|**`headers`**|\*|Target headers|
|
|
926
|
-
|
|
927
|
-
Read note block value which specified by the `headers` and return as a string.
|
|
928
|
-
|
|
929
|
-
Sample data: `SampleData.mpl`
|
|
930
|
-
|
|
931
|
-
```text
|
|
932
|
-
MAPLE
|
|
933
|
-
|
|
934
|
-
H FOO
|
|
935
|
-
H *NOTES BAR
|
|
936
|
-
NTE This is a
|
|
937
|
-
NTE multi-lined data.
|
|
938
|
-
E
|
|
939
|
-
E
|
|
940
|
-
|
|
941
|
-
EOF
|
|
942
|
-
```
|
|
943
|
-
|
|
944
|
-
E.g.:
|
|
945
|
-
|
|
946
|
-
```python
|
|
947
|
-
from maplex import MapleTree
|
|
948
|
-
|
|
949
|
-
mapleFile = MapleTree("SampleData.mpl")
|
|
950
|
-
dataString = mapleFile.readNote("FOO", "BAR")
|
|
951
|
-
|
|
952
|
-
print(dataString)
|
|
953
|
-
# Outputs "This is a
|
|
954
|
-
# multi-lined data"
|
|
955
|
-
```
|
|
956
|
-
|
|
957
|
-
### `deleteNotes()`
|
|
958
|
-
|
|
959
|
-
`v2.2.0` or newer
|
|
960
|
-
|
|
961
|
-
```python
|
|
962
|
-
def deleteNotes(
|
|
963
|
-
*headers: str
|
|
964
|
-
) -> bool
|
|
965
|
-
```
|
|
966
|
-
|
|
967
|
-
|Property|Required|Value|
|
|
968
|
-
|--------|--------|-----|
|
|
969
|
-
|**`headers`**|\*|Target headers|
|
|
970
|
-
|**`kwargs`**||Keyword args|
|
|
971
|
-
|
|
972
|
-
Delete note block which specified by the `headers` and return `True` if it success. Set `save=True` to save the changes (Default: `save=False`)
|
|
973
|
-
|
|
974
|
-
Sample data: `SampleData.mpl`
|
|
975
|
-
|
|
976
|
-
```text
|
|
977
|
-
MAPLE
|
|
978
|
-
|
|
979
|
-
H FOO
|
|
980
|
-
H *NOTES BAR
|
|
981
|
-
NTE This is a
|
|
982
|
-
NTE multi-lined data.
|
|
983
|
-
E
|
|
984
|
-
E
|
|
985
|
-
|
|
986
|
-
EOF
|
|
987
|
-
```
|
|
988
|
-
|
|
989
|
-
E.g.:
|
|
990
|
-
|
|
991
|
-
```python
|
|
992
|
-
from maplex import MapleTree
|
|
993
|
-
|
|
994
|
-
mapleFile = MapleTree("SampleData.mpl")
|
|
995
|
-
stringList = mapleFile.deleteNotes("FOO", "BAR", save=True)
|
|
996
|
-
```
|
|
997
|
-
|
|
998
|
-
This code changes the file data like:
|
|
999
|
-
|
|
1000
|
-
```text
|
|
1001
|
-
MAPLE
|
|
1002
|
-
|
|
1003
|
-
H FOO
|
|
1004
|
-
E
|
|
1005
|
-
|
|
1006
|
-
EOF
|
|
1007
|
-
```
|
|
1008
|
-
|
|
1009
711
|
## Logger Class
|
|
1010
712
|
|
|
1011
713
|
Logger is a logging object for Python applications. It outputs application logs to log files and to standard output.
|