1. Lynn Rees
  2. graphalchemy

Commits

Lynn Rees  committed 3e02012

- fixes

  • Participants
  • Parent commits b5c0df4
  • Branches pu

Comments (0)

Files changed (13)

File graphalchemy/finders.py

View file
  • Ignore whitespace
 
 __all__ = ('links', 'nodes')
 
+# settings
 conf = octopus.S
-direct = getattr(octopus.decorators, 'direct')
+# decorators
+direct = octopus.decorators.direct
 
 
 class Finder(octopus.things.context):

File graphalchemy/generics/collectors.py

View file
  • Ignore whitespace
 
 __all__ = ('Links', 'Nodes')
 
+# settings
 conf = octopus.S
-direct = getattr(octopus.decorators, 'direct')
+# decorators
+direct = octopus.decorators.direct
 
 
 class Links(LinksMixin):

File graphalchemy/generics/elements.py

View file
  • Ignore whitespace
 
 __all__ = ('Link', 'Node')
 
+# settings
 conf = octopus.S
-direct = getattr(octopus.decorators, 'direct')
-defer = getattr(octopus.decorators, 'defer')
+# decorators
+direct = octopus.decorators.direct
+defer = octopus.decorators.defer
 
 
 class Generic(ElementMixin, octopus.things.lifecycle):

File graphalchemy/graphs.py

View file
  • Ignore whitespace
 
 __all__ = ['Graph']
 
+# settings
 conf = octopus.S
-factory = getattr(octopus.decorators, 'factory')
+# decorators
+factory = octopus.decorators.factory
 
 
 class Session(octopus.locals.protocol):

File graphalchemy/managers.py

View file
  • Ignore whitespace
 
 __all__ = ('Links', 'Nodes')
 
+# settings
 conf = octopus.S
 appspace = conf.appspace
 reader = conf.reader
 wrapper = conf.wrapper
 writer = conf.writer
-direct = getattr(octopus.decorators, 'direct')
-factory = getattr(octopus.decorators, 'factory')
-forward = getattr(octopus.decorators, 'forward')
+# decorators
+direct = octopus.decorators.direct
+factory = octopus.decorators.factory
+subscribe = octopus.decorators.subscribe
 
 
-class Manager(octopus.things.client):
+class Manager(octopus.things.sub):
 
     '''graph element manager base'''
 
     '''graph link manager'''
 
     # link reader
-    _reader = forward(reader.link, appspace)
+    _reader = subscribe(reader.link, appspace)
     # link wrapper
     _wrapper = direct(wrapper.link, appspace)
     # link writer
-    _writer = forward(writer.link, appspace)
+    _writer = subscribe(writer.link, appspace)
 
 
 class Nodes(Manager):
     '''graph node manager'''
 
     # node reader
-    _reader = forward(reader.node, appspace)
+    _reader = subscribe(reader.node, appspace)
     # node wrapper
     _wrapper = direct(wrapper.node, appspace)
     # node writers
-    _writer = forward(writer.node, appspace)
+    _writer = subscribe(writer.node, appspace)

File graphalchemy/mixins/collectors.py

View file
  • Ignore whitespace
 
 __all__ = ('LinksMixin', 'NodesMixin')
 
+# settings
 conf = octopus.S
 appspace = conf.appspace
 finder = conf.model.finder
-direct = getattr(octopus.decorators, 'direct')
+# decorators
+direct = octopus.decorators.direct
 
 
 class CollectorsMixin(octopus.locals.context):

File graphalchemy/mixins/elements.py

View file
  • Ignore whitespace
 
 __all__ = ('LinksMixin', 'NodesMixin')
 
+# settings
 conf = getattr(octopus, 'S')
-defer = getattr(octopus.decorators, 'defer')
-direct = getattr(octopus.decorators, 'direct')
+# decorators
+defer = octopus.decorators.defer
+direct = octopus.decorators.direct
 
 
 class ElementMixin(object):

File graphalchemy/models/collectors.py

View file
  • Ignore whitespace
 
 __all__ = ('In', 'Nodes', 'Out')
 
+# settings
 conf = octopus.S
-direct = getattr(octopus.decorators, 'direct')
+# decorators
+direct = octopus.decorators.direct
 
 
 class Nodes(NodesMixin):

File graphalchemy/models/elements.py

View file
  • Ignore whitespace
 
 __all__ = ['Node']
 
+# settings
 conf = octopus.S
-class_defer = getattr(octopus.decorators, 'class_defer')
-defer = getattr(octopus.decorators, 'defer')
-direct = getattr(octopus.decorators, 'direct')
+# decorators
+class_defer = octopus.decorators.class_defer
+defer = octopus.decorators.defer
+direct = octopus.decorators.direct
 
 
 class Node(NodeMixin, ElementMixin, octopus.things.protocol):

File graphalchemy/readers.py

View file
  • Ignore whitespace
 # settings
 conf = octopus.S
 # decorators
