From c4d5eff9f3527fb51c1ffbf6b888cc1700feedd8 Mon Sep 17 00:00:00 2001 From: Rahiel Kasim Date: Tue, 24 May 2016 23:40:09 +0200 Subject: [PATCH 1/5] 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 From 3907e649662918f0a22cc0001101edf2f5ef694a Mon Sep 17 00:00:00 2001 From: Leandro Toledo Date: Thu, 26 May 2016 14:13:27 -0300 Subject: [PATCH 2/5] Adds telegram.utils.botan back using deprecate --- telegram/utils/botan.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 telegram/utils/botan.py diff --git a/telegram/utils/botan.py b/telegram/utils/botan.py new file mode 100644 index 000000000..e0d2d4b1f --- /dev/null +++ b/telegram/utils/botan.py @@ -0,0 +1,4 @@ +from .deprecate import deprecate +from telegram.ext.botan import Botan as Bo + +Botan = deprecate(Bo, 'telegram.utils.botan', 'telegram.ext.botan') From c8497424b73c31290b1b25181f4c82aabc355291 Mon Sep 17 00:00:00 2001 From: Rahiel Kasim Date: Sat, 28 May 2016 09:12:10 +0200 Subject: [PATCH 3/5] move botan to contrib --- telegram/{ext => contrib}/botan.py | 0 telegram/utils/botan.py | 4 ++-- tests/test_botan.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename telegram/{ext => contrib}/botan.py (100%) diff --git a/telegram/ext/botan.py b/telegram/contrib/botan.py similarity index 100% rename from telegram/ext/botan.py rename to telegram/contrib/botan.py diff --git a/telegram/utils/botan.py b/telegram/utils/botan.py index e0d2d4b1f..a9f5bb612 100644 --- a/telegram/utils/botan.py +++ b/telegram/utils/botan.py @@ -1,4 +1,4 @@ from .deprecate import deprecate -from telegram.ext.botan import Botan as Bo +from telegram.contrib.botan import Botan as Bo -Botan = deprecate(Bo, 'telegram.utils.botan', 'telegram.ext.botan') +Botan = deprecate(Bo, 'telegram.utils.botan', 'telegram.contrib.botan') diff --git a/tests/test_botan.py b/tests/test_botan.py index 446bcc8ec..a45c28fd0 100644 --- a/tests/test_botan.py +++ b/tests/test_botan.py @@ -9,7 +9,7 @@ from flaky import flaky sys.path.append('.') -from telegram.ext.botan import Botan +from telegram.contrib.botan import Botan from tests.base import BaseTest From 2f408ab7675eb1ff2b0c488174c5662abc979ebc Mon Sep 17 00:00:00 2001 From: Rahiel Kasim Date: Sat, 28 May 2016 09:18:36 +0200 Subject: [PATCH 4/5] generate docs for botan --- docs/source/telegram.contrib.botan.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/source/telegram.contrib.botan.rst diff --git a/docs/source/telegram.contrib.botan.rst b/docs/source/telegram.contrib.botan.rst new file mode 100644 index 000000000..626317f4e --- /dev/null +++ b/docs/source/telegram.contrib.botan.rst @@ -0,0 +1,7 @@ +telegram.contrib.botan module +============================= + +.. automodule:: telegram.contrib.botan + :members: + :undoc-members: + :show-inheritance: From b06983a94ad02c0044c2ca36606147eef39d105e Mon Sep 17 00:00:00 2001 From: Rahiel Kasim Date: Sat, 28 May 2016 09:27:17 +0200 Subject: [PATCH 5/5] let python 2 find the contrib module --- telegram/contrib/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 telegram/contrib/__init__.py diff --git a/telegram/contrib/__init__.py b/telegram/contrib/__init__.py new file mode 100644 index 000000000..e69de29bb