From 918c9569ba9b9fef71e452d2d3af28d21665a5b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ellison=20Lea=CC=83o?= Date: Thu, 19 Mar 2020 14:49:27 -0300 Subject: [PATCH] bump 1.0.1 --- pyshorteners/__init__.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pyshorteners/__init__.py b/pyshorteners/__init__.py index 0d0cd7a..04fb673 100644 --- a/pyshorteners/__init__.py +++ b/pyshorteners/__init__.py @@ -3,10 +3,10 @@ import pkgutil logger = logging.getLogger(__name__) -__version__ = '1.0.0' -__author__ = 'Ellison Leão' -__email__ = 'ellisonleao@gmail.com' -__license__ = 'GPLv3' +__version__ = "1.0.1" +__author__ = "Ellison Leão" +__email__ = "ellisonleao@gmail.com" +__license__ = "GPLv3" class Shortener(object): @@ -26,12 +26,13 @@ class Shortener(object): def __init__(self, **kwargs): self.kwargs = kwargs # validate some required fields - self.kwargs['debug'] = bool(kwargs.pop('debug', False)) - self.kwargs['timeout'] = int(kwargs.pop('timeout', 2)) - self.kwargs['verify'] = bool(kwargs.pop('verify', True)) - module = importlib.import_module('pyshorteners.shorteners') - self.available_shorteners = [i.name for i in - pkgutil.iter_modules(module.__path__)] + self.kwargs["debug"] = bool(kwargs.pop("debug", False)) + self.kwargs["timeout"] = int(kwargs.pop("timeout", 2)) + self.kwargs["verify"] = bool(kwargs.pop("verify", True)) + module = importlib.import_module("pyshorteners.shorteners") + self.available_shorteners = [ + i.name for i in pkgutil.iter_modules(module.__path__) + ] def __getattr__(self, attr): if attr not in self.available_shorteners: @@ -39,8 +40,8 @@ def __getattr__(self, attr): # get instance of shortener class short_module = importlib.import_module( - '{}.{}'.format('pyshorteners.shorteners', attr) + "{}.{}".format("pyshorteners.shorteners", attr) ) - instance = getattr(short_module, 'Shortener')(**self.kwargs) + instance = getattr(short_module, "Shortener")(**self.kwargs) return instance