-direct = getattr(octopus.decorators, 'direct')
-factory = getattr(octopus.decorators, 'factory')
-service = getattr(octopus.decorators, 'service')
+direct = octopus.decorators.direct
+factory = octopus.decorators.factory
+service = octopus.decorators.service
 
 
-class Reader(octopus.things.server):
+class Reader(octopus.things.pub):
 
     '''graph reader base'''
 

File graphalchemy/tests/test_db.py

View file
  • Ignore whitespace
         gn.w.create_index('con_text', fts=True)
         gn.w.create_index('tags')
         root = gn.root()
-        # question base create
         question = gn.create(text='question reference node')
         question.index_under('roots', 'reference', 'question')
         question.link('QUESTION_REFERENCE_FOR', root)
-        # idea base create
         idea = gn.create(text='idea reference node')
         idea.index_under('roots', 'reference', 'idea')
         idea.link('IDEA_REFERENCE_FOR', root)
-        # pro base create
         pro = gn.create(text='pro reference node')
         pro.index_under('roots', 'reference', 'pro')
         pro.link('PRO_REFERENCE_FOR', root)
-        # con base create
         con = gn.create(text='con reference node')
         con.link('CON_REFERENCE_FOR', root)
         con.index_under('roots', 'reference', 'con')
-        # tag base create
         tag = gn.create(text='tag reference node')
         tag.link('TAG_REFERENCE_FOR', root)
         tag.index_under('roots', 'reference', 'tag')
-        # example tags
         tag_1 = gn.create(
             _model='tag', _status=1, text='wicked problem', user=1,
         )
         tag_2 = gn.create(text='avoid', user=1, _model='tag', _status=1)
         tag_2.index_under('tags', 'name', 'avoid')
         tag_2.link('TAG_NODE_OF', tag, user=1)
-        # prime question
         question_0 = gn.create(
             _model='root_question',
             text='What is the prime question?',
         )
         question_0.link('QUESTION_NODE_OF', question, user=1)
         question_0.index_under('roots', 'root', 'question')
-        # root example question
         question_1 = gn.create(
             _model='question',
             _status=1,
         question_1.index_by('question_text', 'text')
         question_1.link('QUESTION_NODE_OF', question, user=1)
         question_1.link('QUESTION_ROOTED_IN', question_0, user=1)
-        # tag example question
         question_1.index_under('questions', 'tag', 'wicked problem')
         tag_1.link('TAGGED', question_1)
         question_1.index_under('questions', 'tag', 'avoid')
         idea_7.index_by('idea_text', 'text')
         idea_7.link('IDEA_NODE_OF', idea, user=1)
         idea_7.link('IDEA_ABOUT', question_4, user=1)
-        # idea 1 "DUCK"
         idea_1 = gn.create(
             _model='idea',
             _status=1,
         question_5.index_by('question_text', 'text')
         question_5.link('QUESTION_NODE_OF', question, user=1)
         question_5.link('QUESTION_ABOUT', idea_7, user=1)
-        # pros against idea 1
         pro_2 = gn.create(
             _model='pro',
             _status=1,

File graphalchemy/wrappers.py

View file
  • Ignore whitespace
 
 __all__ = ('Links', 'Nodes')
 
+# settings
 conf = octopus.S
 appspace = conf.appspace
-direct = getattr(octopus.decorators, 'direct')
 finder = conf.model.finder
-forward = getattr(octopus.decorators, 'forward')
 reader = conf.reader
 writer = conf.writer
+# decorators
+direct = octopus.decorators.direct
+subscribe = octopus.decorators.subscribe
 
 
-class Wrapper(octopus.things.client):
+class Wrapper(octopus.things.sub):
 
     '''graph model wrapper'''
 
     # link model finder
     _finder = direct(finder.link, appspace)
     # link reader
-    _reader = forward(reader.link, appspace)
+    _reader = subscribe(reader.link, appspace)
     # link reader
-    _writer = forward(writer.link, appspace)
+    _writer = subscribe(writer.link, appspace)
 
 
 class Nodes(Wrapper):
     # node model finder
     _finder = direct(finder.node, appspace)
     # mode reader
-    _reader = forward(reader.node, appspace)
+    _reader = subscribe(reader.node, appspace)
     # node writer
-    _writer = forward(writer.node, appspace)
+    _writer = subscribe(writer.node, appspace)

File graphalchemy/writers.py

View file
  • Ignore whitespace
 backends = conf.backends
 db = conf.key.db
 # decorators
-direct = getattr(octopus.decorators, 'direct')
-factory = getattr(octopus.decorators, 'factory')
-service = getattr(octopus.decorators, 'service')
+direct = octopus.decorators.direct
+factory = octopus.decorators.factory
+service = octopus.decorators.service
 
 
-class Writer(octopus.things.server):
+class Writer(octopus.things.pub):
 
     '''graph writer base'''