コード例 #1
0
ファイル: test_qiblah.py プロジェクト: vzool/pyIslam
def test_qiblah_jakarta():
    # https://www.mapcoordinates.net/en
    # jakarta
    latitude = -6.18233995
    longitude = 106.84287154
    timezone = 7  # GMT+7
    fajr_isha_method = 3  # University of Islamic Sciences, Karachi (UISK)
    asr_fiqh = 1  # Jomhor
    prayer_conf = PrayerConf(longitude, latitude, timezone, fajr_isha_method, asr_fiqh)

    assert Qiblah(prayer_conf).sixty() == "295° 8' 39''"
コード例 #2
0
def get_salaahs_time(longitude, latitude, timezone, fajr_isha_method,
                     asr_fiqh):
    pconf = PrayerConf(longitude, latitude, timezone, fajr_isha_method,
                       asr_fiqh)
    pt = Prayer(pconf, date.today())

    salaahs_time = {
        "fajr": pt.fajr_time(),
        "sherook": pt.sherook_time(),
        "dohr": pt.dohr_time(),
        "asr": pt.asr_time(),
        "maghreb": pt.maghreb_time(),
        "ishaa": pt.ishaa_time(),
    }
    return salaahs_time
コード例 #3
0
ファイル: test_praytimes.py プロジェクト: vzool/pyIslam
def test_praytimes_jakarta_fixed_interval():
    # jakarta
    latitude = -6.18233995
    longitude = 106.84287154
    timezone = 7  # GMT+7
    fajr_isha_method = 9  # "Fixed Ishaa Time Interval, 90min",
    asr_fiqh = 1  # Jomhor
    prayer_conf = PrayerConf(longitude, latitude, timezone, fajr_isha_method, asr_fiqh)
    prayer_time = Prayer(prayer_conf, date(2021, 4, 9))

    # other pryer times are same as the test above
    assert str(prayer_time.fajr_time()) == "04:38:36"
    assert str(prayer_time.ishaa_time()) == "19:24:14"
    assert str(prayer_time.second_third_of_night()) == "21:29:01"  # 1 st third
    assert str(prayer_time.midnight()) == "23:16:25"  # midnight
    assert str(prayer_time.last_third_of_night()) == "01:03:49"  # qiyam
コード例 #4
0
ファイル: test_praytimes.py プロジェクト: vzool/pyIslam
def test_praytimes_jakarta_umm_alqura():
    # jakarta
    latitude = -6.18233995
    longitude = 106.84287154
    timezone = 7  # GMT+7
    fajr_isha_method = 4  # Umm al-Qura University, Makkah (UMU)
    asr_fiqh = 1  # Jomhor
    prayer_conf = PrayerConf(longitude, latitude, timezone, fajr_isha_method, asr_fiqh)
    prayer_time = Prayer(prayer_conf, date(2021, 4, 9))

    # other pryer times are same as the test above
    assert str(prayer_time.fajr_time()) == "04:42:39"
    assert str(prayer_time.ishaa_time()) == "19:24:14"
    assert str(prayer_time.second_third_of_night()) == "21:30:22"  # 1 st third
    assert str(prayer_time.midnight()) == "23:18:26"  # midnight
    assert str(prayer_time.last_third_of_night()) == "01:06:30"  # qiyam
コード例 #5
0
ファイル: test_praytimes.py プロジェクト: vzool/pyIslam
def test_praytimes_jakarta():
    # tested against https://www.jadwalsholat.org/
    # and the result is extremely accurate

    # https://www.mapcoordinates.net/en
    # jakarta
    latitude = -6.18233995
    longitude = 106.84287154
    timezone = 7  # GMT+7
    fajr_isha_method = 7  # Ministry of Religious Affairs of Indonesia (KEMENAG)
    asr_fiqh = 1  # Jomhor
    prayer_conf = PrayerConf(longitude, latitude, timezone, fajr_isha_method, asr_fiqh)
    prayer_time = Prayer(prayer_conf, date(2021, 4, 9))

    assert str(prayer_time.fajr_time()) == "04:36:34"
    assert str(prayer_time.sherook_time()) == "05:54:14"
    assert str(prayer_time.dohr_time()) == "11:54:14"
    assert str(prayer_time.asr_time()) == "15:12:14"
    assert str(prayer_time.maghreb_time()) == "17:54:14"
    assert str(prayer_time.ishaa_time()) == "19:03:49"
    assert str(prayer_time.second_third_of_night()) == "21:28:21"  # 1 st third
    assert str(prayer_time.midnight()) == "23:15:24"  # midnight
    assert str(prayer_time.last_third_of_night()) == "01:02:28"  # qiyam
コード例 #6
0
    title = "Islamic Prayer"
    fieldNames = ["Enter your choice (from 1 to 5)"]
    fieldValues = []
    fieldValues = multenterbox(msg, title, fieldNames)

    fajr_isha_method = int(fieldValues[0])

    msg = "Choose the Asr Madhab\n\n1 = Shafii\n2 = Hanafi"
    title = "Islamic Prayer"
    fieldNames = ["Enter your choice (from 1 or 2)"]
    fieldValues = []
    fieldValues = multenterbox(msg, title, fieldNames)

    asr_fiqh = int(fieldValues[0])

pconf = PrayerConf(longitude, latitude, timezone, fajr_isha_method, asr_fiqh)

pt = Prayer(pconf, date.today())
hijri = HijriDate.today()

0

image = isworld
msg = "Prayer Times\n\nFajr:    " + str(
    pt.fajr_time()) + str("\nSherook: " + str(pt.sherook_time())) + str(
        "\nDohr:    " + str(pt.dohr_time())
    ) + str("\nAsr:     " + str(pt.asr_time())) + str("\nMaghreb: " + str(
        pt.maghreb_time())) + str("\nIshaa:   " + str(pt.ishaa_time())) + str(
            "\n\nQiblah direction from the north: " + Qiblah(pconf).sixty())
choices = ["Ok"]
reply = buttonbox(msg, image=image, choices=choices)