summaryrefslogtreecommitdiff
path: root/continuedev/src/continuedev/libs/util/map_path.py
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-18 15:17:04 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-18 15:17:04 -0700
commit70370bf0d033c2575c84ffe10c9e5c484bbad54f (patch)
treebe55005a3ef2867594a432ea12786098ae6a6c94 /continuedev/src/continuedev/libs/util/map_path.py
parentab7a90a0972188dcc7b8c28b1263c918776ca19d (diff)
downloadsncontinue-70370bf0d033c2575c84ffe10c9e5c484bbad54f.tar.gz
sncontinue-70370bf0d033c2575c84ffe10c9e5c484bbad54f.tar.bz2
sncontinue-70370bf0d033c2575c84ffe10c9e5c484bbad54f.zip
style: :art: autoformat with black on all python files
Diffstat (limited to 'continuedev/src/continuedev/libs/util/map_path.py')
-rw-r--r--continuedev/src/continuedev/libs/util/map_path.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/continuedev/src/continuedev/libs/util/map_path.py b/continuedev/src/continuedev/libs/util/map_path.py
index 8eb57712..1dddc2e9 100644
--- a/continuedev/src/continuedev/libs/util/map_path.py
+++ b/continuedev/src/continuedev/libs/util/map_path.py
@@ -1,16 +1,16 @@
from pathlib import Path
-def map_path(path: str, orig_root: str, copy_root: str) -> Path:
- path = Path(path)
- if path.is_relative_to(orig_root):
- if path.is_absolute():
- return Path(copy_root) / path.relative_to(orig_root)
- else:
- return path
- else:
- if path.is_absolute():
- return path
- else:
- # For this one, you need to know the directory from which the relative path is being used.
- return Path(orig_root) / path
+def map_path(path: str, orig_root: str, copy_root: str) -> Path:
+ path = Path(path)
+ if path.is_relative_to(orig_root):
+ if path.is_absolute():
+ return Path(copy_root) / path.relative_to(orig_root)
+ else:
+ return path
+ else:
+ if path.is_absolute():
+ return path
+ else:
+ # For this one, you need to know the directory from which the relative path is being used.
+ return Path(orig_root) / path