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

Fixing ITEM_FILTER and Attribute Error: no position Issues #638

Merged
merged 10 commits into from
Jul 25, 2016

Conversation

dmateusp
Copy link
Contributor

@dmateusp dmateusp commented Jul 24, 2016

Fixes:

  • lots of users were using the syntax "101,102,103" instead of the correct syntax ["101","102","103"]
  • a commit changed the correct syntax to the string syntax without changing the logic which made item_filter throw every item away
  • I changed the logic to accept both syntaxes in a "correct" way now
  • fixed character escaping in the README
  • fixed a new issue that was preventing cached_location from being used when an initial location was given

Please note that I implemented this feature so my commit is more relevant than other fixes that do not understand the code

@solderzzc
Copy link
Contributor

we won't, we need fix CI error first.

@dmateusp
Copy link
Contributor Author

Now working @solderzzc just notifying, I know you need to fix CI errors first

@@ -163,7 +163,7 @@ This project uses Google Maps. There's one map coupled with the project, but as
-it, --initial_transfer Transfer all duplicate pokemon with same ID on bot start, except pokemon with highest CP. Accepts a number to prevent transferring pokemon with a CP above the provided value. Default is 0 (aka transfer none).
-ms, --max_steps MAX_STEP Set the steps around your initial location (DEFAULT 5 mean 25 cells around your location)
-iv IV, --pokemon_potential Set the ratio for the IV values to transfer (DEFAULT 0.4 eg. 0.4 will transfer a pokemon with IV 0.3)
-if LIST, --item_filter LIST Pass a list of unwanted items to recycle when collected at a Pokestop (e.g, \"101,102,103,104\" to recycle potions when collected)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can not keep changing the config.json format time by time... It's huge work to solve users question in slack help channel.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not changing it, people were still using it both ways, but one way was causing unexpected behavior

@dmateusp
Copy link
Contributor Author

@solderzzc Here you go :) down to 2 commits, I tested it earlier but can't test it now as dev branch is unstable. The changes don't change the way arguments work, it just corrects unwanted behavior for users that misunderstood how to use the feature

@dmateusp dmateusp changed the title Fixing ITEM_FILTER Issues Fixing ITEM_FILTER and Attribute Error: no position Issues Jul 24, 2016
@solderzzc
Copy link
Contributor

Will it break current users' configuration ? If so, need add it to the breaking thing in README.

@dmateusp
Copy link
Contributor Author

@solderzzc it won't, see the initial configuration was ["101","102","103","104"] as an example to filter out potions, but people used it as "101,102,103,104" but the app would still run and filter out everything. So I just changed the logic so both syntaxes are now correct and have the expected behavior

else:
pass
sys.exit(
"No cached Location. Please specify initial location.")

def _get_pos_by_name(self, location_name):
# Check if the given location is already a coordinate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release_config.json.example → release_config.json
This should not be tracked.

Invitation sent, please join our team.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are more than welcome.

@solderzzc solderzzc merged commit 6d82f70 into PokemonGoF:dev Jul 25, 2016
MFizz pushed a commit to MFizz/PokemonGo-Bot that referenced this pull request Jul 29, 2016
…F#638)

* FIXING filter_item issues

* FIXING filter_item issues

* FIXING filter_item issues

* FIXING filter_item issues

* fixing no position Attribute found

* Fixing Filter_item issues, and no attribute position

* Delete release_config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants