def print_message(self): message = markdown.markdown( MESSAGE.format( register_or_sign_in_url= f"<{self.owner.register_or_sign_in_url}>", retrieve_api_key_url=f"<{self.owner.retrieve_api_key_url}>", )) # We use Python's markdown instead of IPython's Markdown because # jupyter lab/colab/deepnotes all behave differently display(HTML(HTML_MESSAGE.format(message=message)))
def ask(self, p, method): message = f"Please enter a value for <span style='color: red;'>{p.get('title')}</span>" if "default" in p: message += f" or leave empty for the default value <span style='color: red;'>{p.get('default')}</span>" message += ", then press *ENTER*" if "example" in p: message += f" The value should look like <span style='color: red;'>{p.get('example')}</span>" message = markdown.markdown(message) display(HTML(HTML_ASK.format(message=message))) return method(p.get("title") + ": ").strip()
def ask_user_markdown(self) -> str: message = markdown.markdown(self.markdown_message) # We use Python's markdown instead of IPython's Markdown because # jupyter lab/colab/deepnotes all behave differently display(HTML(HTML_MESSAGE.format(message=message))) return getpass.getpass(self.prompt + ": ")
def show(self): return display(self.driver.show())