From ba9e9b3d8f17f20847956cb8d08c2126ec7d7c88 Mon Sep 17 00:00:00 2001 From: LazoCoder Date: Mon, 3 Jul 2017 20:57:08 -0400 Subject: [PATCH 1/2] Fixed "AttributeError: 'ITerm' object has no attribute 'set_pokemon'" Traceback (most recent call last): File "./pokemon", line 298, in main(sys.argv) File "./pokemon", line 288, in main single_argument_handler(argv[1].lower(), ESCAPE_CODE) File "./pokemon", line 270, in single_argument_handler change_terminal_background(db, arg) File "./pokemon", line 123, in change_terminal_background scripter.change_terminal(pokemon.get_path()) File "/Users/Laki/Documents/GitHub/Pokemon-Terminal/scripter.py", line 41, in change_terminal adapter.set_pokemon(image_file_path) AttributeError: 'ITerm' object has no attribute 'set_pokemon' --- scripter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripter.py b/scripter.py index 9f9c407..5814234 100644 --- a/scripter.py +++ b/scripter.py @@ -38,7 +38,7 @@ def clear_terminal(): def change_terminal(image_file_path): adapter = identify() - adapter.set_pokemon(image_file_path) + adapter.set_image_file_path(image_file_path) def change_wallpaper(image_file_path): From ca89626afa24214f2d7fb77dbf5367918bd52762 Mon Sep 17 00:00:00 2001 From: LazoCoder Date: Mon, 3 Jul 2017 21:01:12 -0400 Subject: [PATCH 2/2] Fixed light/dark bug Traceback (most recent call last): File "./pokemon", line 298, in main(sys.argv) File "./pokemon", line 288, in main single_argument_handler(argv[1].lower(), ESCAPE_CODE) File "./pokemon", line 240, in single_argument_handler change_terminal_background(db, db.get_light().get_name()) AttributeError: 'str' object has no attribute 'get_name' --- database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database.py b/database.py index a4d8783..6b1bd45 100644 --- a/database.py +++ b/database.py @@ -130,12 +130,12 @@ class Database: def get_light(self, threshold=0.4, all_pkmn=False): light = [pokemon.get_name() for pokemon in self.__pokemon_list if pokemon.get_dark_threshold() > threshold] - return light if all_pkmn else random.choice(light) + return light if all_pkmn else self.get_pokemon(random.choice(light)) def get_dark(self, threshold=0.6, all_pkmn=False): dark = [pokemon.get_name() for pokemon in self.__pokemon_list if pokemon.get_dark_threshold() < threshold] - return dark if all_pkmn else random.choice(dark) + return dark if all_pkmn else self.get_pokemon(random.choice(dark)) def __get_region(self, region): # Helper method for getting all the Pokemon of a specified region.