From 33b554991303b573254d59fb757f601d1e84d132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= Date: Thu, 23 May 2019 17:28:53 +0200 Subject: [PATCH] Use relative imports --- mm_client/__init__.py | 10 +++++----- mm_client/long_polling.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mm_client/__init__.py b/mm_client/__init__.py index 8177e06..77fd73e 100644 --- a/mm_client/__init__.py +++ b/mm_client/__init__.py @@ -7,10 +7,10 @@ import logging import os import requests -from mm_client import lib as mm_lib -from mm_client import signing -from mm_client.long_polling import LongPollingManager -from mm_client.ssh_tunnel import SSHTunnelManager +from . import lib as mm_lib +from .signing import get_signature +from .long_polling import LongPollingManager +from .ssh_tunnel import SSHTunnelManager __version__ = '4.0' logger = logging.getLogger('mm_client') @@ -102,7 +102,7 @@ def api_request(self, url_or_action, method='get', headers=None, params=None, da logger.error('Registration failed: %s', e) raise Exception('Registration failed: %s' % e) # Add signature in headers - _headers = signing.get_signature(self) if not anonymous else dict() + _headers = get_signature(self) if not anonymous else dict() if headers: _headers.update(headers) # Make API request diff --git a/mm_client/long_polling.py b/mm_client/long_polling.py index 18fb1de..a90f006 100644 --- a/mm_client/long_polling.py +++ b/mm_client/long_polling.py @@ -12,7 +12,7 @@ import time import traceback -from mm_client import signing +from .signing import check_signature logger = logging.getLogger('mm_client.long_polling') @@ -85,7 +85,7 @@ def call_long_polling(self): def process_long_polling(self, response): logger.debug('Processing response.') if self.client.conf.get('API_KEY'): - invalid = signing.check_signature(self.client, response) + invalid = check_signature(self.client, response) if invalid: raise Exception('Invalid signature: %s' % invalid) action = response.get('action')