From c4d5eff9f3527fb51c1ffbf6b888cc1700feedd8 Mon Sep 17 00:00:00 2001 From: Rahiel Kasim Date: Tue, 24 May 2016 23:40:09 +0200 Subject: [PATCH] move botan from utils to ext --- telegram/{utils => ext}/botan.py | 18 ++++++------------ tests/test_botan.py | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) rename telegram/{utils => ext}/botan.py (76%) diff --git a/telegram/utils/botan.py b/telegram/ext/botan.py similarity index 76% rename from telegram/utils/botan.py rename to telegram/ext/botan.py index 0998fbdea..8064a8ad8 100644 --- a/telegram/utils/botan.py +++ b/telegram/ext/botan.py @@ -1,23 +1,17 @@ -#!/usr/bin/env python - import logging from telegram import NullHandler -try: - from urllib.request import urlopen, Request - from urllib.parse import quote - from urllib.error import URLError, HTTPError -except ImportError: - from urllib2 import urlopen, Request - from urllib import quote - from urllib2 import URLError, HTTPError +from future.moves.urllib.parse import quote +from future.moves.urllib.error import HTTPError, URLError +from future.moves.urllib.request import urlopen, Request logging.getLogger(__name__).addHandler(NullHandler()) class Botan(object): - """This class helps to send incoming events in your botan analytics account. - See more: https://github.com/botanio/sdk#botan-sdk""" + """This class helps to send incoming events to your botan analytics account. + See more: https://github.com/botanio/sdk#botan-sdk + """ token = '' url_template = 'https://api.botan.io/track?token={token}' \ diff --git a/tests/test_botan.py b/tests/test_botan.py index fc5b1ad8e..446bcc8ec 100644 --- a/tests/test_botan.py +++ b/tests/test_botan.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -"""This module contains a object that represents Tests for Botan analytics integration""" +"""This module contains an object that represents Tests for Botan analytics integration""" import sys import unittest @@ -9,7 +9,7 @@ from flaky import flaky sys.path.append('.') -from telegram.utils.botan import Botan +from telegram.ext.botan import Botan from tests.base import BaseTest