Browse Source

Add notes

master
Josh Mudge 6 years ago
parent
commit
2453d44b6c
  1. 11
      Sermon-Upload/README.md
  2. 6
      Sermon-Upload/sermon-upload.py

11
Sermon-Upload/README.md

@ -1,3 +1,14 @@
# Sermon Upload # Sermon Upload
Finds latest sermon based on input, uploads it, notifies the user whether or not it works. Sounds simple, it isn't. 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
```

6
Sermon-Upload/sermon-upload.py

@ -23,7 +23,9 @@ def upload(scrdir, dstdir, key, ssh): # Input has to end in /
list = sorted(glob.glob('*.mp3')) # Sort files alphabetically. list = sorted(glob.glob('*.mp3')) # Sort files alphabetically.
mostrecent = list[-1] # Find most recent sermon mostrecent = list[-1] # Find most recent sermon
secondrecent = list[-2] # Find second 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. sermonsrc = scrdir + mostrecent # Grab the most recent sermon to copy.
sermondst = dstdir + mostrecent # Destination for most recent sermon. 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(mostrecent)
#print(recentsermon) #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. # if str(mostrecent) == str(recentsermon): # If the most recent sermon uploaded matches the most recent sermon locally, we're good.

Loading…
Cancel
Save