Add notes

This commit is contained in:
Josh Mudge 2018-11-16 15:40:06 -07:00
부모 a396e1457a
커밋 2453d44b6c
2개의 변경된 파일15개의 추가작업 그리고 2개의 파일을 삭제

파일 보기

@ -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
```

파일 보기

@ -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.