def __init__(self, registry, startup):
        global _package_manager
        if _package_manager:
            m = "Package manager can only be constructed once."
            raise VistrailsInternalError(m)
        _package_manager = self

        self._registry = registry
        self._startup = startup

        # Contains packages that have not yet been enabled, but exist on the
        # filesystem
        self._available_packages = {} # codepath: str -> Package
        # These other lists contain enabled packages
        self._package_list = {} # codepath: str -> Package
        self._package_versions = {} # identifier: str -> version -> Package
        self._old_identifier_map = {} # old_id: str -> new_id: str
        self._dependency_graph = vistrails.core.data_structures.graph.Graph()
        self._default_prefix_dict = \
                                {'basic_modules': 'vistrails.core.modules.',
                                 'abstraction': 'vistrails.core.modules.'}

        self._userpackages = None
        self._packages = None
        self._abstraction_pkg = None
        self._currently_importing_package = None

        # Setup a global __import__ hook that calls Package#import_override()
        # for all imports executed from that package
        import __builtin__
        self._orig_import = __builtin__.__import__
        __builtin__.__import__ = self._import_override

        # Compute the list of available packages, _available_packages
        self.build_available_package_names_list()

        if get_vistrails_configuration().loadPackages:
            for pkg in self._startup.enabled_packages.itervalues():
                self.add_package(pkg.name, prefix=pkg.prefix)
        else:
            try:
                basic_pkg = self._startup.enabled_packages['basic_modules']
            except KeyError:
                pass
            else:
                self.add_package(basic_pkg.name, prefix=basic_pkg.prefix)

            try:
                abs_pkg = self._startup.enabled_packages['abstraction']
            except __HOLE__:
                pass
            else:
                self.add_package(abs_pkg.name, prefix=abs_pkg.prefix)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/core/packagemanager.py/PackageManager.__init__