MCPcopy Index your code
hub / github.com/PokemonGoF/PokemonGo-Bot / extract

Method extract

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

Source from the content-addressed store, hash-verified

121 self.extract()
122
123 def extract(self):
124 dest = self.get_plugin_folder()
125 with zipfile.ZipFile(self.get_local_destination(), "r") as z:
126 z.extractall(dest)
127
128 github_folder = os.path.join(dest, '{}-{}'.format(self.plugin_parts['repo'], self.plugin_parts['sha']))
129 new_folder = os.path.join(dest, '{}'.format(self.plugin_parts['repo']))
130 shutil.move(github_folder, new_folder)
131
132 with open(os.path.join(dest, '.sha'), 'w') as file:
133 file.write(self.plugin_parts['sha'])
134
135 os.remove(self.get_local_destination())
136
137 def download(self):
138 url = self.get_github_download_url()

Callers 2

installMethod · 0.95
test_extractMethod · 0.95

Calls 3

get_plugin_folderMethod · 0.95
get_local_destinationMethod · 0.95
removeMethod · 0.45

Tested by 1

test_extractMethod · 0.76