Add Path.dot_extension property.

This commit is contained in:
Ethan Dalool 2019-08-05 17:34:17 -07:00
parent 6e64c081cd
commit b0ed32a1d5

View file

@ -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)