changeset 77:0f2536ae968f

wokkel: new "installed" boolean, set to True when patches are applied
author Goffi <goffi@goffi.org>
date Wed, 14 Apr 2021 14:07:02 +0200
parents 67508db07ea0
children 8959519f9066
files sat_tmp/wokkel/__init__.py
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/sat_tmp/wokkel/__init__.py	Thu Mar 18 22:34:35 2021 +0100
+++ b/sat_tmp/wokkel/__init__.py	Wed Apr 14 14:07:02 2021 +0200
@@ -17,14 +17,18 @@
 # 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/>.
 
+installed = False
 
 def install():
     """Monkey patch Wokkel to have improvments implemented here"""
-    from twisted.python import compat
-    compat._PY3 = True
-    import wokkel
-    from . import pubsub, rsm, mam, data_form
-    wokkel.pubsub = pubsub
-    wokkel.rsm = rsm
-    wokkel.mam = mam
-    data_form.install()
+    global installed
+    if not installed:
+        from twisted.python import compat
+        compat._PY3 = True
+        import wokkel
+        from . import pubsub, rsm, mam, data_form
+        wokkel.pubsub = pubsub
+        wokkel.rsm = rsm
+        wokkel.mam = mam
+        data_form.install()
+        installed = True