From 185823b76f9af91f54f8face62fd5db7f923f055 Mon Sep 17 00:00:00 2001 From: Grace Date: Mon, 25 Jul 2016 23:54:43 -0400 Subject: [PATCH 1/2] Fixed a bug where the bot crashed if 'catch' or 'release' wasn't specified in config.json --- pokecli.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pokecli.py b/pokecli.py index 9a22a9f819..a3b3b1b452 100755 --- a/pokecli.py +++ b/pokecli.py @@ -160,8 +160,12 @@ def init_config(): for key in config.__dict__: if key in load: config.__dict__[key] = load[key] - config.catch = load['catch'] - config.release = load['release'] + + if 'catch' in load: + config.catch = load['catch'] + + if 'release' in load: + config.release = load['release'] if config.auth_service not in ['ptc', 'google']: logging.error("Invalid Auth service specified! ('ptc' or 'google')") From 39daf062e7bb509bc80bc1d75cd2fdacefb3a205 Mon Sep 17 00:00:00 2001 From: Grace Date: Mon, 25 Jul 2016 23:55:36 -0400 Subject: [PATCH 2/2] Added install.sh and run.sh --- install.sh | 19 +++++++++++++++++++ run.sh | 5 +++++ 2 files changed, 24 insertions(+) create mode 100755 install.sh create mode 100755 run.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000..c11992bb0c --- /dev/null +++ b/install.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Setup Python virtualenv +echo "Setting up Python virtualenv..." +eval "virtualenv ." +eval "source bin/activate" +echo "Python virtualenv setup successfully." + +# Install pip requirements +echo "Installing pip requirements..." +eval "pip install -r requirements.txt" +echo "Installed pip requirements." +echo "Installing and updating git submodules..." + +# Install git submodules +eval "cd ./web && git submodule init && cd .." +eval "git submodule update" +echo "Done." +echo "Please create and setup configs/config.json. Then, run 'python pokecli.py --config ./configs/config.json' or './run.sh' on Mac/Linux" \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 0000000000..de2a09699b --- /dev/null +++ b/run.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Assumes the config file is created and named config.json +# Starts PokemonGo-Bot +eval "python pokecli.py --config ./configs/config.json" \ No newline at end of file