/usr/lib/python2.6/site-packages/oslo_utils
Edit: /usr/lib/python2.6/site-packages/oslo_utils/importutils.pyc (2472B)
Ñò
zDVc @ s^ d Z d d k Z d d k Z d „ Z d „ Z d „ Z d „ Z d d „ Z d d „ Z d S( s0
Import related utilities and helper functions.
iÿÿÿÿNc C sy | i d ƒ \ } } } t | ƒ y t t i | | ƒ SWn8 t j
o, t d | t i t i ƒ Œ f ƒ ‚ n Xd S( s9 Returns a class from a string including module and class.t .s Class %s cannot be found (%s)N(
t
rpartitiont
__import__t getattrt syst modulest AttributeErrort ImportErrort tracebackt format_exceptiont exc_info( t
import_strt mod_strt _sept class_str( ( s: /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/importutils.pyt import_class s
c O s t | ƒ | | Ž S( s, Import a class and return an instance of it.( R ( R t argst kwargs( ( s: /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/importutils.pyt
import_object$ s c O sQ d | | f } y t | ƒ | | Ž SWn# t j
o t | ƒ | | Ž SXd S( sð Tries to import object from default namespace.
Imports a class and return an instance of it, first by trying
to find the class in a default namespace, then failing back to
a full path if not found in the default namespace.
s %s.%sN( R R ( t
name_spaceR R R t import_value( ( s: /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/importutils.pyt import_object_ns) s
c C s t | ƒ t i | S( s Import a module.( R R R ( R ( ( s: /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/importutils.pyt
import_module7 s
c C s4 d | } | o d i | | f ƒ } n t | ƒ S( Ns oslo.v%sR ( t joinR ( t versiont submodulet module( ( s: /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/importutils.pyt import_versioned_module= s
c C s) y t | ƒ SWn t j
o | SXd S( s6 Try to import a module and if it fails return default.N( R R ( R t default( ( s: /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/importutils.pyt
try_importD s (
t __doc__R R R R R R t NoneR R ( ( ( s: /tmp/pip-build-lt8jXN/oslo.utils/oslo_utils/importutils.pyt
s