Python: basic, package install, error handler for begining

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
2022-05-04 15:02:55 +02:00
parent 5ce0f7da22
commit 155597aeff
13 changed files with 204 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
from pathlib import PosixPath
class DirNotFoundError(OSError):
def __str__(self):
if len(self.args) >= 1:
path: str = ""
if isinstance(self.args[0], PosixPath):
path = str(PosixPath(self.args[0]))
else:
path = str(self.args[0])
return f"Directory does not exist / is not a dir: {path}"
else:
return super.__str__(self)