This is decent code, job well done!
I have a few nitpicks,
- PEP8 violations
- Functions and variables should be
snake_case - Group your imports
There are multiple tools out there that checks your code PEP8, when your IDE does not support it violations
- When joining paths => us
pathliboros.path.join
Adding paths via string concatenations can be error prone, it is best to use os.path.join(path1, path2)
For instance it will handle cases when you try to add /a/b/ with /c/d
You do this in a few placeplaces, but not all the time. Stay consistent!
extention = filename.rsplit(".")[1]
You can use root, extentsion = os.path.splittext(filename)
You can catch multiple exceptions at once
except (pmko.ssh_exception.NoValidConnectionsError, TimeoutError):Instead of printing what went wrong, try logging
Print statements are there for a short time, logs are forever
if not bool(re.search(r'\_c\.', _file)):
Here bool is superfluous when no match is found it will return None, which is FalsyFalsey