Skip to content

Commit

Permalink
Resolved conflicts with upstream: that had hooks for pausing and playing
Browse files Browse the repository at this point in the history
  • Loading branch information
rehanhaider committed May 11, 2021
1 parent 0d0e7b4 commit 96926d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ This projects uses a python script which automatically calculates [adhan](https:
Run this command:

```bash
<<<<<<< HEAD
$ python3 /home/pi/adhan/updateAzaanTimers.py --lat <YOUR_LAT> --lng <YOUR_LNG> --method <METHOD>
=======
$ /home/pi/adhan/updateAzaanTimers.py --lat <YOUR_LAT> --lng <YOUR_LNG> --method <METHOD>
>>>>>>> b6d9738f886eaea16e056449693b338c441ea002
$ python3 /home/pi/adhan/updateAzaanTimers.py --lat <YOUR_LAT> --lon <YOUR_LNG> --method <METHOD>
```

Replace the arguments above with your location information and calculation method:
Expand All @@ -35,7 +31,6 @@ Replace the arguments above with your location information and calculation metho

If everythig worked, your output will look something like this:
```
<<<<<<< HEAD
---------------------------------
Co-ordinates provided
---------------------------------
Expand Down Expand Up @@ -63,22 +58,6 @@ Crob jobs scheduled
0 8 * * 5 omxplayer --vol 0 -o local /home/pi/Desktop/Github/adhan/media/002-surah-baqarah-mishary.mp3 > /dev/null 2>&1 # Surah Baqarah
---------------------------------
=======
20 60 Egypt 0 0
05:51
11:52
14:11
16:30
17:53
51 5 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-fajr.mp3 0 # rpiAdhanClockJob
52 11 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah.mp3 0 # rpiAdhanClockJob
11 14 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah.mp3 0 # rpiAdhanClockJob
30 16 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah.mp3 0 # rpiAdhanClockJob
53 17 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah.mp3 0 # rpiAdhanClockJob
0 1 * * * /home/pi/adhan/updateAzaanTimers.py >> /home/pi/adhan/adhan.log 2>&1 # rpiAdhanClockJob
@monthly truncate -s 0 /home/pi/adhan/adhan.log 2>&1 # rpiAdhanClockJob
Script execution finished at: 2017-01-06 21:22:31.512667
>>>>>>> b6d9738f886eaea16e056449693b338c441ea002
```

If you look at the last few lines, you'll see that 5 adhan times have been scheduled. Then there is another line at the end which makes sure that at 1am every day the same script will run and calculate adhan times for that day. And lastly, there is a line to clear logs on a monthly basis so that your log file doesn't grow too big.
Expand Down
9 changes: 1 addition & 8 deletions updateAzaanTimers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import argparse
from configparser import ConfigParser


root_dir = dirname(abspath(__file__))
sys.path.insert(0, pathjoin(root_dir, 'crontab'))
from modules.praytimes import PrayTimes
Expand Down Expand Up @@ -165,20 +166,12 @@ def addClearLogsCronJob (objCronTab, strCommand):
isDst = time.localtime().tm_isdst

now = datetime.datetime.now()
<<<<<<< HEAD
strPlayFajrAzaanMP3Command = f"omxplayer --vol {fajr_azaan_vol} -o local {root_dir}/media/Adhan-fajr.mp3 > /dev/null 2>&1"
strPlayAzaanMP3Command = f"omxplayer --vol {default_azaan_vol} -o local {root_dir}/media/Adhan-Makkah1.mp3 > /dev/null 2>&1"
strUpdateCommand = f"python {root_dir}/updateAzaanTimers.py >> {root_dir}/adhan.log 2>&1"
strClearLogsCommand = f"truncate -s 0 {root_dir}/adhan.log 2>&1"
strJobComment = "rpiAdhanClockJob"
strSurahBaqarahMP3Command = f"omxplayer --vol {surahVolume} -o local {root_dir}/media/002-surah-baqarah-mishary.mp3 > /dev/null 2>&1"
=======
strPlayFajrAzaanMP3Command = '{}/playAzaan.sh {}/Adhan-fajr.mp3 {}'.format(root_dir, root_dir, fajr_azaan_vol)
strPlayAzaanMP3Command = '{}/playAzaan.sh {}/Adhan-Madinah.mp3 {}'.format(root_dir, root_dir, azaan_vol)
strUpdateCommand = '{}/updateAzaanTimers.py >> {}/adhan.log 2>&1'.format(root_dir, root_dir)
strClearLogsCommand = 'truncate -s 0 {}/adhan.log 2>&1'.format(root_dir)
strJobComment = 'rpiAdhanClockJob'
>>>>>>> b6d9738f886eaea16e056449693b338c441ea002

# Remove existing jobs created by this script
system_cron.remove_all(comment=strJobComment)
Expand Down

0 comments on commit 96926d5

Please sign in to comment.