-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
new PolylineWalker(StepWalker) #990
Changes from all commits
e1bb9b7
f19e601
3f4e65f
9d565bb
31d0dd6
682aeae
e27fa7c
6f2e74f
510c0d8
8eb7f89
1e67264
4c81f7e
b27de0c
075c9f4
5e9e7ae
fde0bf4
7f79c3f
db93a93
b16e65b
afcae3d
24bb7fb
1f53ed4
3bb2f56
f6efe4e
3521aa3
25ebe8c
3c4bb9d
bb303be
6b503c7
f597e02
f899961
aeea53a
c353fb7
063dc19
c95efce
94ace2c
46b0d6d
55f09db
990502d
746a475
8365244
9954930
a788476
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[MESSAGES CONTROL] | ||
disable=line-too-long, | ||
missing-docstring | ||
missing-docstring | ||
|
||
[TYPECHECK] | ||
ignored-modules=distutils,distutils.core | ||
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from polyline_generator import Polyline | ||
from polyline_walker import PolylineWalker | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from polyline_generator import Polyline | ||
from math import ceil | ||
from ..human_behaviour import sleep | ||
from ..cell_workers.utils import i2f | ||
from pokemongo_bot.step_walker import StepWalker | ||
from pokemongo_bot import logger | ||
|
||
class PolylineWalker(StepWalker): | ||
|
||
def __init__(self, bot, speed, initLat, initLng, destLat, destLng): | ||
super(PolylineWalker, self).__init__(bot, speed, initLat, initLng, destLat, destLng) | ||
self.polyline_walker = Polyline((i2f(self.api._position_lat), i2f(self.api._position_lng)), | ||
(self.destLat, self.destLng), self.speed) | ||
logger.log('[#] {}'.format(self.polyline_walker.URL)) | ||
|
||
def step(self): | ||
self.polyline_walker.unpause() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems fishy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why doesn't this just call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And how does it behave if position changed in between steps? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nvm. I understand better now. I read the code a little bit deeper. :) |
||
sleep(1) | ||
self.polyline_walker.pause() | ||
cLat, cLng = self.polyline_walker.get_pos()[0] | ||
self.api.set_position(round(cLat, 5), round(cLng, 5), 0) | ||
self.bot.heartbeat() | ||
if self.destLat == cLat and self.destLng == cLng: | ||
return True |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
-e git+https://github.com/tejado/pgoapi.git#egg=pgoapi | ||
geopy==1.11.0 | ||
distribute==0.7.3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. trying to get travis build working, distribute==0.0 (req protobuffer) not available on travis |
||
protobuf==3.0.0b4 | ||
requests==2.10.0 | ||
s2sphere==0.2.4 | ||
|
@@ -11,3 +12,4 @@ enum34==1.1.6 | |
pyyaml==3.11 | ||
haversine==0.4.5 | ||
polyline==1.3.1 | ||
pysmbus==0.1.post3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. someone on lcd.py forgot to include the pysmus module in requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pylint running on travis inside virtualenv has issues with the setup.py file not being able to import distils.core pylint-dev/pylint#73