diff options
author | Dmitry Kopylov <kopylovd@gmail.com> | 2022-02-10 16:48:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:18 +0300 |
commit | 7230275728d34873cba1ba78bb68669b0c5faa31 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/python/find_root | |
parent | b2f5101486cc0de2e979c8ba9ada2109785bf5fd (diff) | |
download | ydb-7230275728d34873cba1ba78bb68669b0c5faa31.tar.gz |
Restoring authorship annotation for Dmitry Kopylov <kopylovd@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/python/find_root')
-rw-r--r-- | library/python/find_root/__init__.py | 38 | ||||
-rw-r--r-- | library/python/find_root/ya.make | 8 |
2 files changed, 23 insertions, 23 deletions
diff --git a/library/python/find_root/__init__.py b/library/python/find_root/__init__.py index a53252c6e7..6da604d62e 100644 --- a/library/python/find_root/__init__.py +++ b/library/python/find_root/__init__.py @@ -1,20 +1,20 @@ -import os - - -def is_root(path): +import os + + +def is_root(path): return os.path.exists(os.path.join(path, ".arcadia.root")) or os.path.exists(os.path.join(path, 'devtools', 'ya', 'ya.conf.json')) - - -def detect_root(path, detector=is_root): - return _find_path(path, detector) - - -def _find_path(starts_from, check): - p = os.path.realpath(starts_from) - while True: - if check(p): - return p - next_p = os.path.dirname(p) - if next_p == p: - return None - p = next_p + + +def detect_root(path, detector=is_root): + return _find_path(path, detector) + + +def _find_path(starts_from, check): + p = os.path.realpath(starts_from) + while True: + if check(p): + return p + next_p = os.path.dirname(p) + if next_p == p: + return None + p = next_p diff --git a/library/python/find_root/ya.make b/library/python/find_root/ya.make index a672093d96..beaa8e3c52 100644 --- a/library/python/find_root/ya.make +++ b/library/python/find_root/ya.make @@ -1,7 +1,7 @@ PY23_LIBRARY() - + OWNER(g:yatool) - + PY_SRCS(__init__.py) - -END() + +END() |