[PATCH 09 of 52 Narval cube] [new style] use new style for cube import (2)

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 11:34:09 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585414974 0
#      Sat Mar 28 17:02:54 2020 +0000
# Node ID 9098ea9f43c630de9e664d3d46fd4e6e709567a7
# Parent  c51b1029cd9cabe2c8b41aef5dcc3202ae7e16e7
[new style] use new style for cube import (2)

diff --git a/bin/narval b/bin/narval
--- a/bin/narval
+++ b/bin/narval
@@ -2,11 +2,9 @@
 import sys
 import os, os.path as osp
 
-try:
-    import narvalbot
-except:
-    from cubes.narval import narvalbot
-    sys.modules['narvalbot'] = narvalbot
+
+from cubicweb_narval import narvalbot
+sys.modules['narvalbot'] = narvalbot
 
 if narvalbot.MODE == 'dev':
     # we are running from sources, cubicweb *should* be available,
diff --git a/cubicweb_narval/narvalbot/__init__.py b/cubicweb_narval/narvalbot/__init__.py
--- a/cubicweb_narval/narvalbot/__init__.py
+++ b/cubicweb_narval/narvalbot/__init__.py
@@ -38,7 +38,7 @@
 
 NARVAL_SOFTWARE_ROOT = __path__[0]
 
-if 'cubes.narval' in __name__:
+if 'cubicweb_narval' in __name__:
     MODE = 'dev'
 else:
     MODE = 'installed'
diff --git a/cubicweb_narval/testutils.py b/cubicweb_narval/testutils.py
--- a/cubicweb_narval/testutils.py
+++ b/cubicweb_narval/testutils.py
@@ -27,10 +27,8 @@
 
 from cubicweb.devtools.testlib import CubicWebTC
 
-try:
-    import narvalbot
-except:
-    from cubes.narval import narvalbot
+from cubicweb_narval import narvalbot
+
 sys.modules['narvalbot'] = narvalbot
 
 import narvalbot as bot




More information about the cubicweb-devel mailing list