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

use strip instead of replace for names with spaces #5447

Merged
merged 1 commit into from
Sep 15, 2016
Merged

use strip instead of replace for names with spaces #5447

merged 1 commit into from
Sep 15, 2016

Conversation

ChaosMarc
Copy link
Contributor

@ChaosMarc ChaosMarc commented Sep 15, 2016

once again because my pull request is now at PokemonGo-Bot-Backup.

The configuration of evolve_list and donot_evolve_list doesn't work for "Nidoran F" and "Nidoran M" because when splitting the commaseparated string to an array their names are completely stripped of whitespaces with .replace(" ", "") leading to "NidoranF" and "NidoranM". To prevent this .strip() should be used to trim only leading and trailing whitespaces.

see DeXtroTip's comment:

Before, it was using strip() and then someone said it didn't work because "Nidoran F" and "Nidoran M" names in bot are stored as "NidoranF" and "NidoranM", that's why it was change to replace().
EDIT - I've checked and the bot actually stores the names as "Nidoran F" and "Nidoran M" so it should simply use strip() and not replace()

@mention-bot
Copy link

@ChaosMarc, thanks for your PR! By analyzing the annotation information on this pull request, we identified @Gobberwart, @achretien and @alexyaoyang to be potential reviewers

@solderzzc
Copy link
Contributor

Why all checks have passed, but the status is still yellow(Required statuses must pass before merging)

@solderzzc solderzzc closed this Sep 15, 2016
@solderzzc solderzzc reopened this Sep 15, 2016
@solderzzc solderzzc closed this Sep 15, 2016
@solderzzc solderzzc reopened this Sep 15, 2016
@Gobberwart
Copy link
Contributor

No. Replace was used specifically for Nidoran M/F which was being represented as NidoranM NidoranF (no spaces). If you change this, something will break. Give me a minute to get the specifics. Please do not merge!

@Gobberwart
Copy link
Contributor

Here is the PR where strip was changed to replace #5256
And here's the issue it addressed: #5239

The bot was unable to match Nidoran M/Nidoran F. Changing to replace allowed it to match NidoranM/NidoranF. Changing back to strip may reintroduce this issue (although it may have been fixed elsewhere since PR #5256)

@Gobberwart
Copy link
Contributor

OK, checked and someone has corrected the way pokemon names are stored in inventory, so this can now be reverted to strip.

@alexyaoyang
Copy link
Contributor

alexyaoyang commented Sep 15, 2016

👍

Approved with PullApprove

@alexyaoyang alexyaoyang merged commit 92519d4 into PokemonGoF:dev Sep 15, 2016
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.

6 participants