diff --git a/eventgenutils.py b/eventgenutils.py index c462667eee2b8d8fe00c00d966ee1522efc12e5b..669ba1a9477b43ad4084504465f6ee53c981c803 100644 --- a/eventgenutils.py +++ b/eventgenutils.py @@ -77,6 +77,13 @@ def is_first_monday_of_month_except_january_an_may_if_monday_is_first(_date_cand return is_nth_monday_of_month(_date_candidate, 1) +def is_third_monday_of_month_and_uneven_month_before_june_or_before_september(_date_candidate): + if is_january(_date_candidate) or is_march(_date_candidate) or is_may(_date_candidate) or is_june( + _date_candidate) or is_july(_date_candidate) or is_august(_date_candidate) or is_september(_date_candidate): + return is_nth_monday_of_month(_date_candidate, 3) + return False + + def first_saturday_after_may_10th(_date_candidate): _year = _date_candidate.year _start_string = str(_year) + "-05-10" @@ -132,6 +139,10 @@ def is_july(_date_candidate): return _date_candidate.month == 7 +def is_august(_date_candidate): + return _date_candidate.month == 8 + + def is_september(_date_candidate): return _date_candidate.month == 9 @@ -196,4 +207,3 @@ def create_event(_name, _date, start_hour=00, start_minute=00, end_hour=23, end_ with open("created/" + get_filename(_start, _name), 'w') as out: out.write(_template) - diff --git a/main.py b/main.py index b9b2ba543d5afeb705e3b216f0abc99de35393e3..9c1e0e17b947c5b5ff1eb18ae1abaf13e9f2e0db 100644 --- a/main.py +++ b/main.py @@ -4,16 +4,16 @@ import eventgenutils as utils ################################################# # set true if you want to generate files for that event type ################################################# -OPENSPACE = False +OPENSPACE = True # every wednesday 19:00 to 23:59:59 but not between (and including) 24.12 and 1.1 REINIGUNG = False # wednesday from 09:00 to 18:00 -PLENUM = False +PLENUM = True # second thursday of the month, except in november, where it is the third -OSM = False +OSM = True # vierter donnerstag in ungeraden monaten SWK = False @@ -22,23 +22,23 @@ SWK = False BITSUNDBAEUME = True # jeden zweiten Dienstag im Monat um 18:31... -FFHLORGA = False +FFHLORGA = True # jeden dritten Donnerstag im Monat 19:00 bis 22:00 Uhr -NOOK = False +NOOK = True # zweiter freitag im November (und der darauf folgende Samstag) -FUENF_MIN_TERMINE = False +FUENF_MIN_TERMINE = True # Üblicherweise Zweiter Mittwoch im ersten Monat des Quartals -SOMMERFEST = False +SOMMERFEST = True # Üblicherweise der erste Samstag nach dem 10 Mai. 15:00 bis 23:59 -TAG_DES_OFFENEN_HACKSPACES = False +TAG_DES_OFFENEN_HACKSPACES = True # https://wiki.hackerspaces.org/International_Open_Hackerspace_Day # The International Open Hackerspace Day is happening every last Saturday of March. -MOINC3 = False +MOINC3 = True # Congress. MAUS_TUEROEFFNER_TAG = False @@ -47,10 +47,13 @@ MAUS_TUEROEFFNER_TAG = False GETTING_SPACE_CLEAN = False # Erster Montag des Monats, außer das ist der 01.01 oder 01.05, dann der zweite Montag dieser Monate +NOOK_ORGA = True +# Dritter Montag jeden zweiten Monat von januar bis Mai, dann monatlich von Juni bis September + ################################################# # Year to create events for ################################################# -YEAR = 2024 # Change to generate for another year +YEAR = 2025 # Change to generate for another year def is_open_space(_date_candidate): @@ -129,6 +132,8 @@ def is_maus_tueroeffner_tag(_date_candidate): def is_getting_space_clean(_date_candidate): return utils.is_first_monday_of_month_except_january_an_may_if_monday_is_first(_date_candidate) +def is_nook_orga(_date_candidate): + return utils.is_third_monday_of_month_and_uneven_month_before_june_or_before_september(_date_candidate) def create_open_space(_date): utils.create_event("openspace", _date, start_hour=19) @@ -177,6 +182,8 @@ def create_moin_c3(_date): def create_getting_space_clean(_date): utils.create_event("getting-space-clean", _date, start_hour=18, start_minute=30, end_hour=20, end_minute=00) +def create_nook_orga(_date): + utils.create_event("nook-orga", _date, start_hour=19, start_minute=30, end_hour=21, end_minute=00) def create_maus_tueroeffner_tag(_date): utils.create_event("maus", _date, start_hour=14, end_hour=19, end_minute=00) @@ -236,5 +243,9 @@ while date_to_check <= datetime.datetime.strptime(str(YEAR) + "-12-31", utils.da result = is_getting_space_clean(date_to_check) if result: create_getting_space_clean(date_to_check) + if NOOK_ORGA: + result= is_nook_orga(date_to_check) + if result: + create_nook_orga(date_to_check) date_to_check += datetime.timedelta(days=1) diff --git a/nook-orga.txt b/nook-orga.txt new file mode 100644 index 0000000000000000000000000000000000000000..4c880850bffd3a546a02843ed6ba0b3235e09e57 --- /dev/null +++ b/nook-orga.txt @@ -0,0 +1,14 @@ +--- +layout: [eventcal] +title: "NooK Orga" +eventdate: <EVENTSTART> +eventend: <EVENTEND> +#https://www.uuidgenerator.net/ +uid: <UUID> +contact: contact@nook-luebeck.de +locations: + - Augenprüfraum +short: "NooK Orga ist das ganze Jahr über. Jan. bis Jun. alle zwei Monate, dann monatlich bis Sep. Dann öfter." +--- + +