Beispiel #1
0
def AddDistToWorkingSet(distPath):
    """
    Given the path to a dist (an egg) add it to the current working set.
    This is basically a pkg_resources-friendly way of adding it to
    sys.path.
    Return a list of all distributions on distPath that appear to
    be ZenPacks.
    """
    zpDists = []
    for d in pkg_resources.find_distributions(distPath):
        pkg_resources.working_set.add(d)
        pkg_resources.require(d.project_name)
        if d.project_name.startswith('ZenPacks.'):
            zpDists.append(d)
    return zpDists
Beispiel #2
0
def AddDistToWorkingSet(distPath):
    """
    Given the path to a dist (an egg) add it to the current working set.
    This is basically a pkg_resources-friendly way of adding it to
    sys.path.
    Return a list of all distributions on distPath that appear to
    be ZenPacks.
    """
    zpDists = []
    for d in pkg_resources.find_distributions(distPath):
        pkg_resources.working_set.add(d)
        pkg_resources.require(d.project_name)
        if d.project_name.startswith('ZenPacks.'):
            zpDists.append(d)
    return zpDists