mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -04:00
Use os.path for checking if files exist, are files, or are directories, rather than pathlib.Path
Former-commit-id: d7cc6ea6b6028f31729518ff20a267104196533b Former-commit-id: 442527f45e5354c710d2328a9c1c6c79cef3d0bb
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
from os import listdir, remove, walk
|
||||
from os.path import expanduser, getmtime, join
|
||||
from os.path import expanduser, isdir, getmtime, join
|
||||
from subprocess import CalledProcessError, PIPE, run
|
||||
from sys import exit as s_exit
|
||||
|
||||
@@ -87,7 +87,7 @@ def deletion_sync(_deletion_database, _silent): # checks for and acts upon file
|
||||
def folder_sync(_folder_database): # creates matches of remote folders on the local client
|
||||
from pathlib import Path
|
||||
for _folder in _folder_database:
|
||||
if _folder != '' and not Path(f"{expanduser('~')}{_folder}").is_dir():
|
||||
if _folder != '' and not isdir(f"{expanduser('~')}{_folder}"):
|
||||
print(f"\u001b[38;5;2m{_folder.replace('/.local/share/sshyp/', '')}/\u001b[0m does not exist locally, "
|
||||
f"creating...")
|
||||
Path(f"{expanduser('~')}{_folder}").mkdir(mode=0o700, parents=True, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user