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

Method do_new

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

Source from the content-addressed store, hash-verified

380 return self._build_target(path, args, debug=debug)
381
382 def do_new(self, args):
383 c = self._get_config()
384 n = c['counter'] + 1
385
386 while True:
387 name = 'project-%d' % n
388 path = os.path.join(self._get_path(), name)
389 if not os.path.exists(path):
390 logging.info('Make project path %s', path)
391 os.mkdir(path)
392 break
393 n += 1
394
395 args['id'] = n
396 args['name'] = name
397 args['path'] = path
398 if not args.get('title', ''):
399 args['title'] = os.path.basename(args.get('src'))
400 self._build_data(args)
401
402 c['projects'].append(args)
403 c['counter'] = n
404 self._set_config(c)
405
406 logging.info('Create project: %s', args)
407 return args
408
409 def do_update(self, args):
410 self._build_data(args)

Callers

nothing calls this directly

Calls 4

_build_dataMethod · 0.95
_get_configMethod · 0.80
_get_pathMethod · 0.80
_set_configMethod · 0.80

Tested by

no test coverage detected