Add Path.dot_extension property.
This commit is contained in:
parent
6e64c081cd
commit
b0ed32a1d5
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue