Repository: PokemonGoF/PokemonGo-Bot

Issue:
evolve_captured in config.json does not use the specified evolve list
### Expected Behavior

Bot also checks against list of pokemon to evolve
### Actual Behavior

Bot only using `pokemon_to_transfer`
### Steps to Reproduce

Bot captures pokemon and evolves
### Other Information

OS: 
Git Commit: `db5b719dba2faebf9401b929811d0308e2561317`

Excerpt from `config.json`
`"evolve_all": "Pidgey,Weedle,Rattata,Caterpie,Geodude,Ekans,Zubat",`
Log:

```
[22:53:57] Found fort 5420f52faf294cdcbba72166743ef45b.16 at distance 0.02km
[22:53:57] Need to move closer to Pokestop
[                                        ] 0%[22:54:01] Something rustles nearby!
[22:54:01] A Wild Sandshrew appeared! [CP 290] [Potential 0.53]
[22:54:01] IV [Stamina/Attack/Defense] = [15/2/7]
[22:54:05] Using Pokeball (chance: 38.66%)... (0 left!)
[22:54:06] Captured Sandshrew! [CP 290] [15/2/7]
[22:54:06] Sandshrew has been evolved!
```



Discussion:

Resolving patch:
diff --git a/pokecli.py b/pokecli.py
--- a/pokecli.py
+++ b/pokecli.py
@@ -267,9 +267,9 @@ def init_config():
         load,
         short_flag="-ec",
         long_flag="--evolve_captured",
-        help="(Ad-hoc mode) Bot will attempt to evolve all the pokemon captured!",
-        type=bool,
-        default=False
+        help="(Ad-hoc mode) Pass \"all\" or a list of pokemon to evolve (e.g., \"Pidgey,Weedle,Caterpie\"). Bot will attempt to evolve all the pokemon captured!",
+        type=str,
+        default=[]
     )
     add_config(
         parser,
@@ -342,6 +342,13 @@ def init_config():
             ' Set these to true or false and remove "mode" from your configuration')
         return None
 
+    if (config.evolve_captured
+        and (not isinstance(config.evolve_captured, str)
+             or str(config.evolve_captured).lower() in ["true", "false"])):
+        parser.error('"evolve_captured" should be list of pokemons: use "all" or "none" to match all ' +
+                     'or none of the pokemons, or use a comma separated list such as "Pidgey,Weedle,Caterpie"')
+        return None
+
     if not (config.location or config.location_cache):
         parser.error("Needs either --use-location-cache or --location.")
         return None
@@ -355,6 +362,8 @@ def init_config():
 
     if config.evolve_all and isinstance(config.evolve_all, str):
         config.evolve_all = [str(pokemon_name) for pokemon_name in config.evolve_all.split(',')]
+    if config.evolve_captured and isinstance(config.evolve_captured, str):
+        config.evolve_captured = [str(pokemon_name) for pokemon_name in config.evolve_captured.split(',')]
 
     return config
 
diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py
--- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py
+++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py
@@ -179,7 +179,9 @@ def work(self):
                                         iv_display
                                     ), 'blue')
 
-                                    if self.config.evolve_captured:
+                                    if (self.config.evolve_captured
+                                        and (self.config.evolve_captured[0] == 'all'
+                                             or pokemon_name in self.config.evolve_captured)):
                                         id_list2 = self.count_pokemon_inventory()
                                         # No need to capture this even for metrics, player stats includes it.
                                         pokemon_to_transfer = list(Set(id_list2) - Set(id_list1))


Test patch: