Mini Shell
3
��]�+ � @ s� d Z ddlZddlmZ ddlmZ yeZW n ek
rD e ZY nX ddddd d
ddd
d
dd�Z
d!dd�Zdd� Zdd� Z
dd� Zdd� ZG dd� d�Zdd� Zed kr�e� dS )"a
enchant.checker.CmdLineChecker: Command-Line spell checker
This module provides the class CmdLineChecker, which interactively
spellchecks a piece of text by interacting with the user on the
command line. It can also be run as a script to spellcheck a file.
� N)�SpellChecker)�printfz[0mz[30mz[31mz[32mz[33mz[34mz[35mz[36mz[90mz[1m)�normalZblack�red�green�yellow�blueZpurple�cyanZgreyZgray�boldr � c C s. t jj� r"t| | | td S || S dS )aB
Change text color for the Linux terminal.
Args:
string (str): String to colorify
color (str): Color to colorify the string in the following list:
black, red, green, yellow, blue, purple, cyan, gr[ae]y
prefix (str): Prefix to add to string (ex: Beginning of line graphics)
r N)�sys�stdout�isatty�colors)�string�color�prefix� r �$/usr/lib/python3.6/CmdLineChecker.pyr B s
r c C s dt ddd� d | S )N�[�+r )r z] )r )r r r r �successQ s r c C s dt ddd� d | S )Nr �!r )r z] )r )r r r r �errorT s r c C s dt ddd� d | S )Nr �*r )r z] )r )r r r r �warningW s r c C s dt ddd� d | S )Nr �.r )r z] )r )r r r r �infoZ s r c @ s| e Zd ZdZddgZdd� Zdd� Zdd � Zd
d� Zdd
� Z e
dd� �Zdd� Zdd� Z
dd� Zddd�Zddddge_dS )�CmdLineCheckera A simple command-line spell checker.
This class implements a simple command-line spell checker. It must
be given a SpellChecker instance to operate on, and interacts with
the user by printing instructions on stdout and reading commands from
stdin.
r
�stdinc C s d| _ d | _d S )NF)�_stop�_checker)�selfr r r �__init__h s zCmdLineChecker.__init__c C s
|| _ d S )N)r! )r"