talklib 3.2.2__tar.gz → 3.3.0__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-3.2.2/src/talklib.egg-info → talklib-3.3.0}/PKG-INFO +3 -2
- {talklib-3.2.2 → talklib-3.3.0}/README.md +2 -1
- {talklib-3.2.2 → talklib-3.3.0}/pyproject.toml +1 -1
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/ev.py +19 -13
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/pod.py +14 -1
- {talklib-3.2.2 → talklib-3.3.0/src/talklib.egg-info}/PKG-INFO +3 -2
- {talklib-3.2.2 → talklib-3.3.0}/LICENSE.txt +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/requirements.txt +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/setup.cfg +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/__init__.py +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/cli.py +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/ffmpeg.py +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/notify.py +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/show.py +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib/utils.py +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib.egg-info/SOURCES.txt +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib.egg-info/dependency_links.txt +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib.egg-info/entry_points.txt +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib.egg-info/requires.txt +0 -0
- {talklib-3.2.2 → talklib-3.3.0}/src/talklib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: talklib
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
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>
|
|
@@ -600,5 +600,6 @@ nyt.run()
|
|
|
600
600
|
````
|
|
601
601
|
- The tests can take a while to run. Watch the terminal output for progress.
|
|
602
602
|
- If the tests fail, you may have installed something incorrectly.
|
|
603
|
-
- You must be connected to the internet to run the tests
|
|
603
|
+
- You must be connected to the internet to run the tests.
|
|
604
|
+
- To update the version on PyPI, you must increment the version number in `pyproject.toml`
|
|
604
605
|
|
|
@@ -499,5 +499,6 @@ nyt.run()
|
|
|
499
499
|
````
|
|
500
500
|
- The tests can take a while to run. Watch the terminal output for progress.
|
|
501
501
|
- If the tests fail, you may have installed something incorrectly.
|
|
502
|
-
- You must be connected to the internet to run the tests
|
|
502
|
+
- You must be connected to the internet to run the tests.
|
|
503
|
+
- To update the version on PyPI, you must increment the version number in `pyproject.toml`
|
|
503
504
|
|
|
@@ -41,21 +41,27 @@ import os
|
|
|
41
41
|
class EV:
|
|
42
42
|
def __init__(self):
|
|
43
43
|
self.destinations = sort_destinations() # where should output files go? MUST BE A LIST EVEN WITH ONLY ONE
|
|
44
|
-
self.syslog_host =
|
|
45
|
-
self.fromEmail =
|
|
46
|
-
self.toEmail = sort_to_email()
|
|
47
|
-
self.mail_server =
|
|
48
|
-
self.twilio_sid =
|
|
49
|
-
self.twilio_token =
|
|
50
|
-
self.twilio_from =
|
|
44
|
+
self.syslog_host = get_EV(ev="syslog_server") # ip of syslog server (PC with syslog software)
|
|
45
|
+
self.fromEmail = get_EV(ev="fromEmail") # from where should emails appear to come?
|
|
46
|
+
self.toEmail = sort_to_email() # to where should emails be sent?
|
|
47
|
+
self.mail_server = get_EV(ev="mail_server_external") # IP of mail server (ITS set this up for us)
|
|
48
|
+
self.twilio_sid = get_EV(ev="twilio_sid") # locate by logging in to Twilio website
|
|
49
|
+
self.twilio_token = get_EV(ev="twilio_token") # locate by logging in to Twilio website
|
|
50
|
+
self.twilio_from = get_EV(ev="twilio_from") # locate by logging in to Twilio website
|
|
51
51
|
self.twilio_to = sort_twilio_to() # to where should texts/calls be sent
|
|
52
|
-
self.icecast_user =
|
|
53
|
-
self.icecast_pass =
|
|
54
|
-
self.pod_server_uname =
|
|
52
|
+
self.icecast_user = get_EV(ev="icecast_user") # our icecast username
|
|
53
|
+
self.icecast_pass = get_EV(ev="icecast_pass") # our icecast password
|
|
54
|
+
self.pod_server_uname = get_EV(ev="pod_server_uname")
|
|
55
55
|
|
|
56
|
+
def get_EV(ev: str):
|
|
57
|
+
try:
|
|
58
|
+
ev = os.environ[ev]
|
|
59
|
+
return ev
|
|
60
|
+
except KeyError:
|
|
61
|
+
raise RuntimeError(f"Missing required environment variable: {ev}")
|
|
56
62
|
|
|
57
63
|
def sort_destinations():
|
|
58
|
-
destinations =
|
|
64
|
+
destinations = get_EV(ev="destinations")
|
|
59
65
|
destinations = destinations.split(",")
|
|
60
66
|
destination_list = []
|
|
61
67
|
for destination in destinations:
|
|
@@ -66,7 +72,7 @@ def sort_destinations():
|
|
|
66
72
|
return destination_list
|
|
67
73
|
|
|
68
74
|
def sort_to_email():
|
|
69
|
-
to_emails =
|
|
75
|
+
to_emails = get_EV(ev="toEmail")
|
|
70
76
|
to_emails = to_emails.split(",")
|
|
71
77
|
to_email_list = []
|
|
72
78
|
for email in to_emails:
|
|
@@ -76,7 +82,7 @@ def sort_to_email():
|
|
|
76
82
|
return to_email_list
|
|
77
83
|
|
|
78
84
|
def sort_twilio_to():
|
|
79
|
-
twilio_to_numbers =
|
|
85
|
+
twilio_to_numbers = get_EV(ev="twilio_to")
|
|
80
86
|
twilio_to_numbers = twilio_to_numbers.split(",")
|
|
81
87
|
twilio_to_list = []
|
|
82
88
|
for number in twilio_to_numbers:
|
|
@@ -52,6 +52,7 @@ class SSH(BaseModel):
|
|
|
52
52
|
user: str = EV().pod_server_uname
|
|
53
53
|
connection: Type[Connection] = Connection(host=server, user=user)
|
|
54
54
|
notifications: Notifications = Notifications()
|
|
55
|
+
folder_exists: ClassVar[str] = False
|
|
55
56
|
|
|
56
57
|
def upload_file(self, file: str, folder: str) -> None:
|
|
57
58
|
self.check_folder_exists(folder=folder)
|
|
@@ -139,10 +140,13 @@ The error from the SSH library is: {e}"
|
|
|
139
140
|
self.upload_file(file="feed.xml", folder=folder)
|
|
140
141
|
|
|
141
142
|
def check_folder_exists(self, folder: str) -> bool:
|
|
143
|
+
if SSH.folder_exists:
|
|
144
|
+
return True
|
|
142
145
|
self.notifications.prep_syslog(message=f"checking if {folder}/ exists on server...")
|
|
143
146
|
folders = self.get_folders()
|
|
144
147
|
if folder.lower() in folders:
|
|
145
148
|
self.notifications.prep_syslog(message=f"{folder}/ exists on server!")
|
|
149
|
+
SSH.folder_exists = True
|
|
146
150
|
return True
|
|
147
151
|
|
|
148
152
|
to_send = f"cannot find folder titled: {folder}/ on server"
|
|
@@ -175,6 +179,12 @@ class Episode(BaseModel):
|
|
|
175
179
|
self.notifications.prep_syslog(message=f"pubDate will be: {pub_date}")
|
|
176
180
|
return pub_date
|
|
177
181
|
|
|
182
|
+
def copyright(self) -> str:
|
|
183
|
+
year: int = datetime.now().year
|
|
184
|
+
copyright: str = f"© 1975-{year} Nashville Talking Library - Do not copy or redistribute"
|
|
185
|
+
self.notifications.prep_syslog(message=f"copyright will be: {copyright}")
|
|
186
|
+
return copyright
|
|
187
|
+
|
|
178
188
|
def size_in_bytes(self, filename) -> str:
|
|
179
189
|
size_in_bytes = os.path.getsize(filename)
|
|
180
190
|
size_in_bytes = str(size_in_bytes)
|
|
@@ -182,7 +192,7 @@ class Episode(BaseModel):
|
|
|
182
192
|
return size_in_bytes
|
|
183
193
|
|
|
184
194
|
def enclosure(self) -> str:
|
|
185
|
-
enclosure = f"https://assets.library.nashville.org/talkinglibrary/shows/{self.bucket_folder}/{self.audio_filename}"
|
|
195
|
+
enclosure = f"https://dts.podtrac.com/redirect.mp3/assets.library.nashville.org/talkinglibrary/shows/{self.bucket_folder}/{self.audio_filename}"
|
|
186
196
|
self.notifications.prep_syslog(message=f"enclosure will be {enclosure}")
|
|
187
197
|
return enclosure
|
|
188
198
|
|
|
@@ -298,6 +308,9 @@ class Episode(BaseModel):
|
|
|
298
308
|
last_build_date = root.find('lastBuildDate')
|
|
299
309
|
last_build_date.text = self.pub_date() # fine to use this same pub date, as the format for both is the same
|
|
300
310
|
|
|
311
|
+
copyright = root.find("copyright")
|
|
312
|
+
copyright.text = self.copyright()
|
|
313
|
+
|
|
301
314
|
ET.indent(feed) # makes the XML pretty looking
|
|
302
315
|
self.notifications.prep_syslog(message=f"writing feed file...")
|
|
303
316
|
feed.write(self.feed_file, encoding="utf-8", xml_declaration=True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: talklib
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
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>
|
|
@@ -600,5 +600,6 @@ nyt.run()
|
|
|
600
600
|
````
|
|
601
601
|
- The tests can take a while to run. Watch the terminal output for progress.
|
|
602
602
|
- If the tests fail, you may have installed something incorrectly.
|
|
603
|
-
- You must be connected to the internet to run the tests
|
|
603
|
+
- You must be connected to the internet to run the tests.
|
|
604
|
+
- To update the version on PyPI, you must increment the version number in `pyproject.toml`
|
|
604
605
|
|
|
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
|