MCPcopy Index your code
hub / github.com/pyload/pyload / update_plugins

Method update_plugins

module/plugins/hooks/UpdateManager.py:190–221  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188
189 @Expose
190 def update_plugins(self):
191 server_data = self.server_response()
192
193 if not server_data or server_data[0] != self.pyload.api.getServerVersion():
194 return 0
195
196 updated = self._update_plugins(server_data)
197
198 if updated:
199 self.log_info(_("*** Plugins updated ***"))
200
201 if self.pyload.pluginManager.reloadPlugins(updated):
202 exitcode = 1
203 else:
204 self.log_warning(_("You have to restart pyLoad to use the updated plugins"))
205 self.info['plugins'] = True
206 exitcode = 2
207
208 paused = self.pyload.threadManager.pause
209 self.pyload.api.pauseServer()
210 self.manager.dispatchEvent("plugin_updated", updated)
211 if not paused:
212 self.pyload.api.unpauseServer()
213 else:
214 self.log_info(_("All plugins are up to date!"))
215 exitcode = 0
216
217 #: Exit codes:
218 #: 0 = No plugin updated
219 #: 1 = Plugins updated
220 #: 2 = Plugins updated, but restart required
221 return exitcode
222
223 def parse_updates(self, server_data):
224 schema = server_data[2].split('|')

Callers 1

_updateMethod · 0.95

Calls 10

server_responseMethod · 0.95
_update_pluginsMethod · 0.95
log_infoMethod · 0.80
reloadPluginsMethod · 0.80
log_warningMethod · 0.80
dispatchEventMethod · 0.80
_Function · 0.50
getServerVersionMethod · 0.45
pauseServerMethod · 0.45
unpauseServerMethod · 0.45

Tested by

no test coverage detected