From b0ed32a1d5128dff05f25e31d867dcd46013abbd Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 5 Aug 2019 17:34:17 -0700 Subject: [PATCH] Add Path.dot_extension property. --- voussoirkit/pathclass.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/voussoirkit/pathclass.py b/voussoirkit/pathclass.py index 7fcd9be..b89e37d 100644 --- a/voussoirkit/pathclass.py +++ b/voussoirkit/pathclass.py @@ -83,6 +83,13 @@ class Path: def depth(self): return len(self.absolute_path.rstrip(self.sep).split(self.sep)) + @property + def dot_extension(self): + extension = self.extension + if extension: + return '.' + extension + return '' + @property def exists(self): return os.path.exists(self.absolute_path)