All Samples(644) | Call(643) | Derive(0) | Import(1)
Declare that package 'packageName' is a namespace package
def declare_namespace(packageName):
"""Declare that package 'packageName' is a namespace package"""
imp.acquire_lock()
try:
if packageName in _namespace_packages:
return
path, parent = sys.path, None
if '.' in packageName:
parent = '.'.join(packageName.split('.')[:-1])
declare_namespace(parent)
__import__(parent)
try:
path = sys.modules[parent].__path__
except AttributeError:
raise TypeError("Not a package:", parent)
# Track what packages are namespaces, so when new path items are added,
# they can be updated
_namespace_packages.setdefault(parent,[]).append(packageName)
_namespace_packages.setdefault(packageName,[])
for path_item in path:
# Ensure all the parent's path items are reflected in the child,
# if they apply
_handle_ns(packageName, path_item)
finally:
imp.release_lock()
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
src/c/h/changingsong-HEAD/trunk/samples/plugin_sys/pyutilib/pyutilib/__init__.py changingsong(Download)
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
src/c/h/changingsong-HEAD/samples/plugin_sys/pyutilib/pyutilib/component/__init__.py changingsong(Download)
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
src/c/h/changingsong-HEAD/samples/plugin_sys/pyutilib/pyutilib/__init__.py changingsong(Download)
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
src/n/a/nagare.examples-0.2.0/nagare/examples/__init__.py nagare.examples(Download)
import pkg_resources
pkg_resources.declare_namespace('examples')
src/n/a/nagare.examples-0.2.0/nagare/__init__.py nagare.examples(Download)
import pkg_resources
pkg_resources.declare_namespace('nagare')
src/r/e/reporter-lib-HEAD/packages/topia.termextract/src/topia/__init__.py reporter-lib(Download)
import pkg_resources pkg_resources.declare_namespace(__name__)
src/z/3/z3ext-HEAD/Sandbox/bubenkoff/z3ext-dev/z3ext/z3ext.ui.portaltabs/trunk/src/z3ext/ui/__init__.py z3ext(Download)
try:
# Declare this a namespace package if pkg_resources is available.
import pkg_resources
pkg_resources.declare_namespace('z3ext')
except ImportError:
pass
src/z/3/z3ext-HEAD/Sandbox/bubenkoff/z3ext-dev/z3ext/z3ext.ui.portaltabs/trunk/src/z3ext/__init__.py z3ext(Download)
try:
# Declare this a namespace package if pkg_resources is available.
import pkg_resources
pkg_resources.declare_namespace('z3ext')
except ImportError:
pass
src/z/3/z3ext-HEAD/Sandbox/bubenkoff/z3ext-dev/sandbox/z3ext.portalfolder/trunk/src/z3ext/__init__.py z3ext(Download)
try:
# Declare this a namespace package if pkg_resources is available.
import pkg_resources
pkg_resources.declare_namespace('z3ext')
except ImportError:
pass
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next