From cfa9ca9e3c15e33114c051b20d52ead57dd17d17 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 13 Sep 2024 17:39:39 +0200 Subject: [PATCH] prj/Path --- rwx/prj/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rwx/prj/__init__.py b/rwx/prj/__init__.py index 6a3e059..8b70a4a 100644 --- a/rwx/prj/__init__.py +++ b/rwx/prj/__init__.py @@ -1,6 +1,7 @@ """Handle projects.""" -from os import path +from os.path import realpath +from pathlib import Path class Project: @@ -8,6 +9,6 @@ class Project: def __init__(self, file_path: str) -> None: """Set file, root & name.""" - self.file: str = path.realpath(file_path) - self.root: str = path.dirname(self.file) - self.name: str = path.basename(self.root) + self.file: str = realpath(file_path) + self.root: str = Path(self.file).parent + self.name: str = self.root.name