MCPcopy Create free account
hub / github.com/ehForwarderBot/ehForwarderBot / __init__

Method __init__

ehforwarderbot/wizard.py:277–302  ·  view source on GitHub ↗
(self, prompt: str = "", choices: list = None, choices_id: list = None, bullet: str = "●",
                 bullet_color: str = colors.foreground["default"], word_color: str = colors.foreground["default"],
                 word_on_switch: str = colors.REVERSE, background_color: str = colors.background["default"],
                 background_on_switch: str = colors.REVERSE, pad_right=0, indent: int = 0, align=0, margin: int = 0,
                 shift: int = 0, required: bool = False)

Source from the content-addressed store, hash-verified

275class ReorderBullet(Bullet):
276
277 def __init__(self, prompt: str = "", choices: list = None, choices_id: list = None, bullet: str = "●",
278 bullet_color: str = colors.foreground["default"], word_color: str = colors.foreground["default"],
279 word_on_switch: str = colors.REVERSE, background_color: str = colors.background["default"],
280 background_on_switch: str = colors.REVERSE, pad_right=0, indent: int = 0, align=0, margin: int = 0,
281 shift: int = 0, required: bool = False):
282 if choices is None:
283 choices = []
284 if choices_id is None:
285 choices_id = []
286 prompt += "\n" + _(
287 "[ =: Shift up; -: Shift down; Backspace: Remove ]"
288 )
289 choices.extend((
290 _("+ Add"),
291 _("✓ Submit")
292 ))
293 super().__init__(prompt, choices, bullet, bullet_color, word_color, word_on_switch, background_color,
294 background_on_switch, pad_right, indent, align, margin, shift)
295 self.choices_id = choices_id
296 self.choices_id.extend((
297 "add",
298 "submit"
299 ))
300 self._key_handler: Dict[int, Callable] = self._key_handler.copy()
301 self._key_handler[NEWLINE_KEY] = self.__class__.accept_fork
302 self.required = required
303
304 @keyhandler.register(ord('-'))
305 def shift_up(self):

Callers

nothing calls this directly

Calls 2

copyMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected