SWU: New version checkers for debugging

* always_current: Always reports as current
  * never_current: Always reports as needing an update
This commit is contained in:
Gina Häußge committed 2018-02-12 14:39:58 +01:00
1 parent 6812001639
commit 87921061d9
4 files changed
+39 -1

No files matched your search

+11
View File
@@ -213,6 +213,17 @@ Version checks
information and whether the current version is up-to-date or not, see
below for details.
* ``always_current``: Always reports that no update is necessary. Useful for debugging
software update mechanisms during development. Additional config parameters:
* ``current_version``: Version to report for both local and remote version.
* ``never_current``: Always reports that an update is necessary. Useful for debugging
software update mechanisms during development. Additional config parameters:
* ``local_version``: Current local version. Defaults to ``1.0.0``.
* ``remote_version``: Remote version to offer update to. Defaults to ``1.0.1``.
.. _sec-bundledplugins-softwareupdate-configuration-updatemethods:
Update methods
@@ -5,7 +5,7 @@ __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
from . import commandline, git_commit, github_commit, github_release, bitbucket_commit, python_checker
from . import commandline, git_commit, github_commit, github_release, bitbucket_commit, python_checker, never_current, always_current
def log_github_ratelimit(logger, r):
ratelimit = r.headers["X-RateLimit-Limit"] if "X-RateLimit-Limit" in r.headers else "?"
@@ -0,0 +1,13 @@
# coding=utf-8
from __future__ import absolute_import, division, print_function
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License"
def get_latest(target, check, online=True):
current_version = check.get("current_version", "1.0.0")
information = dict(local=dict(name=current_version, value=current_version),
remote=dict(name=current_version, value=current_version))
return information, True
@@ -0,0 +1,14 @@
# coding=utf-8
from __future__ import absolute_import, division, print_function
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License"
def get_latest(target, check, online=True):
local_version = check.get("local_version", "1.0.0")
remote_version = check.get("remote_version", "1.0.1")
information = dict(local=dict(name=local_version, value=local_version),
remote=dict(name=remote_version, value=remote_version))
return information, False