This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import asyncio | |
import sys | |
from asyncio.streams import StreamWriter, FlowControlMixin | |
reader, writer = None, None | |
@asyncio.coroutine | |
def stdio(loop=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoggingMixin(object): | |
def dispatch(self, request_type, request, **kwargs): | |
logger.debug( | |
'%s %s %s' % | |
(request.method, request.get_full_path(), request.raw_post_data)) | |
try: | |
response = super(LoggingMixin, self).dispatch( | |
request_type, request, **kwargs) | |
except (BadRequest, fields.ApiFieldError), e: |