Lynn Rees avatar Lynn Rees committed 2403404

- fixes

Comments (0)

Files changed (15)

graphalchemy/apps.py

 
     class include(Branch):
         backends = 'graphalchemy.backends.apps'
-        direct = 'graphalchemy.direct.apps'
+        directs = 'graphalchemy.direct.apps'
         models = 'graphalchemy.models.apps'
 
     class session(Namespace):

graphalchemy/core.py

 extend = octopus.descriptor.extend
 factory = octopus.descriptor.factory
 method = octopus.descriptor.method
+reextend = octopus.descriptor.reextend
+refactory = octopus.descriptor.refactory

graphalchemy/direct/collectors.py

 
     '''direct link collections collector'''
 
-    _collection = app(conf.direct.collection.link, conf.direct)
+    _collection = app(conf.direct.collection.link, conf.directs)
 
 
 class Nodes(NodesMixin):
 
     '''direct nodes collections collector'''
 
-    _collection = app(conf.direct.collection.node, conf.direct)
+    _collection = app(conf.direct.collection.node, conf.directs)

graphalchemy/direct/elements.py

     '''graph object'''
 
     # direct links collection
-    _links = app(conf.direct.collector.link, conf.managers)
+    _links = app(conf.direct.collector.link, conf.directs)
 
     @staticmethod
     def _link():
     '''graph node object'''
 
     # direct node collection
-    _nodes = app(conf.direct.collector.node, conf.managers)
+    _nodes = app(conf.direct.collector.node, conf.directs)

graphalchemy/direct/workers.py

 
     # graph source
     _db = app(conf.key.backend, conf.userspace)
-    _model = app(conf.direct.element.link, conf.direct)
+    _model = app(conf.direct.element.link, conf.directs)
     # direct link reader
-    _r = factory(conf.readlink, backends, db)
+    _r = factory(conf.read.link, backends, db)
     # direct link writer
-    _w = factory(conf.writelink, backends, db)
+    _w = factory(conf.write.link, backends, db)
 
     ###########################################################################
     ## link write methods #####################################################
 
     '''direct graph node interface'''
 
-    _model = app(conf.direct.element.node, conf.direct)
+    _model = app(conf.direct.element.node, conf.directs)
     # direct node reader
-    _r = factory(conf.readnode, backends, db)
+    _r = factory(conf.read.node, backends, db)
     # direct node writer
-    _w = factory(conf.writenode, backends, db)
+    _w = factory(conf.write.node, backends, db)
 
     ###########################################################################
     ## node write methods #####################################################

graphalchemy/graphs.py

 
 from stuf.utils import clsname
 
-from graphalchemy.core import octopus, extend
+from graphalchemy.core import octopus, reextend
 
 __all__ = ['Graph']
 # settings
 
     '''graph interface'''
 
-    session = extend(conf.session, conf.appspace)
+    session = reextend(conf.session, conf.appspace)
 
     def __init__(self, url, **kw):
         '''

graphalchemy/models/collectors.py

     '''direction definition'''
 
     # model finder
-    _finder = app(conf.model.finder.node, conf.appspace)
+    _finder = app(conf.model.finder.node, conf.models)
     # node collection
     _nodes = app(conf.model.collection.node, conf.models)
 
     def __init__(self, model=None, kind=''):
         '''
+        init
+
         @param model: model with direction (default: None)
         @param link: link name
         '''

graphalchemy/models/elements.py

     '''node model'''
 
     # links collection
-    _links = app(conf.direct.collector.link, conf.managers)
+    _links = app(conf.direct.collector.link, conf.directs)
     # node collection
     _nodes = app(conf.model.collector.node, conf.models)
 

graphalchemy/models/finders.py

 
     '''node model finder'''
 
-    model = app(conf.direct.element.node, conf.managers)
+    model = app(conf.direct.element.node, conf.models)
 
     def __call__(self, model=None, element=None):
         '''

graphalchemy/models/readers.py

     '''graph node model reader'''
 
     # model finder
-    _finder = app(conf.model.finder.node, conf.appspace)
+    _finder = app(conf.model.finder.node, conf.models)
     # direct node reader
-    _r = factory(conf.readnode, backends, db)
+    _r = factory(conf.read.node, backends, db)
     # direct node writer
