Package portage :: Package proxy :: Module lazyimport
[hide private]

Module lazyimport

source code

Classes [hide private]
  basestring
str(object='') -> string
  _LazyImport
  _LazyImportFrom
Functions [hide private]
 
_preload_portage_submodules()
Load lazily referenced portage submodules into memory, so imports won't fail during portage upgrade/downgrade.
source code
 
_register_module_proxy(name, proxy) source code
 
_unregister_module_proxy(name)
Destroy all proxies that reference the give module name.
source code
 
lazyimport(scope, *args)
Create a proxy in the given scope in order to performa a lazy import.
source code
Variables [hide private]
  _module_proxies = {}
  _module_proxies_lock = <_RLock owner=None count=0>
  __package__ = 'portage.proxy'

Imports: sys, types, threading, ObjectProxy


Function Details [hide private]

_preload_portage_submodules()

source code 

Load lazily referenced portage submodules into memory, so imports won't fail during portage upgrade/downgrade. Note that this recursively loads only the modules that are lazily referenced by currently imported modules, so some portage submodules may still remain unimported after this function is called.

_unregister_module_proxy(name)

source code 

Destroy all proxies that reference the give module name. Also, check for other proxies referenced by modules that have been imported and destroy those proxies too. This way, destruction of a single proxy can trigger destruction of all the rest. If a target module appears to be partially imported (indicated when an AttributeError is caught), this function will leave in place proxies that reference it.

lazyimport(scope, *args)

source code 

Create a proxy in the given scope in order to performa a lazy import.

Syntax Result foo import foo foo:bar,baz from foo import bar, baz foo:bar@baz from foo import bar as baz

Parameters:
  • scope - the scope in which to place the import, typically globals()
  • args (strings) - module names to import
  • myfilename (dict)