()
| 839 | |
| 840 | |
| 841 | def _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 | |
| 857 | def main_repl(mycli: 'MyCli') -> None: |
no test coverage detected