Logo Search packages:      
Sourcecode: distribute version File versions  Download package

def pkg_resources::WorkingSet::add (   self,
  dist,
  entry = None,
  insert = True 
)

Add `dist` to working set, associated with `entry`

If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
On exit from this routine, `entry` is added to the end of the working
set's ``.entries`` (if it wasn't already present).

`dist` is only added to the working set if it's for a project that
doesn't already have a distribution in the set.  If it's added, any
callbacks registered with the ``subscribe()`` method will be called.

Definition at line 478 of file pkg_resources.py.

00478                                                 :
        """Add `dist` to working set, associated with `entry`

        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
        On exit from this routine, `entry` is added to the end of the working
        set's ``.entries`` (if it wasn't already present).

        `dist` is only added to the working set if it's for a project that
        doesn't already have a distribution in the set.  If it's added, any
        callbacks registered with the ``subscribe()`` method will be called.
        """
        if insert:
            dist.insert_on(self.entries, entry)

        if entry is None:
            entry = dist.location
        keys = self.entry_keys.setdefault(entry,[])
        keys2 = self.entry_keys.setdefault(dist.location,[])
        if dist.key in self.by_key:
            return      # ignore hidden distros

        self.by_key[dist.key] = dist
        if dist.key not in keys:
            keys.append(dist.key)
        if dist.key not in keys2:
            keys2.append(dist.key)
        self._added_new(dist)

    def resolve(self, requirements, env=None, installer=None, replacement=True):


Generated by  Doxygen 1.6.0   Back to index