MCPcopy Create free account
hub / github.com/dashingsoft/pyarmor-webui / _build_data

Method _build_data

handler8.py:126–198  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

124 self.name = 'project'
125
126 def _build_data(self, args):
127 src = self._format_path(args.get('src'))
128 self._check_arg('src', src, types=str)
129 self._check_path(src)
130
131 entry = args.get('entry', [])
132 self._check_arg('entry', entry, types=list)
133
134 exclude = args.get('exclude', [])
135 self._check_arg('exclude', exclude, types=list)
136
137 licfile = args.get('licenseFile')
138 self._check_arg('license', licfile, types=str)
139 if licfile == 'false':
140 licfile = 'outer'
141
142 bootstrap = args.get('bootstrapCode')
143 self._check_arg('bootstrap code', bootstrap, valids=[0, 1, 2, 3])
144
145 obfcode = args.get('obfCode')
146 if obfcode is True:
147 obfcode = 1
148 self._check_arg('obfCode', obfcode, valids=[0, 1, 2])
149
150 obfmod = 2 if args.get('obfMod') is True else 0
151
152 platforms = args.get('platforms', [])
153 self._check_arg('platforms', platforms, types=list)
154
155 plugins = args.get('plugins', [])
156 self._check_arg('plugins', plugins, types=list)
157
158 mixins = args.get('mixins')
159 mixins = ['str'] if mixins is True else [] if not mixins else mixins
160
161 include = args.get('include')
162 self._check_arg('include', include,
163 valids=['exact', 'list', 'all'])
164
165 if licfile and not licfile.endswith('pyarmor.rkey'):
166 licfile = None
167
168 def get_bool(x, v=0):
169 return 1 if args.get(x) else v
170
171 data = {
172 'src': src,
173 'manifest': None,
174 'entry': ','.join(entry),
175 'platform': ','.join([x[-1] for x in platforms]),
176 'plugins': [x for x in plugins],
177 'cross_protection': get_bool('crossProtection'),
178 'restrict_mode': args.get('restrictMode', 1),
179 'obf_mod': obfmod,
180 'obf_code': obfcode,
181 'wrap_mode': get_bool('wrapMode'),
182 'advanced_mode': args.get('advancedMode', 0),
183 'enable_suffix': get_bool('enableSuffix'),

Callers 3

_build_tempMethod · 0.95
do_newMethod · 0.95
do_updateMethod · 0.95

Calls 3

_format_pathMethod · 0.80
_check_argMethod · 0.80
_check_pathMethod · 0.80

Tested by

no test coverage detected