MCPcopy Create free account
hub / github.com/django/code.djangoproject.com / is_valid_boolstr

Method is_valid_boolstr

traccheck.py:67–73  ·  view source on GitHub ↗

Only accept either `enabled` or `disabled`, this is to prevent issues with trailing comments. For example the line `someplugin.* = enabled # we need this` would not enable the plugin because of the comment.

(self)

Source from the content-addressed store, hash-verified

65
66 @property
67 def is_valid_boolstr(self):
68 """
69 Only accept either `enabled` or `disabled`, this is to prevent issues with trailing
70 comments. For example the line `someplugin.* = enabled # we need this` would not
71 enable the plugin because of the comment.
72 """
73 return self.boolstr in {"enabled", "disabled"}
74
75 def __str__(self):
76 return f"{self.pathstr} = {self.boolstr}"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected