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

Fixed tab/space issue and optimized imports #860

Merged
merged 2 commits into from
Jul 25, 2016
Merged
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
15 changes: 6 additions & 9 deletions pokecli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@
Author: tjado <https://github.com/tejado>
"""

import os
import re
import json
import argparse
import time
import codecs
import json
import logging
import os
import ssl
import sys
import codecs
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
from pokemongo_bot import logger

if sys.version_info >= (2, 7, 9):
ssl._create_default_https_context = ssl._create_unverified_context
Expand Down
23 changes: 11 additions & 12 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# -*- coding: utf-8 -*-

import logging
import googlemaps
import datetime
import json
import logging
import random
import threading
import time
import datetime
import sys
import logger
import re
import sys
import time

from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from pgoapi.utilities import f2i, h2f
from pgoapi.utilities import f2i

import logger
from cell_workers import PokemonCatchWorker, SeenFortWorker, MoveToFortWorker, InitialTransferWorker, EvolveAllWorker
from cell_workers.utils import distance, get_cellid, encode
from human_behaviour import sleep
from spiral_navigator import SpiralNavigator
from geopy.geocoders import GoogleV3
from math import radians, sqrt, sin, cos, atan2
from item_list import Item
from spiral_navigator import SpiralNavigator


class PokemonGoBot(object):
Expand Down Expand Up @@ -184,7 +183,7 @@ def work_on_cell(self, cell, position):
forts = [fort
for fort in cell['forts']
if 'latitude' in fort and 'type' in fort]
gyms = [gym for gym in cell['forts'] if 'gym_points' in gym]
gyms = [gym for gym in cell['forts'] if 'gym_points' in gym]

# Sort all by distance from current pos- eventually this should
# build graph & A* it
Expand Down
7 changes: 4 additions & 3 deletions pokemongo_bot/cell_workers/evolve_all_worker.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from utils import distance, format_dist
from pokemongo_bot.human_behaviour import sleep
from pokemongo_bot import logger
from sets import Set

from pokemongo_bot import logger
from pokemongo_bot.human_behaviour import sleep


class EvolveAllWorker(object):
def __init__(self, bot):
self.api = bot.api
Expand Down
5 changes: 3 additions & 2 deletions pokemongo_bot/cell_workers/pokemon_catch_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import time
from sets import Set
from utils import distance
from pokemongo_bot.human_behaviour import sleep

from pokemongo_bot import logger
from pokemongo_bot.human_behaviour import sleep


class PokemonCatchWorker(object):
BAG_FULL = 'bag_full'
Expand Down
10 changes: 5 additions & 5 deletions pokemongo_bot/cell_workers/seen_fort_worker.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-

import json
import time
from math import radians, sqrt, sin, cos, atan2
from pgoapi.utilities import f2i, h2f
from utils import print_green, print_yellow, print_red, format_time
from pokemongo_bot.human_behaviour import sleep

from pgoapi.utilities import f2i

from pokemongo_bot import logger
from pokemongo_bot.human_behaviour import sleep
from utils import format_time


class SeenFortWorker(object):
Expand Down
10 changes: 6 additions & 4 deletions pokemongo_bot/polyline_stepper.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# -*- coding: utf-8 -*-
from polyline_walker import PolylineWalker
from stepper import Stepper
from math import ceil
from human_behaviour import sleep
from cell_workers.utils import i2f

from stepper import Stepper

import logger
from cell_workers.utils import i2f
from human_behaviour import sleep
from polyline_walker import PolylineWalker


class PolylineStepper(Stepper):

Expand Down
5 changes: 4 additions & 1 deletion pokemongo_bot/polyline_walker/polyline_tester.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import time
from math import ceil

import haversine
import polyline
from math import ceil

from polyline_walker import PolylineWalker

a = PolylineWalker('Poststrasse+20,Zug,CH', 'Guggiweg+7,Zug,CH', 100)
print('Walking polyline: ', a.polyline)
print('Encoded level: ','B'*len(a.points))
Expand Down
10 changes: 6 additions & 4 deletions pokemongo_bot/polyline_walker/polyline_walker.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import requests
import polyline
import haversine
import time
from itertools import chain
from itertools import chain
from math import ceil

import haversine
import polyline
import requests


class PolylineWalker(object):

def __init__(self, origin, destination, speed):
Expand Down
18 changes: 3 additions & 15 deletions pokemongo_bot/spiral_navigator.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
# -*- coding: utf-8 -*-

import os
import json
import time
import pprint

from math import ceil
from s2sphere import CellId, LatLng
from google.protobuf.internal import encoder

from human_behaviour import sleep, random_lat_long_delta
from cell_workers.utils import distance, i2f, format_time, format_dist
from step_walker import StepWalker

from pgoapi.utilities import f2i, h2f
import logger
from cell_workers.utils import distance, i2f, format_dist
from human_behaviour import sleep
from step_walker import StepWalker


class SpiralNavigator(object):
Expand Down
5 changes: 2 additions & 3 deletions pokemongo_bot/step_walker.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logger
from math import sqrt

from cell_workers.utils import distance, i2f, format_time, format_dist
from cell_workers.utils import distance, i2f
from human_behaviour import random_lat_long_delta, sleep
from math import ceil, sqrt


class StepWalker(object):
Expand Down