Update octosuite.py

This commit is contained in:
Richard Mwewa
2022-12-23 16:08:46 +02:00
committed by GitHub
parent cdf04fe443
commit ea3b8bcd71

View File

@@ -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()