Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyipptool/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ def pretty_printer(form):

class MetaAsyncShifter(type):
"""
Based on async flage defined on IPPToolWrapper
Based on is_async flage defined on IPPToolWrapper
methods will be decorated by tornado.gen.coroutine otherwise
with a fake one.
"""
def __new__(cls, name, bases, attrs):
klass = super(MetaAsyncShifter, cls).__new__(cls, name, bases, attrs)
if attrs.get('async'):
if attrs.get('is_async'):
# ASYNC Wrapper
for method_name in dir(bases[0]):
method = getattr(bases[0], method_name)
Expand All @@ -162,7 +162,7 @@ def __new__(cls, name, bases, attrs):

class IPPToolWrapper(object):
__metaclass__ = MetaAsyncShifter
async = False
is_async = False

def __init__(self, config):
self.config = config
Expand Down Expand Up @@ -862,7 +862,7 @@ def send_document(self,


class AsyncIPPToolWrapper(IPPToolWrapper):
async = True
is_async = True

def __init__(self, config, io_loop):
self.config = config
Expand Down