Beispiel #1
0
def getTimes(for_date):
    prayTimes = PrayTimes()
    prayTimes.setMethod('test')
    new_settings = {
        "imsak": '10 min',
        "dhuhr": '0 min',
        "asr": 'Standard',
        "highLats": 'AngleBased',
        "maghrib": '-6 min'
    }

    offset = {
        "fajr": -2,
        "dhuhr": +5,
        "asr": +5,
        "maghrib": 0,
        "isha": -3
    }

    prayTimes.adjust(new_settings)
    prayTimes.tune(offset)
    isSummerTime = 1
    times = prayTimes.getTimes(for_date, places['berlin'], 1, dst=isSummerTime)

    return times
Beispiel #2
0
import time

praytime = PrayTimes()

# tune and adjustment based on shalat.landak.com
praytime.adjust({
  'fajr': 20,
  'dhuhr': '2 min',
  'maghrib': 1,
  'isha': 18
})

praytime.tune({
  'fajr': 2,
  'sunrise': -2,
  'asr': 2,
  'maghrib': 2,
  'isha': 2
})

translasi = {
    'imsak': 'Imsak',
    'fajr': 'Subuh',
    'dhuhr': 'Duhur',
    'asr': 'Ashar',
    'maghrib': 'Maghrib',
    'isha': 'Isya\'',
    'sunrise': 'matari terbit',
    'sunset': 'terdengar burung hantu'
}
Beispiel #3
0
# otherRand = randint(0, len(otherAzans)-1)
dhuhr = otherAzansDir + '/' + otherAzans[randint(0, len(otherAzans)-1)]
asr = otherAzansDir + '/' + otherAzans[randint(0, len(otherAzans)-1)]
maghrib = otherAzansDir + '/' + otherAzans[randint(0, len(otherAzans)-1)]
isha = otherAzansDir + '/' + otherAzans[randint(0, len(otherAzans)-1)]


pt = PrayTimes()
dsT = time.localtime().tm_isdst

dic = {'imsak':0, 'fajr':5, 'sunrise':0, 'dhuhr':0, 'asr':0, 'maghrib':-16, 'isha':4, 'midnight':0}

dt = date.today()
cords = (40.277310, -74.561890)
pt.tune(dic)


print(-(time.timezone/3600))

times = pt.getTimes(dt, cords, -(time.timezone/3600), dst=dsT)


system_cron = CronTab(user='******')

system_cron.remove_all(comment='pi-cronJobs')
# system_cron.remove_all(comment='daily_run')

def schedule(time, cmd, cmt):
	job = system_cron.new(command=cmd, comment=cmt)
	t = time.split(":")