MCPcopy Create free account
hub / github.com/aio-libs/multidict / _get_operations

Method _get_operations

tools/upgrade_pythoncapi.py:522–554  ·  view source on GitHub ↗
(self, parser)

Source from the content-addressed store, hash-verified

520 self.log(f"WARNING: {msg}")
521
522 def _get_operations(self, parser):
523 args_names = self.args.operations.split(',')
524
525 wanted = set()
526 for name in args_names:
527 name = name.strip()
528 if not name:
529 continue
530
531 if name == "all":
532 wanted |= all_operations()
533 elif name.startswith("-"):
534 name = name[1:]
535 wanted.discard(name)
536 else:
537 wanted.add(name)
538
539 operations = []
540 for operation_class in OPERATIONS:
541 name = operation_class.NAME
542 if name not in wanted:
543 continue
544 wanted.discard(name)
545 operation = operation_class(self)
546 operations.append(operation)
547
548 if wanted:
549 print(f"invalid operations: {','.join(wanted)}")
550 print()
551 self.usage(parser)
552 sys.exit(1)
553
554 return operations
555
556 def add_line(self, content, line):
557 # Use the first matching newline

Callers 1

_parse_optionsMethod · 0.95

Calls 3

usageMethod · 0.95
all_operationsFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected