Skip to content

Commit

Permalink
:update: remove dependency to link.utils (now using logging directly)
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdd committed May 25, 2016
1 parent a670b7c commit f029aff
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 39 deletions.
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
# built documents.
#
# The short X.Y version.
version = u'0.2'
version = u'0.3'
# The full version, including alpha/beta/rc tags.
release = u'0.2'
release = u'0.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 0 additions & 5 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.. link.wsgi documentation master file, created by
sphinx-quickstart on Fri Feb 19 13:29:53 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to link.wsgi's documentation!
=====================================

Expand Down
19 changes: 0 additions & 19 deletions doc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,6 @@ We need the following *supervisord* service:
environment=B3J0F_CONF_DIR="%(ENV_VIRTUAL_ENV)s/etc"
command=gunicorn link.wsgi.app:application
stderr_logfile=%(ENV_VIRTUAL_ENV)s/myapp.log
Then we can add the following configuration files.

etc/link/wsgi/base.conf
***********************

.. code-block:: ini
[LOGGING]
log_level=info
# log_name=myapp
# log_file=/var/log/myapp.log
etc/link/wsgi/router.conf
*************************

See `Routes configuration`_.
Running everything
------------------
Expand Down
2 changes: 1 addition & 1 deletion link/wsgi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

__version__ = '0.2'
__version__ = '0.3'

CONF_BASE_PATH = 'link/wsgi'
6 changes: 4 additions & 2 deletions link/wsgi/app.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# -*- coding: utf-8 -*-

from b3j0f.conf import Configurable, category
from link.utils.logging import LoggingObject
from link.wsgi import CONF_BASE_PATH
from link.wsgi.router import Router
from link.wsgi.req import Request
from link.wsgi.resp import Response

import logging


@Configurable(
paths='{0}/app.conf'.format(CONF_BASE_PATH),
conf=category('APPLICATION')
)
class Application(LoggingObject):
class Application(object):
"""
WSGI Application class.
"""
Expand All @@ -21,6 +22,7 @@ def __init__(self, *args, **kwargs):
super(Application, self).__init__(*args, **kwargs)

self.router = Router()
self.logger = logging.getLogger('link.wsgi.app')

def __call__(self, environ, start_response):
"""
Expand Down
3 changes: 1 addition & 2 deletions link/wsgi/middleware.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-

from b3j0f.conf import Configurable, category
from link.utils.logging import LoggingObject
from link.wsgi import CONF_BASE_PATH


@Configurable(
paths='{0}/middleware.conf'.format(CONF_BASE_PATH),
conf=category('MIDDLEWARE')
)
class Middleware(LoggingObject):
class Middleware(object):
"""
Middleware class.
Expand Down
3 changes: 1 addition & 2 deletions link/wsgi/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from b3j0f.conf import Configurable, category, Parameter

from link.utils.logging import LoggingObject
from link.wsgi import CONF_BASE_PATH
from link.wsgi.url import parse_qs

Expand All @@ -18,7 +17,7 @@
Parameter(name='charsets', ptype=list)
)
)
class Request(LoggingObject):
class Request(object):
"""
Request object encapsulating WSGI environ dict.
"""
Expand Down
3 changes: 1 addition & 2 deletions link/wsgi/resp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from b3j0f.conf import Configurable, category
from b3j0f.utils.iterable import isiterable

from link.utils.logging import LoggingObject
from link.wsgi import CONF_BASE_PATH

from httplib import responses as httpresponses
Expand All @@ -15,7 +14,7 @@
paths='{0}/response.conf'.format(CONF_BASE_PATH),
conf=category('RESPONSE')
)
class Response(LoggingObject):
class Response(object):
"""
Response object encapsulating WSGI response handler.
"""
Expand Down
6 changes: 4 additions & 2 deletions link/wsgi/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from b3j0f.conf import Configurable, category, Parameter
from b3j0f.utils.path import lookup

from link.utils.logging import LoggingObject
from link.wsgi import CONF_BASE_PATH

from inspect import isclass
from re import match
import logging


@Configurable(
Expand All @@ -18,7 +18,7 @@
Parameter(name='middlewares', ptype=list)
)
)
class Router(LoggingObject):
class Router(object):
"""
Request dispatcher.
Expand Down Expand Up @@ -86,6 +86,8 @@ def __init__(self, urlpatterns=None, middlewares=None, *args, **kwargs):

super(Router, self).__init__(*args, **kwargs)

self.logger = logging.getLogger('link.wsgi.router')

if urlpatterns is not None:
self.urlpatterns = urlpatterns

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
link.utils>=0.2
b3j0f.conf>=0.3.13
six>=1.10.0
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
AUTHOR_EMAIL = 'david.jose.delassus@gmail.com'
LICENSE = 'MIT'
REQUIREMENTS = [
'link.utils==0.2',
'b3j0f.conf==0.3.13',
'six==1.10.0'
]
Expand Down

0 comments on commit f029aff

Please sign in to comment.