Exemplo n.º 1
0
def find_project_root(uri):
    f = File(uri)
    special_names = ('.ropeproject', '.git', '.hg', '.bzr', '.scribes_project')
    while True:
        for name in special_names:
            if f.get_child(name).query_exists():
                return f.get_path()

        p = f.get_parent()
        if p:
            f = p
        else:
            return None
Exemplo n.º 2
0
def find_project_root(uri):
    f = File(uri)
    special_names = ('.ropeproject', '.git', '.hg', '.bzr', '.scribes_project')
    while True:
        for name in special_names:
            if f.get_child(name).query_exists():
                return f.get_path()

        p = f.get_parent()
        if p:
            f = p
        else:
            return None