Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
HilkopterBob committed Mar 21, 2024
1 parent 599d79f commit bd57173
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions Utils/inp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,12 @@

# import pyreadline as readline
from rich import print, markdown # pylint: disable=W0622

from pystyle import Colors, Write, Center, Box
from Utils.pr import Pr
from Utils.logger import Logger

from prompt_toolkit import prompt
from prompt_toolkit.completion import WordCompleter
from pystyle import Colors, Write, Center, Box


# class Completer: # Custom completer
# """Completer for autocompletion"""

# def __init__(self, options):
# self.options = sorted(options)
# self.matches = []

# def complete(self, text, state):
# """tries to complete a text on <tab>"""
# if state == 0: # on first trigger, build possible matches
# if text: # cache matches (entries that start with entered text)
# self.matches = [s for s in self.options if s and s.startswith(text)]
# else: # no text entered, all matches possible
# self.matches = self.options[:]

# # Check if there are more matches
# if state < len(self.matches): # pylint: disable=R1705
# return self.matches[state]
# else:
# return None
from Utils.pr import Pr
from Utils.logger import Logger


class Inp:
Expand Down Expand Up @@ -75,18 +52,10 @@ def inp(

min_len = 0
max_len = 150
# user_input = Write.Input(text + "\n >_ ", Colors.white, interval=0.0025)

usercompleter = WordCompleter(userbefehl.keys())

user_input = prompt(">_ ", completer=usercompleter)

# completer = Completer(userbefehl)
# readline.set_completer(completer.complete)
# readline.parse_and_bind("tab: complete")

# readline.co

try:
if not user_input.strip():
raise ValueError("Leere Eingabe")
Expand Down

0 comments on commit bd57173

Please sign in to comment.