From fbea16177695d3f64c494ce6a32f1184705ac18c Mon Sep 17 00:00:00 2001 From: yalechen Date: Sat, 20 Oct 2018 11:35:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=BC=E5=AE=B9Python3=E7=9A=84=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cobra/log.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cobra/log.py b/cobra/log.py index cd27fb22..04c517fc 100644 --- a/cobra/log.py +++ b/cobra/log.py @@ -120,6 +120,8 @@ def emit(self, record): if not self.is_tty: if message and message[0] == "\r": message = message[1:] + if sys.version > '3': + message = message.decode() stream.write(message) else: self.output_colorized(message) From 8d1cb93c7f456916f3dfc5456ea7b2a8e09a9da6 Mon Sep 17 00:00:00 2001 From: yalechen Date: Wed, 28 Nov 2018 19:37:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..1394f28d --- /dev/null +++ b/install.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +OS=`uname -s` +if [ ${OS} == "Darwin" ];then + brew install grep findutils flex phantomjs +elif [ ${OS} == "Linux" ];then + source /etc/os-release + case $ID in + debian|ubuntu|devuan) + sudo apt-get install flex bison phantomjs + ;; + centos|fedora|rhel) + yumdnf="yum" + if test "$(echo "$VERSION_ID >= 22" | bc)" -ne 0; + then + yumdnf="dnf" + fi + sudo $yumdnf install -y flex bison phantomjs + ;; + *) + exit 1 + ;; + esac +else + echo "Other OS: ${OS}" +fi + +SHELL_FOLDER=$(dirname "$0") +pip3 install -r $SHELL_FOLDER/requirements.txt \ No newline at end of file