MCPcopy Create free account
hub / github.com/dbcli/mycli / _tips_picker

Function _tips_picker

mycli/main_modes/repl.py:841–854  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

839
840
841def _tips_picker() -> str:
842 tips = []
843
844 try:
845 with resources.files(mycli_package).joinpath('TIPS').open('r') as f:
846 for line in f:
847 if line.startswith("#"):
848 continue
849 if tip := line.strip():
850 tips.append(tip)
851 except FileNotFoundError:
852 pass
853
854 return random.choice(tips) if tips else r'\? or "help" for help!'
855
856
857def main_repl(mycli: 'MyCli') -> None:

Callers 1

_show_startup_bannerFunction · 0.85

Calls 2

openMethod · 0.80
joinpathMethod · 0.80

Tested by

no test coverage detected