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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: talklib
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "talklib"
3
- version = "2.0.2"
3
+ version = "2.0.4"
4
4
  description = "A package to automate processing of shows/segments airing on the TL"
5
5
  readme = "README.md"
6
6
  license = {file = "LICENSE.txt"}
@@ -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"talkinglibrary/shows/{folder}", preserve_mode=False)
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"talkinglibrary/shows/{folder}/{file}")
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"talkinglibrary/shows/{folder}/{file}")
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 talkinglibrary/shows && ls", hide=True)
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 talkinglibrary/shows/{folder} && ls", hide=True)
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 talkinglibrary/shows && ls -R", hide=True)
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"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: talklib
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
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