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

New Option: "dont_nickname_favorite" #2496

Merged
merged 6 commits into from
Aug 9, 2016
Merged
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions pokemongo_bot/cell_workers/nickname_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def work(self):
else:
pokemon_data = self._get_inventory_pokemon(inventory)
for pokemon in pokemon_data:
self._nickname_pokemon(pokemon)
if not(pokemon.get('favorite', 0) is 1 and self.config.get('dont_nickname_favorite','')):
Copy link
Contributor

Choose a reason for hiding this comment

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

since dont_nickname_favorite is a boolean, the get call should default to a boolean as well (False)

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, I changed it.

self._nickname_pokemon(pokemon)

def _get_inventory_pokemon(self,inventory_dict):
pokemon_data = []
Expand Down Expand Up @@ -84,4 +85,4 @@ def _nickname_pokemon(self,pokemon):
if result==1:
log_color='green'
pokemon['nickname'] = new_name
logger.log(output,log_color)
logger.log(output,log_color)