コード例 #1
0
ファイル: component_walker.py プロジェクト: JoonyLi/veil
def search_components(root_path, path=None):
    path = path or root_path
    component_names = set()
    init_path = path / '__init__.py'
    if init_path.exists() and is_component(init_path.text()):
        component_name = root_path.relpathto(path).replace('/', '.')
        component_names.add(component_name)
    else:
        for sub_path in path.dirs():
            component_names = component_names.union(search_components(root_path, sub_path))
    return component_names
コード例 #2
0
ファイル: component_walker.py プロジェクト: Shasthojoy/veil
def search_components(root_path, path=None):
    path = path or root_path
    component_names = set()
    init_path = path / '__init__.py'
    if init_path.exists() and is_component(init_path.text()):
        component_name = root_path.relpathto(path).replace('/', '.')
        component_names.add(component_name)
    else:
        for sub_path in path.dirs():
            component_names |= search_components(root_path, sub_path)
    return component_names
コード例 #3
0
ファイル: utils.py プロジェクト: 4teamwork/ftw.lawgiver
def find_egginfo(path):
    path = Path(path)
    if not path or path == '/':
        raise ValueError('WARNING: no *.egg-info directory could be found.')
        return None

    egginfos = path.dirs('*.egg-info')
    if len(egginfos) == 0:
        return find_egginfo(path.dirname())

    if len(egginfos) > 1:
        raise ValueError('WARNING: more than one *.egg-info  directory found.')
        return None

    return egginfos[0]
コード例 #4
0
ファイル: utils.py プロジェクト: jowent/ftw.lawgiver
def find_egginfo(path):
    path = Path(path)
    if not path or path == '/':
        raise ValueError('WARNING: no *.egg-info directory could be found.')
        return None

    egginfos = path.dirs('*.egg-info')
    if len(egginfos) == 0:
        return find_egginfo(path.dirname())

    if len(egginfos) > 1:
        raise ValueError('WARNING: more than one *.egg-info  directory found.')
        return None

    return egginfos[0]