-
Notifications
You must be signed in to change notification settings - Fork 9
/
example-salat.py
90 lines (75 loc) · 2.01 KB
/
example-salat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/python3
from iclib import salat
import datetime as dt
date = dt.date.today()
print('Date:', date)
print()
def _egypt_init():
c = salat.TimeCalculator().date(date) \
.location(-6.38043079, 106.85337984, 0, 7) \
.method('egypt')
return date, c.calculate()
def egypt_gettime():
date, t = _egypt_init()
for i in (salat.FAJR, salat.SUNRISE, salat.ZUHR, salat.ASR,
salat.MAGHRIB, salat.ISHA):
print(t.get_time(i).strftime('%H:%M'))
def egypt_property_withsec():
date, t = _egypt_init()
t.use_second = True
print(t.fajr)
print(t.sunrise)
print(t.zuhr)
print(t.asr)
print(t.maghrib)
print(t.isha)
def egypt_iter_noadjust():
c = salat.TimeCalculator().date(date) \
.location(-6.38043079, 106.85337984, 0, 7) \
.method('egypt', None, {})
t = c.calculate()
for i in t:
print(i)
def muhammadiyah():
c = salat.TimeCalculator().date(date) \
.location(-6.38043079, 106.85337984, 0, 7) \
.method('muhammadiyah')
for i in c.calculate():
print(i)
def mwl_noadjust():
c = salat.TimeCalculator().date(date) \
.location(-6.38043079, 106.85337984, 0, 7) \
.method('mwl', 'majority', {})
for i in c.calculate():
print(i)
def mwl_hanafi_noadjust():
c = salat.TimeCalculator().date(date) \
.location(-6.38043079, 106.85337984, 0, 7) \
.method('mwl', 'hanafi', {})
for i in c.calculate():
print(i)
def mwl_noadjust_100m():
c = salat.TimeCalculator().date(date) \
.location(-6.38043079, 106.85337984, 100, 7) \
.method('mwl', 'majority', {})
for i in c.calculate():
print(i)
def mwl_1jan2015():
c = salat.TimeCalculator().gregorian_date(2015, 1, 1) \
.location(-6.38043079, 106.85337984, 0, 7) \
.method('mwl')
for i in c.calculate():
print(i)
def mwl_1jan2015_tomorrow():
c = salat.TimeCalculator().gregorian_date(2015, 1, 1) \
.location(-6.38043079, 106.85337984, 0, 7) \
.method('mwl')
c.date_relative(+1)
for i in c.calculate():
print(i)
loc = sorted(locals().items())
for k,v in loc:
if not k.startswith('_') and callable(v):
print('-' * 5, k, '-' * 5)
v()
print()