Mercurial > libervia-backend
changeset 3495:6f7486683e20
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)
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 14 Apr 2021 14:09:50 +0200 |
parents | b5bed164dce0 |
children | c018c510a562 |
files | sat/__init__.py |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/__init__.py Thu Apr 01 13:57:20 2021 +0200 +++ b/sat/__init__.py Wed Apr 14 14:09:50 2021 +0200 @@ -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 <http://www.gnu.org/licenses/>. 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()