docs/_templates/indexcontent.html | 10 +++- docs/main/QuickstartTemplates.rst | 3 - moksha/connector/connector.py | 77 +++++++++++++++++++++----------------- 3 files changed, 52 insertions(+), 38 deletions(-)
New commits: commit 604e42457819fcdf7f0a7ebb133cc5b1065a0b34 Author: Luke Macken lmacken@redhat.com Date: Thu Sep 24 07:58:15 2009 -0400
Improve our connector docs, and tweak the front page a little
diff --git a/docs/_templates/indexcontent.html b/docs/_templates/indexcontent.html index d0099e6..c534c4e 100644 --- a/docs/_templates/indexcontent.html +++ b/docs/_templates/indexcontent.html @@ -11,6 +11,8 @@ <span class="linkdescr">Details on creating Widgets</span></p> <p class="biglink"><a class="biglink" href="{{ pathto("main/Messaging") }}">Messaging</a><br/> <span class="linkdescr">Moksha's real-time messaging layer</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("main/Connectors") }}">Connectors</a><br/> + <span class="linkdescr">Data connector interfaces</span></p> <p class="biglink"><a class="biglink" href="{{ pathto("main/Middleware") }}">WSGI Middleware</a><br/> <span class="linkdescr">A description of Moksha's WSGI middleware</span></p> <p class="biglink"><a class="biglink" href="{{ pathto("main/Security") }}">Security</a><br/> @@ -18,16 +20,18 @@ </td><td width="50%"> <p class="biglink"><a class="biglink" href="{{ pathto("main/Architecture") }}">The Architecture</a><br/> <span class="linkdescr">Features of and the technology behind them</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("main/QuickstartTemplates") }}">Quickstart Templates</a><br/> + <span class="linkdescr">Quickly create Moksha components</span></p> <p class="biglink"><a class="biglink" href="{{ pathto("main/MokshaApplications") }}">Applications</a><br/> <span class="linkdescr">Details on creating applications using Moksha</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("main/IntegratingWithTG2") }}">TurboGears2</a><br/> + <span class="linkdescr">Using Moksha with TurboGears2</span></p> <p class="biglink"><a class="biglink" href="{{ pathto("main/Development") }}">Development</a><br/> - <span class="linkdescr">A handbook for hacking on and with Moksha</span></p> + <span class="linkdescr">A handbook for hacking on Moksha</span></p> <p class="biglink"><a class="biglink" href="{{ pathto("main/Deployment") }}">Deployment</a><br/> <span class="linkdescr">Recipies for deploying and scaling Moksha</span></p> <p class="biglink"><a class="biglink" href="http://moksha.csh.rit.edu">Demo Dashboard</a><br/> <span class="linkdescr">A simple demo Moksha dashboard</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("main/IntegratingWithTG2") }}">TurboGears2</a><br/> - <span class="linkdescr">Using Moksha with TurboGears2</span></p> </td></tr> </table>
diff --git a/docs/main/QuickstartTemplates.rst b/docs/main/QuickstartTemplates.rst index 20aae37..60c41f4 100644 --- a/docs/main/QuickstartTemplates.rst +++ b/docs/main/QuickstartTemplates.rst @@ -2,8 +2,7 @@ Moksha Quickstart Templates ===========================
-Moksha provides templates for easily creating basic widgets, streams, -consumers, etc. +Moksha provides templates for easily creating basic components.
.. code-block:: bash
diff --git a/moksha/connector/connector.py b/moksha/connector/connector.py index 164e80c..664b75f 100644 --- a/moksha/connector/connector.py +++ b/moksha/connector/connector.py @@ -15,24 +15,25 @@ # along with this program. If not, see http://www.gnu.org/licenses/. # # Authors: John (J5) Palmieri johnp@redhat.com +""" +Moksha Data Connector Interfaces +================================ + +A Data Connector is an object which translate Moksha data requests to the +native protocol of a data resource such as an XMLRPC or JSON server and then +translates the results into a format the client is expecting. They can also +implement caching and other data services. Think of a connector as an +intelligent proxy to external servers. + +All Data Connectors must derive and implement the :class:`IConnector` +interface. All other interfaces are optional. Any feature of an interface +which is not implemented (e.g. sorting in the ITable interface) must raise +NotImplementedError if the value is set to anything but None +"""
from utils import QueryPath, QueryCol, ParamFilter, WeightedSearch from beaker.cache import Cache
-""" Data Connector Interfaces - -A Data Connector is an object which translate Moksha data requests to the native -protocol of a data resource such as an XMLRPC or json server and then translates -the results into a format the client is expecting. They can also implement -caching and other data services. Think of a connector as an intelligent proxy -to external servers. - -All Data Connectors must derive and implement the IConnector interface. All -other interfaces are optional. Any feature of an interface which is not -implemented (e.g. sorting in the ITable interface) must -raise NotImplementedError if the value is set to anything but None -""" - class IConnector(object): """ Data connector interface
@@ -111,15 +112,17 @@ class IConnector(object): """ Implement this method to return all available remote resource paths along with documentation for each path broken into this format:
- { - path: { - "doc": general documentation, - "return": return documentation, - "parameters": { - param name: param documentation - }, - } - } + .. code-block:: python + + { + path: { + "doc": general documentation, + "return": return documentation, + "parameters": { + param name: param documentation + }, + } + }
You may return None if your resource does not have a way to introspect it but you must return something. @@ -208,21 +211,27 @@ class IQuery(object): :sort_col: Which column we should sort by. None = default :sort_order: 1 = ascending, -1 = descending :filters: a hash of columns and their filters in this format: - { - colname: { - "value": value, - "op": operator # "=", "<", ">", etc. - } - }
- - or - + .. code-block:: + + { + colname: { + "value": value, + "op": operator # "=", "<", ">", etc. + } + }
- { - colname: value # assumes = - } + - or - + + { + colname: value # assumes = + }
:Returns: A hash with format: + + .. code-block:: python + { "total_rows": total_rows, # number of rows matched by query "rows_per_page": rows_per_page, # number of rows requested @@ -232,6 +241,8 @@ class IQuery(object): # to pagination "rows": rows # list of rows which were returned } + + """
results = None
moksha-commits@lists.fedorahosted.org