Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing some linter rules #624

Merged
merged 1 commit into from
Jul 24, 2016
Merged
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
28 changes: 14 additions & 14 deletions pokecli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
import os
import re
import json
import requests
import argparse
import time
import ssl
import logging
import sys
import codecs
from pokemongo_bot import logger
if sys.version_info >= (2, 7, 9):
ssl._create_default_https_context = ssl._create_unverified_context

from getpass import getpass
import logging
import requests
from pokemongo_bot import logger
from pokemongo_bot import PokemonGoBot
from pokemongo_bot.cell_workers.utils import print_green, print_yellow, print_red

if sys.version_info >= (2, 7, 9):
ssl._create_default_https_context = ssl._create_unverified_context


def init_config():
parser = argparse.ArgumentParser()
Expand All @@ -54,7 +54,7 @@ def init_config():

# Select a config file code
parser.add_argument("-cf", "--config", help="Config File to use")
config_arg =unicode(parser.parse_args().config)
config_arg = unicode(parser.parse_args().config)
if os.path.isfile(config_arg):
with open(config_arg) as data:
load.update(json.load(data))
Expand Down Expand Up @@ -124,7 +124,7 @@ def init_config():
"Set the unit to display distance in (e.g, km for kilometers, mi for miles, ft for feet)",
type=str,
default="km")

parser.add_argument(
"-if",
"--item_filter",
Expand All @@ -138,17 +138,17 @@ def init_config():
help="Bot will start by attempting to evolve all pokemons. Great after popping a lucky egg!",
type=bool,
default=False)

parser.add_argument("-ec",
"--evolve_captured",
help="Bot will attempt to evolve all the pokemons captured!",
type=bool,
default=False)

config = parser.parse_args()
if not config.username and not 'username' in load:
if not config.username and 'username' not in load:
config.username = raw_input("Username: ")
if not config.password and not 'password' in load:
if not config.password and 'password' not in load:
config.password = getpass("Password: ")

# Passed in arguments should trump
Expand All @@ -166,12 +166,12 @@ def init_config():

if config.item_filter:
config.item_filter = [str(item_id) for item_id in config.item_filter.split(',')]

config.release_config = {}
if os.path.isfile(release_config_json):
with open(release_config_json) as data:
config.release_config.update(json.load(data))

if config.gmapkey:
find_url = 'https:\/\/maps.googleapis.com\/maps\/api\/js\?key=\S*'
replace_url = "https://maps.googleapis.com/maps/api/js?key=%s&callback=initMap\""
Expand Down Expand Up @@ -206,7 +206,7 @@ def main():

logger.log('[x] Starting PokemonGo Bot....', 'green')

while (True):
while True:
bot.take_step()

except KeyboardInterrupt:
Expand Down