MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / is_already_installed

Method is_already_installed

pokemongo_bot/plugin_loader.py:89–105  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

87 return full_path
88
89 def is_already_installed(self):
90 file_path = self.get_plugin_folder()
91 if not os.path.isdir(file_path):
92 return False
93
94 sha_file = os.path.join(file_path, '.sha')
95
96 if not os.path.isfile(sha_file):
97 return False
98
99 with open(sha_file) as file:
100 content = file.read().strip()
101
102 if content != self.plugin_parts['sha']:
103 return False
104
105 return True
106
107 def get_plugin_folder(self):
108 folder_name = '{}_{}'.format(self.plugin_parts['user'], self.plugin_parts['repo'])

Calls 2

get_plugin_folderMethod · 0.95
readMethod · 0.80