33import pkgutil
44
55logger = logging .getLogger (__name__ )
6- __version__ = ' 1.0.0'
7- __author__ = ' Ellison Leão'
8- __email__ = ' ellisonleao@gmail.com'
9- __license__ = ' GPLv3'
6+ __version__ = " 1.0.1"
7+ __author__ = " Ellison Leão"
8+ __email__ = " ellisonleao@gmail.com"
9+ __license__ = " GPLv3"
1010
1111
1212class Shortener (object ):
@@ -26,21 +26,22 @@ class Shortener(object):
2626 def __init__ (self , ** kwargs ):
2727 self .kwargs = kwargs
2828 # validate some required fields
29- self .kwargs ['debug' ] = bool (kwargs .pop ('debug' , False ))
30- self .kwargs ['timeout' ] = int (kwargs .pop ('timeout' , 2 ))
31- self .kwargs ['verify' ] = bool (kwargs .pop ('verify' , True ))
32- module = importlib .import_module ('pyshorteners.shorteners' )
33- self .available_shorteners = [i .name for i in
34- pkgutil .iter_modules (module .__path__ )]
29+ self .kwargs ["debug" ] = bool (kwargs .pop ("debug" , False ))
30+ self .kwargs ["timeout" ] = int (kwargs .pop ("timeout" , 2 ))
31+ self .kwargs ["verify" ] = bool (kwargs .pop ("verify" , True ))
32+ module = importlib .import_module ("pyshorteners.shorteners" )
33+ self .available_shorteners = [
34+ i .name for i in pkgutil .iter_modules (module .__path__ )
35+ ]
3536
3637 def __getattr__ (self , attr ):
3738 if attr not in self .available_shorteners :
3839 return self .__getattribute__ (attr )
3940
4041 # get instance of shortener class
4142 short_module = importlib .import_module (
42- ' {}.{}' .format (' pyshorteners.shorteners' , attr )
43+ " {}.{}" .format (" pyshorteners.shorteners" , attr )
4344 )
44- instance = getattr (short_module , ' Shortener' )(** self .kwargs )
45+ instance = getattr (short_module , " Shortener" )(** self .kwargs )
4546
4647 return instance
0 commit comments