MCPcopy
hub / github.com/django/django / handle

Method handle

tests/user_commands/management/commands/hal.py:16–32  ·  view source on GitHub ↗
(self, *app_labels, **options)

Source from the content-addressed store, hash-verified

14 parser.add_argument("--empty", action="store_true", help="Do nothing.")
15
16 def handle(self, *app_labels, **options):
17 app_labels = set(app_labels)
18
19 if options["empty"]:
20 self.stdout.write()
21 self.stdout.write("Dave, I can't do that.")
22 return
23
24 if not app_labels:
25 raise CommandError("I'm sorry Dave, I'm afraid I can't do that.")
26
27 # raise an error if some --parameter is flowing from options to args
28 for app_label in app_labels:
29 if app_label.startswith("--"):
30 raise CommandError("Sorry, Dave, I can't let you do that.")
31
32 self.stdout.write("Dave, my mind is going. I can feel it. I can feel it.")

Callers

nothing calls this directly

Calls 2

CommandErrorClass · 0.90
writeMethod · 0.45

Tested by

no test coverage detected