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)
This commit is contained in:
Goffi 2021-04-14 14:09:50 +02:00
commit b186f74b17

View file

@ -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()