Simplify by getting rid of NoHookRQLObjectStore
authorDimitri Papadopoulos <dimitri.papadopoulos@cea.fr>
Mon, 06 May 2013 15:04:18 +0200
changeset 167 6b6a1bc931c5
parent 166 28ab358256e2
child 168 5502b8333b0a
Simplify by getting rid of NoHookRQLObjectStore Get rid of NoHookRQLObjectStore, only keep SQLGenObjectStore. The APIs of these two classes are inconsistent and this looks like a bug by itself. Unclutter our own code by keeping only the most recent and efficient of these two classes. SQLGenObjectStore requires CubicWeb 3.16.
__pkginfo__.py
importers/localizer.py
--- a/__pkginfo__.py	Mon May 06 14:51:11 2013 +0200
+++ b/__pkginfo__.py	Mon May 06 15:04:18 2013 +0200
@@ -13,15 +13,13 @@
 description = 'Cube for the Brainomics Project, see http://www.brainomics.net/'
 web = 'http://www.cubicweb.org/project/%s' % distname
 
-__depends__ =  {'cubicweb': '>= 3.15.1',
+__depends__ =  {'cubicweb': '>= 3.16.1',
                 'cubicweb-questionnaire': None,
                 'cubicweb-neuroimaging': None,
                 'cubicweb-genomics': None,
                 'cubicweb-medicalexp': None,
                 'cubicweb-orbui': None,
                 'cubicweb-card': None,
-                ## XXX No simplefacet for now
-                ##'cubicweb-simplefacet': None,
                 }
 __recommends__ = {}
 
--- a/importers/localizer.py	Mon May 06 14:51:11 2013 +0200
+++ b/importers/localizer.py	Mon May 06 15:04:18 2013 +0200
@@ -304,13 +304,9 @@
 ###############################################################################
 if __name__ == '__main__':
     # Create store
-    try:
-        from cubicweb.dataimport import SQLGenObjectStore as Store
-        sqlgen_store = True
-    except ImportError:
-        from cubicweb.dataimport import NoHookRQLObjectStore as Store
-        sqlgen_store = False
-    store = Store(session)
+    from cubicweb.dataimport import SQLGenObjectStore
+    store = SQLGenObjectStore(session)
+    sqlgen_store = True
 
     root_dir = osp.abspath(sys.argv[4])
     subjects_dir = osp.join(root_dir, 'subjects')