aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/find_root
diff options
context:
space:
mode:
authorDmitry Kopylov <kopylovd@gmail.com>2022-02-10 16:48:18 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:18 +0300
commitb2f5101486cc0de2e979c8ba9ada2109785bf5fd (patch)
treeaffe28b840816b505db0467f2285b01c89c04247 /library/python/find_root
parente9b28b5aad71453a4637b70dde02e801e4147a2a (diff)
downloadydb-b2f5101486cc0de2e979c8ba9ada2109785bf5fd.tar.gz
Restoring authorship annotation for Dmitry Kopylov <kopylovd@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/python/find_root')
-rw-r--r--library/python/find_root/__init__.py38
-rw-r--r--library/python/find_root/ya.make8
2 files changed, 23 insertions, 23 deletions
diff --git a/library/python/find_root/__init__.py b/library/python/find_root/__init__.py
index 6da604d62e..a53252c6e7 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 beaa8e3c52..a672093d96 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()