@darabonba/python-generator 1.2.19 → 2.0.0
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.
- package/ChangeLog.md +0 -158
- package/lib/builtin.js +818 -0
- package/lib/generator.js +2704 -0
- package/lib/helper.js +422 -0
- package/package.json +6 -5
- package/tests/expected/alias/setup.py +79 -0
- package/tests/expected/alias/tea_python_tests/__init__.py +1 -0
- package/tests/expected/alias/tea_python_tests/client.py +35 -0
- package/tests/expected/annotation/tea_python_tests/__init__.py +1 -0
- package/tests/expected/annotation/tea_python_tests/client.py +93 -0
- package/tests/expected/annotation/tea_python_tests/models.py +37 -0
- package/tests/expected/api/tea_python_tests/__init__.py +1 -0
- package/tests/expected/api/tea_python_tests/client.py +106 -0
- package/tests/expected/builtin/tea_python_tests/client.py +685 -0
- package/tests/expected/comment/tea_python_tests/__init__.py +1 -0
- package/tests/expected/comment/tea_python_tests/client.py +288 -0
- package/tests/expected/comment/tea_python_tests/models.py +195 -0
- package/tests/expected/complex/tea_python_tests/__init__.py +1 -0
- package/tests/expected/complex/tea_python_tests/client.py +1168 -0
- package/tests/expected/complex/tea_python_tests/exceptions.py +39 -0
- package/tests/expected/complex/tea_python_tests/models.py +570 -0
- package/tests/expected/const/tea_python_tests/__init__.py +1 -0
- package/tests/expected/const/tea_python_tests/client.py +14 -0
- package/tests/expected/empty/setup.py +74 -0
- package/tests/expected/empty/tea_python_tests/__init__.py +1 -0
- package/tests/expected/empty/tea_python_tests/client.py +10 -0
- package/tests/expected/exec/tea_python_tests/__init__.py +1 -0
- package/tests/expected/exec/tea_python_tests/exec_client.py +21 -0
- package/tests/expected/function/tea_python_tests/__init__.py +1 -0
- package/tests/expected/function/tea_python_tests/client.py +64 -0
- package/tests/expected/import/setup.py +78 -0
- package/tests/expected/import/tea_python_tests/__init__.py +1 -0
- package/tests/expected/import/tea_python_tests/client.py +29 -0
- package/tests/expected/map/tea_python_tests/__init__.py +1 -0
- package/tests/expected/map/tea_python_tests/client.py +39 -0
- package/tests/expected/model/tea_python_tests/__init__.py +1 -0
- package/tests/expected/model/tea_python_tests/client.py +10 -0
- package/tests/expected/model/tea_python_tests/exceptions.py +28 -0
- package/tests/expected/model/tea_python_tests/models.py +780 -0
- package/tests/expected/multi/tea_python_tests/api.py +95 -0
- package/tests/expected/multi/tea_python_tests/client.py +40 -0
- package/tests/expected/multi/tea_python_tests/lib/util.py +19 -0
- package/tests/expected/multi/tea_python_tests/model/user.py +23 -0
- package/tests/expected/multi/tea_python_tests/model/user_exceptions.py +83 -0
- package/tests/expected/multi/tea_python_tests/model/user_models.py +145 -0
- package/tests/expected/statements/tea_python_tests/__init__.py +1 -0
- package/tests/expected/statements/tea_python_tests/client.py +86 -0
- package/tests/expected/super/tea_python_tests/__init__.py +1 -0
- package/tests/expected/super/tea_python_tests/client.py +16 -0
- package/tests/expected/typedef/setup.py +77 -0
- package/tests/expected/typedef/tea_python_tests/__init__.py +1 -0
- package/tests/expected/typedef/tea_python_tests/client.py +74 -0
- package/tests/expected/typedef/tea_python_tests/models.py +42 -0
- package/tests/fixtures/alias/Darafile +11 -0
- package/tests/fixtures/alias/libraries/Alias/Darafile +11 -0
- package/tests/fixtures/alias/libraries/Alias-Symbol/Darafile +11 -0
- package/tests/fixtures/builtin/Darafile +6 -0
- package/tests/fixtures/builtin/main.dara +333 -0
- package/tests/fixtures/complex/libraries/import.dara +18 -11
- package/tests/fixtures/complex/main.dara +451 -103
- package/tests/fixtures/import/libraries/Darafile +1 -1
- package/tests/fixtures/import/pack/Darafile +3 -0
- package/tests/fixtures/map/libraries/Darafile +3 -0
- package/tests/fixtures/map/libraries/import.dara +4 -0
- package/tests/fixtures/map/main.dara +17 -2
- package/tests/fixtures/model/.libraries.json +3 -0
- package/tests/fixtures/model/Darafile +5 -2
- package/tests/fixtures/model/libraries/Darafile +20 -0
- package/tests/fixtures/model/libraries/import.dara +27 -0
- package/tests/fixtures/model/main.dara +60 -42
- package/tests/fixtures/multi/.libraries.json +3 -0
- package/tests/fixtures/multi/Darafile +12 -0
- package/tests/fixtures/multi/api.dara +20 -0
- package/tests/fixtures/multi/lib/util.dara +5 -0
- package/tests/fixtures/multi/libraries/darabonba_Util_0.2.11/Teafile +62 -0
- package/tests/fixtures/multi/libraries/darabonba_Util_0.2.11/main.tea +244 -0
- package/tests/fixtures/multi/main.dara +32 -0
- package/tests/fixtures/multi/model/user.dara +33 -0
- package/tests/{python3.tests.js → main.tests.js} +107 -65
- package/tests/output/alias/setup.py +79 -0
- package/tests/output/alias/tea_python_tests/client.py +35 -0
- package/tests/output/annotation/setup.py +77 -0
- package/tests/output/annotation/tea_python_tests/client.py +93 -0
- package/tests/output/annotation/tea_python_tests/models.py +37 -0
- package/tests/output/api/setup.py +77 -0
- package/tests/output/api/tea_python_tests/client.py +106 -0
- package/tests/output/builtin/setup.py +77 -0
- package/tests/output/builtin/tea_python_tests/client.py +685 -0
- package/tests/output/comment/setup.py +77 -0
- package/tests/output/comment/tea_python_tests/client.py +288 -0
- package/tests/output/comment/tea_python_tests/models.py +195 -0
- package/tests/output/complex/setup.py +77 -0
- package/tests/output/complex/tea_python_tests/client.py +1168 -0
- package/tests/output/complex/tea_python_tests/exceptions.py +39 -0
- package/tests/output/complex/tea_python_tests/models.py +570 -0
- package/tests/output/const/setup.py +77 -0
- package/tests/output/const/tea_python_tests/client.py +14 -0
- package/tests/output/empty/setup.py +77 -0
- package/tests/output/empty/tea_python_tests/client.py +10 -0
- package/tests/output/exec/setup.py +77 -0
- package/tests/output/exec/tea_python_tests/exec_client.py +21 -0
- package/tests/output/function/setup.py +77 -0
- package/tests/output/function/tea_python_tests/client.py +64 -0
- package/tests/output/import/setup.py +78 -0
- package/tests/output/import/tea_python_tests/client.py +29 -0
- package/tests/output/map/setup.py +77 -0
- package/tests/output/map/tea_python_tests/client.py +39 -0
- package/tests/output/model/setup.py +77 -0
- package/tests/output/model/tea_python_tests/client.py +10 -0
- package/tests/output/model/tea_python_tests/exceptions.py +28 -0
- package/tests/output/model/tea_python_tests/models.py +780 -0
- package/tests/output/multi/setup.py +77 -0
- package/tests/output/multi/tea_python_tests/api.py +95 -0
- package/tests/output/multi/tea_python_tests/client.py +40 -0
- package/tests/output/multi/tea_python_tests/lib/util.py +19 -0
- package/tests/output/multi/tea_python_tests/model/user.py +23 -0
- package/tests/output/multi/tea_python_tests/model/user_exceptions.py +83 -0
- package/tests/output/multi/tea_python_tests/model/user_models.py +145 -0
- package/tests/output/statements/setup.py +77 -0
- package/tests/output/statements/tea_python_tests/client.py +86 -0
- package/tests/output/super/setup.py +77 -0
- package/tests/output/super/tea_python_tests/client.py +16 -0
- package/tests/output/typedef/setup.py +78 -0
- package/tests/output/typedef/tea_python_tests/client.py +74 -0
- package/tests/output/typedef/tea_python_tests/models.py +42 -0
- package/tests/common.tests.js +0 -244
- package/tests/lib.tests.js +0 -269
- package/tests/python2.tests.js +0 -283
- package/tests/resolver.tests.js +0 -434
package/ChangeLog.md
CHANGED
|
@@ -1,159 +1 @@
|
|
|
1
1
|
# ChangeLog
|
|
2
|
-
|
|
3
|
-
## 1.2.19 - 2025-01-13
|
|
4
|
-
* Adjust field name for object.
|
|
5
|
-
|
|
6
|
-
## 1.2.18 - 2024-02-29
|
|
7
|
-
* Fix: avoid keywords in variables.
|
|
8
|
-
|
|
9
|
-
## 1.2.17 - 2023-12-27
|
|
10
|
-
* Fix: correct model name when first letter is capitalized && and some keywords
|
|
11
|
-
|
|
12
|
-
## 1.2.16 - 2023-09-13
|
|
13
|
-
* Feat: support importing additional package
|
|
14
|
-
|
|
15
|
-
## 1.2.15 - 2022-12-26
|
|
16
|
-
* Fix: array assign and access with variables name
|
|
17
|
-
|
|
18
|
-
## 1.2.14 - 2022-12-12
|
|
19
|
-
|
|
20
|
-
* Fix: avoid keywords in model and variables.
|
|
21
|
-
|
|
22
|
-
## 1.2.13 - 2022-07-27
|
|
23
|
-
|
|
24
|
-
* Support import local package.
|
|
25
|
-
|
|
26
|
-
## 1.2.12 - 2022-07-20
|
|
27
|
-
|
|
28
|
-
* Support infinite loop reference in model.
|
|
29
|
-
|
|
30
|
-
## 1.2.11 - 2022-07-11
|
|
31
|
-
|
|
32
|
-
* Support complex list(`array-in-array`).
|
|
33
|
-
|
|
34
|
-
## 1.2.10 - 2022-05-31
|
|
35
|
-
|
|
36
|
-
* Fix import package for typedef.
|
|
37
|
-
|
|
38
|
-
## 1.2.9 - 2022-05-31
|
|
39
|
-
|
|
40
|
-
* Support Typedef.
|
|
41
|
-
|
|
42
|
-
## 1.2.8 - 2020-03-17
|
|
43
|
-
|
|
44
|
-
* Improve TeaModel to avoid serialization exception.
|
|
45
|
-
|
|
46
|
-
## 1.2.7 - 2020-03-02
|
|
47
|
-
|
|
48
|
-
* Python2 version upgraded to compatible version.
|
|
49
|
-
|
|
50
|
-
## 1.2.6 - 2020-02-05
|
|
51
|
-
|
|
52
|
-
* Improve annotations.
|
|
53
|
-
|
|
54
|
-
## 1.2.5 - 2020-01-27
|
|
55
|
-
|
|
56
|
-
* Resolve multi condition
|
|
57
|
-
|
|
58
|
-
## 1.2.4 - 2020-01-19
|
|
59
|
-
|
|
60
|
-
* Fix wrong function return value.
|
|
61
|
-
* Fix the error code generated by map operation when property_access is the key.
|
|
62
|
-
|
|
63
|
-
## 1.2.3 - 2020-12-30
|
|
64
|
-
|
|
65
|
-
* Support for static type hints to the class itself.
|
|
66
|
-
|
|
67
|
-
## 1.2.2 - 2020-12-28
|
|
68
|
-
|
|
69
|
-
* Fix the emit order for sub model code.
|
|
70
|
-
|
|
71
|
-
## 1.2.1 - 2020-12-25
|
|
72
|
-
|
|
73
|
-
* Support generate python2 code.
|
|
74
|
-
* Fix `variable is not defind` error.
|
|
75
|
-
|
|
76
|
-
## 1.2.0 - 2020-12-16
|
|
77
|
-
|
|
78
|
-
* Added support for python3.9.
|
|
79
|
-
* Drop support for python3.4 & python3.5 (Currently supported python versions:3.6,3.7,3.8,3.9).
|
|
80
|
-
* Support for async function.
|
|
81
|
-
* Replace the string formatting syntax with f-string.
|
|
82
|
-
* Support for type annotation.
|
|
83
|
-
|
|
84
|
-
## 1.1.1 - 2020-11-23
|
|
85
|
-
|
|
86
|
-
* Support for defining multi-line string.
|
|
87
|
-
* Support executable option.
|
|
88
|
-
* Fix aliases that don`t conform to python syntax.
|
|
89
|
-
* Fix the bug that `None` call the `to_map()`.
|
|
90
|
-
* Fix can't get variable value from dict & list.
|
|
91
|
-
* Fix to_map&from_map using uninitialized parameters.
|
|
92
|
-
|
|
93
|
-
## 1.1.0 - 2020-10-13
|
|
94
|
-
|
|
95
|
-
* Fix long description content type error in setup.py.
|
|
96
|
-
* support validate maximum and minimum values.
|
|
97
|
-
* Fix the exception when tmplate string has no placeholder.
|
|
98
|
-
* Improve the default value of clientName&package.
|
|
99
|
-
* Added warning about irregular configuration.
|
|
100
|
-
* Verify naming conventions.
|
|
101
|
-
* Added syntax check.
|
|
102
|
-
* End with operator when line feed.
|
|
103
|
-
|
|
104
|
-
## 1.0.9 - 2020-09-09
|
|
105
|
-
|
|
106
|
-
* Support type hints.
|
|
107
|
-
* Support local installation of python package.
|
|
108
|
-
|
|
109
|
-
## 1.0.8 - 2020-09-02
|
|
110
|
-
|
|
111
|
-
* Improve annotation.
|
|
112
|
-
* Specify model type.
|
|
113
|
-
* Add `returnType`.
|
|
114
|
-
* Improve model:
|
|
115
|
-
* Support all complex types.
|
|
116
|
-
* Fix non-model object call validate.
|
|
117
|
-
* Add `async`, `await` keywords.
|
|
118
|
-
* Fix the error when expected to be an array type.
|
|
119
|
-
* Fix model.py not import third-party packages.
|
|
120
|
-
* Fix import unused modules.
|
|
121
|
-
* Support specify the latest version of dependency.
|
|
122
|
-
|
|
123
|
-
## 1.0.7 - 2020-08-11
|
|
124
|
-
|
|
125
|
-
* Fix the syntax of calling static methods.
|
|
126
|
-
|
|
127
|
-
## 1.0.6 - 2020-08-10
|
|
128
|
-
|
|
129
|
-
* Support array access.
|
|
130
|
-
|
|
131
|
-
## 1.0.5 - 2020-07-30
|
|
132
|
-
|
|
133
|
-
* Support description.
|
|
134
|
-
* Support [[ string ]] array.
|
|
135
|
-
* Imporve model format.
|
|
136
|
-
|
|
137
|
-
## 1.0.4 - 2020-07-10
|
|
138
|
-
|
|
139
|
-
* Imporve models
|
|
140
|
-
* Imporve function comments
|
|
141
|
-
|
|
142
|
-
## 1.0.3 - 2020-07-03
|
|
143
|
-
|
|
144
|
-
* Fixed unsupported symbols
|
|
145
|
-
|
|
146
|
-
## 1.0.2 - 2020-06-23
|
|
147
|
-
|
|
148
|
-
* Fixed validate_pattern syntax error
|
|
149
|
-
|
|
150
|
-
## 1.0.1 - 2020-06-22
|
|
151
|
-
|
|
152
|
-
* Improve python generator to be compatible with darafile
|
|
153
|
-
|
|
154
|
-
## 1.0.0 - 2020-06-18
|
|
155
|
-
|
|
156
|
-
* First release
|
|
157
|
-
|
|
158
|
-
> Initialization release of the `Darabonba Code Generator for Python` Version 1.0.0 on NPM.
|
|
159
|
-
> See <https://www.npmjs.com/package/@darabonba/python-generator> for more information.
|