talklib 2.0.2__tar.gz → 2.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {talklib-2.0.2/src/talklib.egg-info → talklib-2.0.4}/PKG-INFO +1 -1
- {talklib-2.0.2 → talklib-2.0.4}/pyproject.toml +1 -1
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib/pod.py +12 -12
- {talklib-2.0.2 → talklib-2.0.4/src/talklib.egg-info}/PKG-INFO +1 -1
- {talklib-2.0.2 → talklib-2.0.4}/LICENSE.txt +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/README.md +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/requirements.txt +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/setup.cfg +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib/__init__.py +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib/ev.py +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib/ffmpeg.py +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib/notify.py +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib/show.py +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib/utils.py +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib.egg-info/SOURCES.txt +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib.egg-info/dependency_links.txt +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib.egg-info/requires.txt +0 -0
- {talklib-2.0.2 → talklib-2.0.4}/src/talklib.egg-info/top_level.txt +0 -0
|
@@ -54,9 +54,9 @@ class SSH(BaseModel):
|
|
|
54
54
|
self.check_folder_exists(folder=folder)
|
|
55
55
|
|
|
56
56
|
try:
|
|
57
|
-
self.notifications.prep_syslog(message=f"Attempting to upload '{file}' to {folder}/")
|
|
58
|
-
self.connection.put(local=file, remote=f"
|
|
59
|
-
self.notifications.prep_syslog(message=f"Successfully uploaded '{file}' to {folder}/")
|
|
57
|
+
self.notifications.prep_syslog(message=f"Attempting to upload '{file}' to {folder}/ on server")
|
|
58
|
+
self.connection.put(local=file, remote=f"shows/{folder}", preserve_mode=False)
|
|
59
|
+
self.notifications.prep_syslog(message=f"Successfully uploaded '{file}' to {folder}/ on server")
|
|
60
60
|
return
|
|
61
61
|
except (FileNotFoundError, Exception) as e:
|
|
62
62
|
to_send = f"unable to upload '{file}': {e}"
|
|
@@ -65,8 +65,8 @@ class SSH(BaseModel):
|
|
|
65
65
|
|
|
66
66
|
def download_file(self, file: str, folder: str) -> None:
|
|
67
67
|
try:
|
|
68
|
-
self.notifications.prep_syslog(message=f"Attempting to download '{file}' from {folder}/")
|
|
69
|
-
self.connection.get(remote=f"
|
|
68
|
+
self.notifications.prep_syslog(message=f"Attempting to download '{file}' from {folder}/ on server")
|
|
69
|
+
self.connection.get(remote=f"shows/{folder}/{file}")
|
|
70
70
|
self.notifications.prep_syslog(message=f"Successfully downloaded '{file}' to {os.getcwd()}")
|
|
71
71
|
return file
|
|
72
72
|
except Exception as e:
|
|
@@ -76,9 +76,9 @@ class SSH(BaseModel):
|
|
|
76
76
|
|
|
77
77
|
def delete_file(self, file: str, folder: str) -> None:
|
|
78
78
|
try:
|
|
79
|
-
self.notifications.prep_syslog(message=f"Attempting to delete '{file}' from {folder}/")
|
|
80
|
-
self.connection.sftp().remove(f"
|
|
81
|
-
self.notifications.prep_syslog(message=f"Successfully deleted '{file}' from {folder}/")
|
|
79
|
+
self.notifications.prep_syslog(message=f"Attempting to delete '{file}' from {folder}/ on server")
|
|
80
|
+
self.connection.sftp().remove(f"shows/{folder}/{file}")
|
|
81
|
+
self.notifications.prep_syslog(message=f"Successfully deleted '{file}' from {folder}/ on server")
|
|
82
82
|
return
|
|
83
83
|
except (Exception, FileNotFoundError) as e:
|
|
84
84
|
self.notifications.send_notifications(
|
|
@@ -87,7 +87,7 @@ class SSH(BaseModel):
|
|
|
87
87
|
|
|
88
88
|
def get_folders(self) -> list:
|
|
89
89
|
ret_val: list = []
|
|
90
|
-
result: Result = self.connection.run("cd
|
|
90
|
+
result: Result = self.connection.run("cd shows && ls", hide=True)
|
|
91
91
|
result_stdout:str = result.stdout
|
|
92
92
|
folders: list[str] = result_stdout.rsplit("\n")
|
|
93
93
|
for folder in folders:
|
|
@@ -97,7 +97,7 @@ class SSH(BaseModel):
|
|
|
97
97
|
|
|
98
98
|
def get_files_from_folder(self, folder: str) -> list:
|
|
99
99
|
ret_val: list = []
|
|
100
|
-
result: Result = self.connection.run(f"cd
|
|
100
|
+
result: Result = self.connection.run(f"cd shows/{folder} && ls", hide=True)
|
|
101
101
|
result_stdout:str = result.stdout
|
|
102
102
|
files: list[str] = result_stdout.rsplit("\n")
|
|
103
103
|
for file in files:
|
|
@@ -107,7 +107,7 @@ class SSH(BaseModel):
|
|
|
107
107
|
|
|
108
108
|
def get_all_files(self) -> list:
|
|
109
109
|
ret_val: list = []
|
|
110
|
-
result: Result = self.connection.run("cd
|
|
110
|
+
result: Result = self.connection.run("cd shows && ls -R", hide=True)
|
|
111
111
|
result_stdout:str = result.stdout
|
|
112
112
|
files: list[str] = result_stdout.rsplit("\n")
|
|
113
113
|
for file in files:
|
|
@@ -119,7 +119,7 @@ class SSH(BaseModel):
|
|
|
119
119
|
self.notifications.prep_syslog(message=f"checking if {folder}/ exists on server...")
|
|
120
120
|
folders = self.get_folders()
|
|
121
121
|
if folder.lower() in folders:
|
|
122
|
-
self.notifications.prep_syslog(message=f"{folder}/ exists!")
|
|
122
|
+
self.notifications.prep_syslog(message=f"{folder}/ exists on server!")
|
|
123
123
|
return True
|
|
124
124
|
|
|
125
125
|
to_send = f"cannot find folder titled: {folder}/ on server"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|