-    _w = factory(conf.writenode, backends, db)
+    _w = factory(conf.write.node, backends, db)
 
     def __init__(self, model):
         '''

graphalchemy/models/workers.py

     # graph source
     _db = app(conf.key.backend, conf.userspace)
     # model finder
-    _finder = app(conf.model.finder.node, conf.appspace)
+    _finder = app(conf.model.finder.node, conf.models)
     # model query
-    _query = app(conf.model.node.reader, conf.appspace)
+    _query = app(conf.model.reader.node, conf.models)
     # model user
-    _using = app(conf.model.node.writer, conf.appspace)
+    _using = app(conf.model.writer.node, conf.models)
     # node reader
-    _r = factory(conf.readnode, backends, db)
+    _r = factory(conf.read.node, backends, db)
     # node writer
-    _w = factory(conf.writenode, backends, db)
+    _w = factory(conf.write.node, backends, db)
     # direct
-    direct = factory(conf.direct.worker.node, conf.direct, conf.key.session)
+    direct = factory(conf.direct.worker.node, conf.directs, conf.key.session)
     # raw
     raw = factory(conf.raw, conf.appspace, conf.key.session)
 

graphalchemy/models/writers.py

     # graph source
     _db = app(conf.key.backend, conf.userspace)
     # model finder
-    _finder = app(conf.model.finder.node, conf.appspace)
+    _finder = app(conf.model.finder.node, conf.models)
     # direct node reader
-    _r = factory(conf.readnode, backends, db)
+    _r = factory(conf.read.node, backends, db)
     # direct node writer
-    _w = factory(conf.writenode, backends, db)
+    _w = factory(conf.write.node, backends, db)
 
     def __init__(self, model):
         '''

graphalchemy/sessions.py

 # -*- coding: utf-8 -*-
 '''graph sessions'''
 
-from graphalchemy.core import octopus, extend, call
+from graphalchemy.core import octopus, reextend, call
 
 __all__ = ['Session']
 conf = octopus.G
     '''graph session'''
 
     # link manager
-    links = extend(conf.direct.worker.link, conf.direct)
+    links = reextend(conf.direct.worker.link, conf.directs)
     # node monager
-    nodes = extend(conf.model.worker.node, conf.models)
+    nodes = reextend(conf.model.worker.node, conf.models)
     # transaction monager
     transaction = call(conf.transaction, conf.backends, conf.key.db)
 
         self._db = manager._db
 
     def __exit__(self, e, b, c):
+        # wrap in database transaction
         with self.transaction:
             self.commit()

graphalchemy/settings.py

     appspace = 'graphalchemy'
     backends = 'backends'
     models = 'models'
-    managers = 'managers'
+    directs = 'directs'
     session = 'session.master'
 
 
         class writer:
             node = 'model.writer.node'
 
+        class reader:
+            node = 'model.reader.node'
+
         class worker:
-            node = 'direct.worker.node'
+            node = 'model.worker.node'
 
     class engines:
 

graphalchemy/tests/test_managers.py

         self.graph = Graph('neo4jem:foo')
 
     def test_create_node_writer(self):
-        self.assertTrue(hasattr(self.graph.session.nodes, '_reader'))
+#        self.assertTrue(hasattr(self.graph.session.nodes, '_reader'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'clone'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'build'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'version'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'autoslug'))
 
     def test_create_link_writer(self):
-        self.assertTrue(hasattr(self.graph.session.links, '_writer'))
+#        self.assertTrue(hasattr(self.graph.session.links, '_writer'))
         self.assertTrue(hasattr(self.graph.session.links, 'build'))
         self.assertTrue(hasattr(self.graph.session.links, 'create'))
         self.assertTrue(hasattr(self.graph.session.links, 'update'))
         self.assertTrue(hasattr(self.graph.session.links, 'index_many'))
         self.assertTrue(hasattr(self.graph.session.links, 'delete_property'))
         self.assertTrue(hasattr(self.graph.session.links, 'delete'))
-        self.assertTrue(hasattr(self.graph.session.links, 'autoslug'))
 
     def test_create_node_reader(self):
-        self.assertTrue(hasattr(self.graph.session.nodes, '_reader'))
+#        self.assertTrue(hasattr(self.graph.session.nodes, '_reader'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'root'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'anchor'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'filter_by'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'reference'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'root'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'traverse'))
-        self.assertTrue(hasattr(self.graph.session.nodes, 'traversed'))
         self.assertTrue(hasattr(self.graph.session.nodes, 'walk'))
-        self.assertTrue(hasattr(self.graph.session.nodes, 'walked'))
-        self.assertTrue(hasattr(self.graph.session.nodes, 'r'))
 
     def test_create_link_reader(self):
-        self.assertTrue(hasattr(self.graph.session.links, '_writer'))
+#        self.assertTrue(hasattr(self.graph.session.links, '_writer'))
         self.assertTrue(hasattr(self.graph.session.links, 'filter_by'))
         self.assertTrue(hasattr(self.graph.session.links, 'filter'))
         self.assertTrue(hasattr(self.graph.session.links, 'get'))
         self.assertTrue(hasattr(self.graph.session.links, 'traverse'))
-        self.assertTrue(hasattr(self.graph.session.links, 'traversed'))
         self.assertTrue(hasattr(self.graph.session.links, 'walk'))
-        self.assertTrue(hasattr(self.graph.session.links, 'walked'))
-        self.assertTrue(hasattr(self.graph.session.links, 'r'))
 
     def tearDown(self):
         self.graph._db.shutdown()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.