From ea3b8bcd716123aedf1231ac37c136532a70ed95 Mon Sep 17 00:00:00 2001 From: Richard Mwewa <74001397+rly0nheart@users.noreply.github.com> Date: Fri, 23 Dec 2022 16:08:46 +0200 Subject: [PATCH] Update octosuite.py --- octosuite/octosuite.py | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/octosuite/octosuite.py b/octosuite/octosuite.py index f738c74..76bb2b7 100644 --- a/octosuite/octosuite.py +++ b/octosuite/octosuite.py @@ -30,30 +30,24 @@ from octosuite.csv_loggers import log_org_profile, log_user_profile, log_repo_pr -def set_readline(): - if os.name == "nt": - try: - from pyreadline3 import Readline - except ImportError: - subprocess.run(['pip3', 'install', 'pyreadline3']) - readline = Readline() - else: - import readline +if os.name == "nt": + try: + from pyreadline3 import Readline + except ImportError: + subprocess.run(['pip3', 'install', 'pyreadline3']) + readline = Readline() +else: + import readline - def completer(text, state): - options = [i for i in commands if i.startswith(text)] - if state < len(options): - return options[state] - else: - return None + def completer(text, state): + options = [i for i in commands if i.startswith(text)] + if state < len(options): + return options[state] + else: + return None - readline.parse_and_bind("tab: complete") - readline.set_completer(completer) - - return readline - - -set_readline() + readline.parse_and_bind("tab: complete") + readline.set_completer(completer) # path_finder()