Skip to content

Commit

Permalink
switch to pip and drop references to paste.http
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Nov 1, 2016
1 parent ac14361 commit 411ad2c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
22 changes: 22 additions & 0 deletions README.rst
Expand Up @@ -11,6 +11,28 @@ RPC Services for Pyramid
``pyramid_rpc`` is a package of RPC related add-on's to make it easier to
create RPC services.

.. code-block:: python
from pyramid.config import Configurator
from pyramid_rpc.jsonrpc import jsonrpc_method
@jsonrpc_method(endpoint='api')
def say_hello(request, name):
return 'hello, %s!' % name
def main(global_conf, **settings):
config = Configurator(settings=settings)
config.include('pyramid_rpc.jsonrpc')
config.add_jsonrpc_endpoint('api', '/api')
config.scan(__name__)
return config.make_wsgi_app()
if __name__ == '__main__':
from wsgiref.simple_server import make_server
app = main({})
server = make_server('', 8080, app)
server.serve_forever()
Support and Documentation
-------------------------

Expand Down
5 changes: 3 additions & 2 deletions docs/amf.rst
Expand Up @@ -39,13 +39,14 @@ Then expose the gateway as if it was a standard Pyramid view::
# yourproject/run.py
from pyramid.config import Configurator
from paste.httpserver import serve
from wsgiref.simple_server import make_server
if __name__ == '__main__':
config = Configurator()
config.add_view('amfgateway.echoGateway')
app = config.make_wsgi_app()
serve(app, host='0.0.0.0')
server = make_server('', 8080, app)
server.serve_forever()

The request passed into the service function is the standard Pyramid request
object. It can be disabled by passing ``expose_request=False`` into the
Expand Down
9 changes: 5 additions & 4 deletions docs/index.rst
Expand Up @@ -22,13 +22,14 @@ Community section first <http://docs.pylonsproject.org/#contributing>`_.
Installation
============

:mod:`pyramid_rpc` is a package that ships outside the main :mod:`pyramid`
distribution. To install the package, use ``easy_install``::
Install using ``pip``, where ``$VENV`` is the path to a virtual environment.

easy_install pyramid_rpc
.. code-block:: bash
$ $VENV/bin/pip install pyramid_rpc
Or obtain the packge via https://github.com/Pylons/pyramid_rpc
and use ``python setup.py install``.
and use ``$VENV/bin/pip install -e .``.

RPC Documentation
=================
Expand Down
5 changes: 3 additions & 2 deletions docs/jsonrpc.rst
Expand Up @@ -24,9 +24,10 @@ JSON-RPC
return config.make_wsgi_app()
if __name__ == '__main__':
from paste.httpserver import serve
from wsgiref.simple_server import make_server
app = main({})
serve(app, 'localhost', 8080)
server = make_server('', 8080, app)
server.serve_forever()
Setup
=====
Expand Down

0 comments on commit 411ad2c

Please sign in to comment.