MCPcopy Index your code
hub / github.com/dashingsoft/pyarmor-webui / _build_data

Method _build_data

handler.py:214–298  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

212 self.name = 'project'
213
214 def _build_data(self, args):
215 src = self._format_path(args.get('src'))
216 self._check_arg('src', src, types=str)
217 self._check_path(src)
218
219 entry = args.get('entry', [])
220 self._check_arg('entry', entry, types=list)
221
222 exclude = args.get('exclude', [])
223 self._check_arg('exclude', exclude, types=list)
224
225 licfile = args.get('licenseFile')
226 self._check_arg('license', licfile, types=str)
227 if licfile == 'false':
228 licfile = 'outer'
229
230 bootstrap = args.get('bootstrapCode')
231 self._check_arg('bootstrap code', bootstrap, valids=[0, 1, 2, 3])
232
233 obfcode = args.get('obfCode')
234 if obfcode is True:
235 obfcode = 1
236 self._check_arg('obfCode', obfcode, valids=[0, 1, 2])
237
238 obfmod = 2 if args.get('obfMod') is True else 0
239
240 platforms = args.get('platforms', [])
241 self._check_arg('platforms', platforms, types=list)
242
243 plugins = args.get('plugins', [])
244 self._check_arg('plugins', plugins, types=list)
245
246 mixins = args.get('mixins')
247 mixins = ['str'] if mixins is True else [] if not mixins else mixins
248
249 include = args.get('include')
250 self._check_arg('include', include,
251 valids=['exact', 'list', 'all'])
252
253 manifest = []
254 if include == 'exact':
255 if entry:
256 manifest.append('include ' + ' '.join(entry))
257 elif include == 'all':
258 manifest.append('global-include *.py')
259 else:
260 manifest.append('include *.py')
261 for x in exclude:
262 cmd = 'exclude' if x.endswith('.py') else 'prune'
263 manifest.append('%s %s' % (cmd, x))
264
265 if licfile and not licfile.endswith('license.lic'):
266 licfile = None
267
268 def get_bool(x, v=0):
269 return 1 if args.get(x) else v
270
271 data = {

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