Skip to content

Use pyreadline on Windows #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compoundpi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
'MarkupSafe<0.16',
])

if sys.platform.startswith('Win'):
__requires__.append('pyreadline')

__classifiers__ = [
'Development Status :: 4 - Beta',
'Environment :: Console',
Expand Down
6 changes: 5 additions & 1 deletion compoundpi/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@
import os
import re
import cmd
import readline
import locale
import logging
import warnings
from textwrap import TextWrapper

try:
import readline
except ImportError:
import pyreadline as readline

from .terminal import _CONSOLE

# Hex 1 and 2 are used to ensure readline ignores color sequences in the prompt
Expand Down