Add contextmanager to Control module

This commit is contained in:
Andrei 2019-02-14 13:33:16 +03:00
parent 5e94e6f453
commit fb9f0e27aa
1 changed files with 17 additions and 1 deletions

View File

@ -12,6 +12,14 @@ class AntiCaptchaControl:
"""
self.ANTICAPTCHA_KEY = anticaptcha_key
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
if exc_type:
return False
return True
def get_balance(self):
'''
Получение баланса аккаунта
@ -44,6 +52,14 @@ class aioAntiCaptchaControl:
"""
self.ANTICAPTCHA_KEY = anticaptcha_key
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
if exc_type:
return False
return True
async def get_balance(self):
'''
Получение баланса аккаунта