Permalink
Browse files

First try on docs.

  • Loading branch information...
deavid committed Dec 25, 2010
1 parent c3b7c6e commit b719d686bc52915aec5bb686a7fca958db9be8f0
Showing with 95 additions and 69 deletions.
  1. +7 −1 LICENSE
  2. +5 −27 bjsonrpc/__init__.py
  3. +29 −38 bjsonrpc/main.py
  4. +1 −1 bjsonrpc/proxies.py
  5. +30 −0 doc/source/api.rst
  6. +3 −1 doc/source/conf.py
  7. +4 −0 doc/source/index.rst
  8. +5 −0 doc/source/intro.rst
  9. +10 −0 doc/source/tutorial.rst
  10. +1 −1 setup.py
View
@@ -2,6 +2,12 @@
Copyright (c) 2010 David Martinez Marti
All rights reserved.
+Software licensed under 3-clause BSD license.
+Documentation licensed also under 3-clause BSD license.
+
+License text for "3-clause BSD license" follows:
+================================================
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@@ -15,7 +21,7 @@ are met:
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+**AS IS** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
View
@@ -1,36 +1,14 @@
"""
- Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP
-
Copyright (c) 2010 David Martinez Marti
All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of copyright holders nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
+ Licensed under 3-clause BSD License. See LICENSE.txt for the full license text.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
"""
-__version__ = '0.1.0'
-
-from main import *
+__version__ = '0.1'
+__release__ = '0.1.x-dev'
+from main import *
+from main import __all__
View
@@ -1,63 +1,54 @@
"""
bjson/main.py
- Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP
-
Copyright (c) 2010 David Martinez Marti
All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of copyright holders nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
+ Licensed under 3-clause BSD License. See LICENSE.txt for the full license text.
"""
import socket
import sys
-
import inspect, traceback
-
-from handlers import BaseHandler, NullHandler
-from exceptions import EofError,ServerError
-
-from connection import Connection
-from server import Server
-
-
-def server(host="127.0.0.1", port=10123, handler_factory=NullHandler):
+__all__ = [
+ "createserver",
+ "connect",
+ "server",
+ "connection",
+ "request",
+ "handlers",
+ "proxies",
+ "jsonlib",
+ "exceptions"
+]
+
+import server
+import connection
+import request
+import handlers
+import proxies
+import jsonlib
+import exceptions
+
+
+def createserver(host="127.0.0.1", port=10123, handler_factory=handlers.NullHandler):
+ """
+ Help command to create a socket and associate it to a server.Server object.
+ """
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))
s.listen(3)
- return Server(s,handler_factory=handler_factory)
+ return server.Server(s,handler_factory=handler_factory)
-def connect(host="127.0.0.1", port=10123, handler_factory=NullHandler):
+def connect(host="127.0.0.1", port=10123, handler_factory=handlers.NullHandler):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
- return Connection(s,handler_factory=handler_factory)
+ return connection.Connection(s,handler_factory=handler_factory)
View
@@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
"""
-import weakref
+# import weakref
class Proxy(object):
def __init__(self, conn, sync_type, obj = None):
View
@@ -0,0 +1,30 @@
+.. automodule:: bjsonrpc
+ :members:
+ :undoc-members:
+ :inherited-members:
+
+.. automodule:: bjsonrpc.request
+ :members:
+ :undoc-members:
+ :inherited-members:
+ :show-inheritance:
+
+.. automodule:: bjsonrpc.proxies
+ :members:
+ :undoc-members:
+ :inherited-members:
+ :show-inheritance:
+
+.. automodule:: bjsonrpc.jsonlib
+ :members:
+ :undoc-members:
+ :inherited-members:
+ :show-inheritance:
+
+.. automodule:: bjsonrpc.exceptions
+ :members:
+ :undoc-members:
+ :inherited-members:
+ :show-inheritance:
+
+
View
@@ -13,6 +13,8 @@
import sys, os
+sys.path.insert(0,"..")
+
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -31,7 +33,7 @@
source_suffix = '.rst'
# The encoding of source files.
-#source_encoding = 'utf-8'
+source_encoding = 'utf-8'
# The master toctree document.
master_doc = 'index'
View
@@ -10,6 +10,10 @@ Contents:
.. toctree::
:maxdepth: 2
+
+ intro
+ tutorial
+ api
Indices and tables
==================
View
@@ -0,0 +1,5 @@
+Introduction to bjsonrpc
+=================================
+
+blah, blah, first, after, blah, blah
+
View
@@ -0,0 +1,10 @@
+Basic Tutorial
+=================================
+
+1. blah
+
+2. more blah
+
+3. blah^2
+
+
View
@@ -34,7 +34,7 @@
setup(
name = 'bjsonrpc',
- version = '0.1.0',
+ version = '0.1.x-dev',
description = 'Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP',
author = 'David Martinez Marti',
author_email = 'deavidsedice@gmail.com',

0 comments on commit b719d68

Please sign in to comment.