(self, args, update=False)
| 492 | return args |
| 493 | |
| 494 | def _create(self, args, update=False): |
| 495 | path = self._get_path() |
| 496 | output = self._format_path(args.get('output', path)) |
| 497 | |
| 498 | rcode = args['rcode'] |
| 499 | filepath = os.path.join(output, rcode) |
| 500 | filename = os.path.join(filepath, 'pyarmor.rkey') |
| 501 | if os.path.exists(filename) and not update: |
| 502 | raise RuntimeError('The license "%s" already exists' % rcode) |
| 503 | |
| 504 | cmd_args = ['gen', 'key', '--output', filepath] |
| 505 | device = [] |
| 506 | for name, opt in self.options.items(): |
| 507 | if name in args: |
| 508 | v = args.get(name) |
| 509 | if not v: |
| 510 | continue |
| 511 | if opt.startswith('-'): |
| 512 | cmd_args.extend([opt, v]) |
| 513 | else: |
| 514 | device.append(opt + v) |
| 515 | if device: |
| 516 | cmd_args.extend(['-b', ''.join(device)]) |
| 517 | |
| 518 | call_pyarmor(cmd_args, homepath=self._config['homepath']) |
| 519 | return filename |
| 520 | |
| 521 | def do_update(self, args): |
| 522 | c, p = self._get_license(args) |
no test coverage detected