From 8c1f1d8f2aec9977ab12ea715ebde5643e0c494d Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 25 May 2016 11:11:59 -0500 Subject: [PATCH] rpctool: make readline optional, add to conda dependencies. Closes #442 --- artiq/frontend/artiq_rpctool.py | 7 ++++++- conda/artiq/meta.yaml | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/artiq/frontend/artiq_rpctool.py b/artiq/frontend/artiq_rpctool.py index 44d28716d..3ab7f25a5 100755 --- a/artiq/frontend/artiq_rpctool.py +++ b/artiq/frontend/artiq_rpctool.py @@ -5,7 +5,6 @@ import textwrap import sys import traceback import numpy as np # Needed to use numpy in RPC call arguments on cmd line -import readline # This makes input() nicer import pprint from artiq.protocols.pc_rpc import AutoTarget, Client @@ -87,6 +86,12 @@ def call_method(remote, method_name, args): def interactive(remote): + try: + import readline # This makes input() nicer + except ImportError: + print("Warning: readline not available. " + "Install it to add line editing capabilities.") + while True: try: cmd = input("({}) ".format(remote.get_selected_target())) diff --git a/conda/artiq/meta.yaml b/conda/artiq/meta.yaml index 3b76bcd88..212c1311c 100644 --- a/conda/artiq/meta.yaml +++ b/conda/artiq/meta.yaml @@ -38,6 +38,8 @@ requirements: - binutils-or1k-linux run: - python >=3.5.1 + - readline # [linux] + - pyreadline # [win] - llvmlite-artiq 0.10.0.dev py35_24 - scipy - numpy