@darabonba/python-generator 2.0.0 → 2.0.1
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/lib/generator.js +10 -6
- package/package.json +1 -1
- package/tests/expected/complex/tea_python_tests/client.py +5 -4
- package/tests/expected/multi/tea_python_tests/model/user.py +3 -0
- package/tests/fixtures/complex/main.dara +1 -0
- package/tests/fixtures/multi/libraries/darabonba_Util_0.2.11/Teafile +7 -1
- package/tests/fixtures/multi/libraries/darabonba_Util_0.2.11/util.tea +2 -0
- package/tests/fixtures/multi/model/user.dara +2 -0
- package/tests/output/complex/tea_python_tests/client.py +5 -4
- package/tests/output/multi/tea_python_tests/model/user.py +3 -0
- package/src/generator.js +0 -231
- package/src/langs/common/combinator.js +0 -193
- package/src/langs/common/config.js +0 -60
- package/src/langs/common/enum.js +0 -179
- package/src/langs/common/items.js +0 -551
- package/src/langs/common/package_info.js +0 -53
- package/src/langs/python/combinator.js +0 -1898
- package/src/langs/python/config.js +0 -169
- package/src/langs/python/files/.gitignore.tmpl +0 -5
- package/src/langs/python/files/__init__.py.tmpl +0 -1
- package/src/langs/python/files/setup.py.tmpl +0 -74
- package/src/langs/python/package_info.js +0 -78
- package/src/langs/python2/combinator.js +0 -1770
- package/src/langs/python2/config.js +0 -162
- package/src/langs/python2/files/.gitignore.tmpl +0 -5
- package/src/langs/python2/files/__init__.py.tmpl +0 -1
- package/src/langs/python2/files/setup.py.tmpl +0 -82
- package/src/langs/python2/package_info.js +0 -78
- package/src/lib/debug.js +0 -55
- package/src/lib/emitter.js +0 -95
- package/src/lib/helper.js +0 -207
- package/src/resolver/base.js +0 -282
- package/src/resolver/client.js +0 -1013
- package/src/resolver/model.js +0 -159
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
indent: ' ',
|
|
5
|
-
ext: '.tea',
|
|
6
|
-
resolvePathByPackage: false,
|
|
7
|
-
keywords: {
|
|
8
|
-
general: [],
|
|
9
|
-
function: [],
|
|
10
|
-
class: [],
|
|
11
|
-
param_variables: []
|
|
12
|
-
},
|
|
13
|
-
typeMap: {},
|
|
14
|
-
symbolMap: {},
|
|
15
|
-
modifyOrder: [],
|
|
16
|
-
exceptionMap: {},
|
|
17
|
-
model: {
|
|
18
|
-
include: [],
|
|
19
|
-
constructor: {
|
|
20
|
-
params: []
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
client: {
|
|
24
|
-
filename: 'client',
|
|
25
|
-
include: []
|
|
26
|
-
},
|
|
27
|
-
generateFileInfo: 'This file is auto-generated, don\'t edit it. Thanks.',
|
|
28
|
-
response: '_response',
|
|
29
|
-
request: '_request',
|
|
30
|
-
runtime: '_runtime',
|
|
31
|
-
baseClient: [],
|
|
32
|
-
tea: {
|
|
33
|
-
core: {
|
|
34
|
-
name: 'TeaCore',
|
|
35
|
-
doAction: 'doAction',
|
|
36
|
-
allowRetry: 'allowRetry',
|
|
37
|
-
sleep: 'sleep',
|
|
38
|
-
getBackoffTime: 'getBackoffTime',
|
|
39
|
-
isRetryable: 'isRetryable'
|
|
40
|
-
},
|
|
41
|
-
model: {
|
|
42
|
-
name: 'TeaModel'
|
|
43
|
-
},
|
|
44
|
-
converter: {
|
|
45
|
-
name: 'TeaConverter'
|
|
46
|
-
},
|
|
47
|
-
response: {
|
|
48
|
-
name: 'TeaResponse'
|
|
49
|
-
},
|
|
50
|
-
request: {
|
|
51
|
-
name: 'TeaRequest'
|
|
52
|
-
},
|
|
53
|
-
exception: {
|
|
54
|
-
name: 'TeaException'
|
|
55
|
-
},
|
|
56
|
-
exceptionUnretryable: {
|
|
57
|
-
name: 'TeaUnretryableException'
|
|
58
|
-
},
|
|
59
|
-
}
|
|
60
|
-
};
|
package/src/langs/common/enum.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const Enum = require('enum');
|
|
4
|
-
|
|
5
|
-
class SymbolEnum extends Enum {
|
|
6
|
-
constructor() {
|
|
7
|
-
super([
|
|
8
|
-
'ASSIGN',
|
|
9
|
-
'EQ',
|
|
10
|
-
'NOT',
|
|
11
|
-
'AND',
|
|
12
|
-
'OR',
|
|
13
|
-
'PLUS',
|
|
14
|
-
'SUB',
|
|
15
|
-
'MULTI',
|
|
16
|
-
'DIV',
|
|
17
|
-
'POWER',
|
|
18
|
-
'GREATER',
|
|
19
|
-
'GREATER_EQ',
|
|
20
|
-
'LESS',
|
|
21
|
-
'LESS_EQ',
|
|
22
|
-
'REVERSE',
|
|
23
|
-
'CONCAT',
|
|
24
|
-
'JUDGE',
|
|
25
|
-
'RISK'
|
|
26
|
-
], { name: 'symbol', ignoreCase: true });
|
|
27
|
-
}
|
|
28
|
-
assign() {
|
|
29
|
-
return this.ASSIGN.key;
|
|
30
|
-
}
|
|
31
|
-
eq() {
|
|
32
|
-
return this.EQ.key;
|
|
33
|
-
}
|
|
34
|
-
not() {
|
|
35
|
-
return this.NOT.key;
|
|
36
|
-
}
|
|
37
|
-
and() {
|
|
38
|
-
return this.AND.key;
|
|
39
|
-
}
|
|
40
|
-
or() {
|
|
41
|
-
return this.OR.key;
|
|
42
|
-
}
|
|
43
|
-
plus() {
|
|
44
|
-
return this.PLUS.key;
|
|
45
|
-
}
|
|
46
|
-
multi() {
|
|
47
|
-
return this.MULTI.key;
|
|
48
|
-
}
|
|
49
|
-
div() {
|
|
50
|
-
return this.DIV.key;
|
|
51
|
-
}
|
|
52
|
-
power() {
|
|
53
|
-
return this.POWER.key;
|
|
54
|
-
}
|
|
55
|
-
greater() {
|
|
56
|
-
return this.GREATER.key;
|
|
57
|
-
}
|
|
58
|
-
greaterEq() {
|
|
59
|
-
return this.GREATER_EQ.key;
|
|
60
|
-
}
|
|
61
|
-
less() {
|
|
62
|
-
return this.LESS.key;
|
|
63
|
-
}
|
|
64
|
-
lessEq() {
|
|
65
|
-
return this.LESS_EQ.key;
|
|
66
|
-
}
|
|
67
|
-
reverse() {
|
|
68
|
-
return this.REVERSE.key;
|
|
69
|
-
}
|
|
70
|
-
concat() {
|
|
71
|
-
return this.CONCAT.key;
|
|
72
|
-
}
|
|
73
|
-
judge() {
|
|
74
|
-
return this.JUDGE.key;
|
|
75
|
-
}
|
|
76
|
-
risk() {
|
|
77
|
-
return this.RISK.key;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
class ModifyEnum extends Enum {
|
|
82
|
-
constructor() {
|
|
83
|
-
super([
|
|
84
|
-
'ASYNC',
|
|
85
|
-
'PRIVATE',
|
|
86
|
-
'PROTECTED',
|
|
87
|
-
'INTERNAL',
|
|
88
|
-
'PUBLIC',
|
|
89
|
-
'FINAL',
|
|
90
|
-
'ABSTRACT',
|
|
91
|
-
'STATIC'
|
|
92
|
-
], { name: 'modify', ignoreCase: true });
|
|
93
|
-
}
|
|
94
|
-
async() {
|
|
95
|
-
return this.ASYNC.key;
|
|
96
|
-
}
|
|
97
|
-
private() {
|
|
98
|
-
return this.PRIVATE.key;
|
|
99
|
-
}
|
|
100
|
-
protected() {
|
|
101
|
-
return this.PROTECTED.key;
|
|
102
|
-
}
|
|
103
|
-
internal() {
|
|
104
|
-
return this.INTERNAL.key;
|
|
105
|
-
}
|
|
106
|
-
public() {
|
|
107
|
-
return this.PUBLIC.key;
|
|
108
|
-
}
|
|
109
|
-
final() {
|
|
110
|
-
return this.FINAL.key;
|
|
111
|
-
}
|
|
112
|
-
abstract() {
|
|
113
|
-
return this.ABSTRACT.key;
|
|
114
|
-
}
|
|
115
|
-
static() {
|
|
116
|
-
return this.STATIC.key;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
class ExceptionEnum extends Enum {
|
|
121
|
-
constructor() {
|
|
122
|
-
super([
|
|
123
|
-
'BASE',
|
|
124
|
-
], { name: 'exceptions', ignoreCase: true });
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
base() {
|
|
128
|
-
return this.BASE.key;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
class TypeEnum extends Enum {
|
|
133
|
-
constructor() {
|
|
134
|
-
super([
|
|
135
|
-
'any',
|
|
136
|
-
'anyReference',
|
|
137
|
-
'void',
|
|
138
|
-
'null',
|
|
139
|
-
'empty',
|
|
140
|
-
'char',
|
|
141
|
-
'string',
|
|
142
|
-
'boolean',
|
|
143
|
-
'number',
|
|
144
|
-
'integer',
|
|
145
|
-
'uint8',
|
|
146
|
-
'int8',
|
|
147
|
-
'uint16',
|
|
148
|
-
'int16',
|
|
149
|
-
'uint32',
|
|
150
|
-
'int32',
|
|
151
|
-
'uint64',
|
|
152
|
-
'int64',
|
|
153
|
-
'long',
|
|
154
|
-
'ulong',
|
|
155
|
-
'float',
|
|
156
|
-
'double',
|
|
157
|
-
'single',
|
|
158
|
-
'decimal',
|
|
159
|
-
'byte',
|
|
160
|
-
'map',
|
|
161
|
-
'list',
|
|
162
|
-
'object',
|
|
163
|
-
'readable',
|
|
164
|
-
'writable'
|
|
165
|
-
], { name: 'types', ignoreCase: true });
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const Symbol = new SymbolEnum();
|
|
170
|
-
const Modify = new ModifyEnum();
|
|
171
|
-
const Exceptions = new ExceptionEnum();
|
|
172
|
-
const Types = new TypeEnum();
|
|
173
|
-
|
|
174
|
-
module.exports = {
|
|
175
|
-
Symbol,
|
|
176
|
-
Modify,
|
|
177
|
-
Exceptions,
|
|
178
|
-
Types
|
|
179
|
-
};
|