use atty instead of isatty (#8365)

This commit is contained in:
Marek Kotewicz
2018-04-11 12:56:37 +02:00
committed by André Silva
parent 6737484eda
commit dd2c27958c
6 changed files with 40 additions and 31 deletions

View File

@@ -22,6 +22,7 @@ use std::sync::{Arc};
use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering as AtomicOrdering};
use std::time::{Instant, Duration};
use atty;
use ethcore::client::{
BlockId, BlockChainClient, ChainInfo, BlockInfo, BlockChainInfo,
BlockQueueInfo, ChainNotify, ClientReport, Client, ClientIoMessage
@@ -31,7 +32,6 @@ use ethcore::snapshot::{RestorationStatus, SnapshotService as SS};
use ethcore::snapshot::service::Service as SnapshotService;
use sync::{LightSyncProvider, LightSync, SyncProvider, ManageNetwork};
use io::{TimerToken, IoContext, IoHandler};
use isatty::{stdout_isatty};
use light::Cache as LightDataCache;
use light::client::LightChainClient;
use number_prefix::{binary_prefix, Standalone, Prefixed};
@@ -293,7 +293,7 @@ impl<T: InformantData> Informant<T> {
*self.last_tick.write() = Instant::now();
let paint = |c: Style, t: String| match self.with_color && stdout_isatty() {
let paint = |c: Style, t: String| match self.with_color && atty::is(atty::Stream::Stdout) {
true => format!("{}", c.paint(t)),
false => t,
};

View File

@@ -29,7 +29,7 @@ extern crate env_logger;
extern crate fdlimit;
extern crate futures;
extern crate futures_cpupool;
extern crate isatty;
extern crate atty;
extern crate jsonrpc_core;
extern crate num_cpus;
extern crate number_prefix;