Replace get_versions() calls with octoprint.server.VERSION, to get some time improvment
This commit is contained in:
1 parent
8a7d234571
commit
e8bd29ef99
2 files changed
+8
-11
No files matched your search
@@ -11,7 +11,7 @@ import octoprint.plugin.core
|
||||
|
||||
from octoprint.settings import valid_boolean_trues
|
||||
from octoprint.server.util.flask import restricted_access
|
||||
from octoprint.server import admin_permission
|
||||
from octoprint.server import admin_permission, VERSION
|
||||
from octoprint.util.pip import PipCaller, UnknownPip
|
||||
|
||||
from flask import jsonify, make_response
|
||||
@@ -184,7 +184,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
plugins=self._repository_plugins
|
||||
),
|
||||
os=self._get_os(),
|
||||
octoprint=self._get_octoprint_version(),
|
||||
octoprint=VERSION,
|
||||
pip=dict(
|
||||
available=self._pip_caller.available,
|
||||
command=self._pip_caller.command,
|
||||
@@ -612,8 +612,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
return "unknown"
|
||||
|
||||
def _get_octoprint_version(self):
|
||||
from octoprint._version import get_versions
|
||||
return get_versions()["version"]
|
||||
return VERSION
|
||||
|
||||
def _to_external_representation(self, plugin):
|
||||
return dict(
|
||||
|
||||
Reference in new issue
Block a user