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

Method _update

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

Source from the content-addressed store, hash-verified

158 self.do_restart = True
159
160 def _update(self):
161 newversion = self.server_response(0)
162
163 self.info['pyload'] = False
164 self.info['last_check'] = time.time()
165
166 if not newversion:
167 exitcode = 0
168
169 elif newversion == self.pyload.api.getServerVersion():
170 self.log_info(_("pyLoad is up to date!"))
171 exitcode = self.update_plugins()
172
173 elif re.search(r'^\d+(?:\.\d+){0,3}[a-z]?$', newversion):
174 self.log_info(_("*** New pyLoad %s available ***") % newversion)
175 self.log_info(_("*** Get it here: https://github.com/pyload/pyload/releases ***"))
176 self.info['pyload'] = True
177 exitcode = 3
178
179 else:
180 exitcode = 0
181
182 #: Exit codes:
183 #: -1 = No plugin updated, new pyLoad version available
184 #: 0 = No plugin updated
185 #: 1 = Plugins updated
186 #: 2 = Plugins updated, but restart required
187 return exitcode
188
189 @Expose
190 def update_plugins(self):

Callers 1

updateMethod · 0.95

Calls 6

server_responseMethod · 0.95
update_pluginsMethod · 0.95
log_infoMethod · 0.80
_Function · 0.50
getServerVersionMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected