Add notes

This commit is contained in:
Josh Mudge 2018-11-16 15:40:06 -07:00
parent a396e1457a
commit 2453d44b6c
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,14 @@
# Sermon Upload
Finds latest sermon based on input, uploads it, notifies the user whether or not it works. Sounds simple, it isn't.
# Requirements
Install `notify2` and `dbus-python` and other dependencies:
```
sudo apt-get install libgtk2.0-dev libdbus-1-dev
```
```
pip install dbus-python notify2
```

View File

@ -23,7 +23,9 @@ def upload(scrdir, dstdir, key, ssh): # Input has to end in /
list = sorted(glob.glob('*.mp3')) # Sort files alphabetically.
mostrecent = list[-1] # Find most recent sermon
secondrecent = list[-2] # Find second most recent sermon
#print(mostrecent)
#mostrecent = re.sub (' ', '\\', mostrecent) # NOTE to self: figure out a way to handle spaces.
#print(mostrecent)
sermonsrc = scrdir + mostrecent # Grab the most recent sermon to copy.
sermondst = dstdir + mostrecent # Destination for most recent sermon.
@ -55,7 +57,7 @@ def upload(scrdir, dstdir, key, ssh): # Input has to end in /
#print(mostrecent)
#print(recentsermon)
if recentsermon == sermondst:
if recentsermon == sermondst: # NOTE: to self: add option to skip notification for no dependencies
# if str(mostrecent) == str(recentsermon): # If the most recent sermon uploaded matches the most recent sermon locally, we're good.