From b186f74b17285e99a5bdb92e0dfaba3bda2aec3d Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 14 Apr 2021 14:09:50 +0200 Subject: [PATCH] core: apply wokkel patches if they are not already: this case may happen if a sat module is used without the backend being launched (e.g. in tests) --- sat/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sat/__init__.py b/sat/__init__.py index 306ef9ae..f212cb67 100644 --- a/sat/__init__.py +++ b/sat/__init__.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 - # Libervia: an XMPP client # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org) @@ -17,11 +16,12 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . import os.path +from sat_tmp import wokkel version_file = os.path.join(os.path.dirname(__file__), "VERSION") -try: - with open(version_file) as f: - __version__ = f.read().strip() -except NotImplementedError: - # pyjamas workaround - __version__ = "0.7.0D" +with open(version_file) as f: + __version__ = f.read().strip() + +if not wokkel.installed: + print("installing Wokkel patches") + wokkel.install()