From 96926d5dfc332ea96e36ab7ebbb03a4d71225cfa Mon Sep 17 00:00:00 2001 From: justgoodin Date: Tue, 11 May 2021 18:04:31 +0530 Subject: [PATCH] Resolved conflicts with upstream: that had hooks for pausing and playing --- README.md | 23 +---------------------- updateAzaanTimers.py | 9 +-------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 74b1291..673138b 100644 --- a/README.md +++ b/README.md @@ -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 --lng --method -======= -$ /home/pi/adhan/updateAzaanTimers.py --lat --lng --method ->>>>>>> b6d9738f886eaea16e056449693b338c441ea002 +$ python3 /home/pi/adhan/updateAzaanTimers.py --lat --lon --method ``` Replace the arguments above with your location information and calculation method: @@ -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 --------------------------------- @@ -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. diff --git a/updateAzaanTimers.py b/updateAzaanTimers.py index 479d049..5f4b444 100644 --- a/updateAzaanTimers.py +++ b/updateAzaanTimers.py @@ -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 @@ -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)