%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 188.40.95.74 / Your IP : 216.73.216.205 Web Server : Apache System : Linux cp01.striminghost.net 3.10.0-1160.119.1.el7.tuxcare.els13.x86_64 #1 SMP Fri Nov 22 06:29:45 UTC 2024 x86_64 User : vlasotin ( 1054) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.7/site-packages/leapp/utils/ |
Upload File : |
import pkgutil class LeappLibrariesFinder(object): """ Implements functionality to dynamically load libraries for actors. """ def __init__(self, module_prefix, paths): """ :param module_prefix: Prefix string such as 'leapp.libraries.common' or 'leapp.libraries.actor' which is used to filter the modules to handle with this finder. :type module_prefix: str :param paths: List of paths to search for the matching libraries :type paths: List or Tuple """ self._paths = paths self._prefix = module_prefix def _implementation(self, method, fullname, path): # noqa; pylint: disable=unused-argument if not fullname.startswith(self._prefix + '.'): return None module = fullname.split('.')[-1] for loader, name, ispkg in pkgutil.iter_modules(self._paths): if name == module: return getattr(loader, method)(fullname) def find_spec(self, fullname, path, target=None): # noqa; pylint: disable=unused-argument """ Implementation for python >=3.4 """ return self._implementation(method='find_spec', fullname=fullname, path=path) def find_module(self, fullname, path=None): """ Implementation for python <3.4 """ return self._implementation(method='find_module', fullname=fullname, path=path)