| 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']) |