-=[ Mr. Bumblebee ]=-
_Indonesia_
ó
LrOc @@ s d Z d d l m Z d e f d „ ƒ YZ d „ Z d e f d „ ƒ YZ d e f d „ ƒ YZ d d
„ Z e e
ƒ d ƒ d S(
so Functionality to create lazy evaluation objects.
This includes waiting to import a module until it is actually used.
Most commonly, the 'lazy_import' function is used to import other modules
in an on-demand fashion. Typically use looks like::
from bzrlib.lazy_import import lazy_import
lazy_import(globals(), '''
from bzrlib import (
errors,
osutils,
branch,
)
import bzrlib.branch
''')
Then 'errors, osutils, branch' and 'bzrlib' will exist as lazy-loaded
objects which will be replaced with a real object on first use.
In general, it is best to only load modules in this way. This is because
it isn't safe to pass these variables to other functions before they
have been replaced. This is especially true for constants, sometimes
true for classes or functions (when used as a factory, or you want
to inherit from them).
i ( t absolute_importt
ScopeReplacerc B@ sG e Z d Z d
Z e Z d „ Z d „ Z d „ Z d „ Z d „ Z
RS( s A lazy object that will replace itself in the appropriate scope.
This object sits, ready to create the real object the first time it is
needed.
t _scopet _factoryt _namet _real_objc C@ sZ t j | d | ƒ t j | d | ƒ t j | d | ƒ t j | d d ƒ | | | <d S( sg Create a temporary object in the specified scope.
Once used, a real object will be placed in the scope.
:param scope: The scope the object should appear in
:param factory: A callable that will create the real object.
It will be passed (self, scope, name)
:param name: The variable name in the given scope.
R R R R N( t objectt __setattr__t None( t selft scopet factoryt name( ( s6 /usr/lib/python2.7/dist-packages/bzrlib/lazy_import.pyt __init__>