Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

兼容Python3的输出 #1301

Open
wants to merge 2 commits 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
2 changes: 2 additions & 0 deletions cobra/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
29 changes: 29 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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