Skip to content

Instantly share code, notes, and snippets.

@godber
Last active December 9, 2019 01:38
Show Gist options
  • Save godber/428e1cc2500fb9fed68fe9919a34f45b to your computer and use it in GitHub Desktop.
Save godber/428e1cc2500fb9fed68fe9919a34f45b to your computer and use it in GitHub Desktop.
DesertPy CI Examples
#!/usr/bin/env python
from dateutil.rrule import rrule, MONTHLY, WE, SA
from datetime import datetime
def main(year):
saturday_dates = list(
rrule(
freq=MONTHLY,
count=12,
byweekday=SA(2),
dtstart=datetime(year, 1, 1)
)
)
wednesday_dates = list(
rrule(
freq=MONTHLY,
count=12,
byweekday=WE(4),
dtstart=datetime(year, 1, 1)
)
)
print("DesertPy 2020 Schedule\n")
print("Wednesday Meetings")
print('\n'.join([x.strftime("%m/%d/%Y") for x in wednesday_dates]))
print("\nSaturday Meetings")
print('\n'.join([x.strftime("%m/%d/%Y") for x in saturday_dates]))
if __name__ == "__main__":
main(2020)
@godber
Copy link
Author

godber commented Dec 9, 2019

For 2020, prints out ...

DesertPy 2020 Schedule

Wednesday Meetings
01/22/2020
02/26/2020
03/25/2020
04/22/2020
05/27/2020
06/24/2020
07/22/2020
08/26/2020
09/23/2020
10/28/2020
11/25/2020
12/23/2020

Saturday Meetings
01/11/2020
02/08/2020
03/14/2020
04/11/2020
05/09/2020
06/13/2020
07/11/2020
08/08/2020
09/12/2020
10/10/2020
11/14/2020
12/12/2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment