From 9e8fdfc48512426410f3734d5d0d26b644a605d5 Mon Sep 17 00:00:00 2001 From: torrua Date: Sat, 12 Dec 2020 12:40:35 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20Release=201.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 ++- callbaker/__init__.py | 10 +++++----- setup.py | 4 ++-- tests/test_info_from_callback.py | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e40224..0b90f88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ -sudo: false +os: linux +dist: xenial language: python python: - "3.5" diff --git a/callbaker/__init__.py b/callbaker/__init__.py index b8a8dff..def32ff 100644 --- a/callbaker/__init__.py +++ b/callbaker/__init__.py @@ -22,11 +22,11 @@ def info_from_callback(call_data: str, separators: tuple = (EMS, IMS, DMV)) -> d """ if not isinstance(call_data, str): - raise TypeError(f"call_data should be a str type. You input {type(call_data)}.") + raise TypeError("call_data should be a str type. You input %s." % type(call_data)) for sep in separators: if not isinstance(sep, str): - raise TypeError(f"Separator should be a str type. You input {type(sep)}.") + raise TypeError("Separator should be a str type. You input %s." % type(sep)) _ems, _ims, _ = separators separated_items = call_data.split(_ems) @@ -49,11 +49,11 @@ def callback_from_info(info: dict, separators: tuple = (EMS, IMS, DMV)) -> str: :return: """ if not isinstance(info, dict): - raise TypeError(f"info should be a dict type. You input {type(info)}.") + raise TypeError("Info should be a dict type. You input %s." % type(info)) for sep in separators: if not isinstance(sep, str): - raise TypeError(f"Separator should be a str type. You input {type(sep)}.") + raise TypeError("Separator should be a str type. You input %s." % type(sep)) _ems, _ims, _ = separators @@ -61,5 +61,5 @@ def callback_from_info(info: dict, separators: tuple = (EMS, IMS, DMV)) -> str: if len(callback) > 64: raise ValueError("The length of callback_data should not be more that 64 symbols." - f"Your callback's length is {len(callback)} symbols.") + "Your callback's length is %s symbols." % len(callback)) return callback diff --git a/setup.py b/setup.py index 6ef3637..6e0d11b 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(filename): setup( name='callbaker', packages=['callbaker'], - version='1.1.0', + version='1.2.0', license='MIT', description="Telegram Button Callback Data Converter", long_description=read("README.md"), @@ -21,7 +21,7 @@ def read(filename): author='torrua', author_email='torrua@gmail.com', url='https://github.com/torrua/callbaker', - download_url='https://github.com/torrua/callbaker/archive/v1.1.0.tar.gz', + download_url='https://github.com/torrua/callbaker/archive/v1.2.0.tar.gz', keywords=['Convert', 'Callback', 'Keyboard', 'Telegram', "Inline"], classifiers=[ 'Development Status :: 4 - Beta', # "3 - Alpha", "4 - Beta" or "5 - Production/Stable" diff --git a/tests/test_info_from_callback.py b/tests/test_info_from_callback.py index 8ffe843..59f7414 100644 --- a/tests/test_info_from_callback.py +++ b/tests/test_info_from_callback.py @@ -40,12 +40,12 @@ def test_call_data_without_separators(self): @pytest.mark.parametrize("value", bool_tuple) def test_call_data_bool(self, value): result = info_from_callback( - call_data=f"&key_1={value}") + call_data="&key_1=%s" % value) assert isinstance(result, dict) assert result['key_1'] == value def test_call_data_digit(self): result = info_from_callback( - call_data=f"&key_1=20") + call_data="&key_1=20") assert isinstance(result, dict) assert result['key_1'] == 20