Skip to content

Commit

Permalink
Improvements on the documentation
Browse files Browse the repository at this point in the history
Add a note on the installation directory in INSTALL file
Remove spelling errors
Remove warnings of sphinx-build
  • Loading branch information
swagten committed Nov 14, 2012
1 parent acbe442 commit f5a7ed9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions INSTALL
Expand Up @@ -17,6 +17,9 @@ After checking out, type the following command:
python setup.py develop

You need setuptools for this to work.
If the installation directory is a system-owned directory (for instance,
/usr/lib/python2.7/site-packages), then you need to run the above command
as root.


DOCUMENTATION
Expand Down
6 changes: 3 additions & 3 deletions wsgiservice/application.py
Expand Up @@ -74,12 +74,12 @@ def _log_request(self, request):
for d in self.LOG_HEADERS:
if d in request.headers and request.headers[d]:
msg.append(d + ': ' + repr(request.headers[d]))
logger.info("Reqest information: %s", ', '.join(msg))
logger.info("Request information: %s", ', '.join(msg))

def _handle_request(self, request):
"""Finds the resource to which a request maps and then calls it.
Instantiates, fills and returns a :class:`webob.Response` object. If
no resource matches the request, a 404 status is set on the responrce
no resource matches the request, a 404 status is set on the response
object.
:param request: Object representing the current request.
Expand Down Expand Up @@ -111,7 +111,7 @@ def get_app(defs, add_help=True):
of this dictionary is used as application resource. The other
values are discarded.
:type defs: dict
:param add_help: Wether to add the Help resource which will expose the
:param add_help: Whether to add the Help resource which will expose the
documentation of this service at /_internal/help
:type add_help: boolean
:rtype: :class:`Application`
Expand Down
2 changes: 1 addition & 1 deletion wsgiservice/decorators.py
Expand Up @@ -6,7 +6,7 @@

def mount(path):
"""Decorator. Apply on a :class:`wsgiservice.Resource` to mount it at the
given path. The same can be achived by setting the ``_path`` attribute on
given path. The same can be achieved by setting the ``_path`` attribute on
the class directly.
:param path: A path to mount this resource on. See
Expand Down
16 changes: 8 additions & 8 deletions wsgiservice/resource.py
Expand Up @@ -14,7 +14,7 @@


class Resource(object):
"""Base class for all WsgiService resources. A resourse is a unique REST
"""Base class for all WsgiService resources. A resource is a unique REST
endpoint which accepts different methods for different actions.
For each HTTP call the corresponding method (equal to the HTTP method)
Expand Down Expand Up @@ -50,7 +50,7 @@ class Resource(object):
#: browsers don't cause too many exceptions.
IGNORED_PATHS = ('/favicon.ico', '/robots.txt')

#: Wether the input parameters from GET and POST should be decoded
#: Whether the input parameters from GET and POST should be decoded
#: according to the encoding specified by the request. This should only be
#: changed to False if the input is supposed to be byte values. (Default:
#: True)
Expand All @@ -66,7 +66,7 @@ class Resource(object):
path_params = None

#: String with the current path. Same as request.path except the extension
#: is removed. So instead of `/movies.json' it is just `/movies'. Set by
#: is removed. So instead of '/movies.json' it is just '/movies'. Set by
#: the constructor.
request_path = None

Expand All @@ -78,7 +78,7 @@ class Resource(object):
charset = 'UTF-8'

def __init__(self, request, response, path_params, application=None):
"""Constructor. Order of the parameters is not guarantteed, always
"""Constructor. Order of the parameters is not guaranteed, always
used named parameters.
:param request: Object representing the current request.
Expand Down Expand Up @@ -501,7 +501,7 @@ def to_text_xml(self, raw):
:func:`_get_xml_value` which applies some heuristics for converting
data to XML.
The default root tag is 'response', but that can be overwritting by
The default root tag is 'response', but that can be overwritten by
changing the :attr:`XML_ROOT_TAG` instance variable.
Uses :func:`wsgiservice.xmlserializer.dumps()` for the actual work.
Expand All @@ -522,7 +522,7 @@ def handle_exception(self, e, status=500):
:type status: int
"""
logger.exception(
"An exception occured while handling the request: %s", e)
"An exception occurred while handling the request: %s", e)
self.response.body_raw = {'error': str(e)}
self.response.status = status

Expand All @@ -534,7 +534,7 @@ def handle_exception_404(self, e):
:type e: :class:`Exception`
"""
logger.exception(
"A 404 Not Found exception occured while handling the request.")
"A 404 Not Found exception occurred while handling the request.")
self.response.body_raw = {'error': 'Not Found'}
self.response.status = 404

Expand Down Expand Up @@ -695,7 +695,7 @@ def to_text_html(self, raw):
:type raw: Any valid Python object
:rtype: string
.. todo:: Treat pragraphs and/or newlines better in output.
.. todo:: Treat paragraphs and/or newlines better in output.
"""
retval = ["""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Expand Down

0 comments on commit f5a7ed9

Please sign in to comment.