Skip to content
Snippets Groups Projects
Commit 36b2b0c1 authored by Lukas Ruge's avatar Lukas Ruge
Browse files

initial

parents
No related branches found
No related tags found
No related merge requests found
---
layout: [eventcal]
title: "Bits und Bäume Lübeck - Treffen"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
contact: yksflip@chaotikum.org
locations:
- Wartezimmer
short: "Wir treffen uns jeden zweiten Dienstag im Monat um 18:31, um uns über Nachhaltigkeit und Digitalisierung auszutauschen."
---
---
layout: [eventcal]
title: "FFHL Treffen"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
contact: info@luebeck.freifunk.net
organizer: Freifunk Lübeck
locations:
- Augenprüfraum
short: "Monatliches Treffen der Freifunk-Lübeck Orga-Gruppe."
---
main.py 0 → 100644
import datetime
import pytz
import uuid
# open Space
OPENSPACE = False
# every wednesday 19:00 to 23:59:59 but not between (and including) 24.12 and 1.1
# cleaning
REINIGUNG = False
# wednesday from 09:00 to 18:00
# plenum
PLENUM = False
# second thursday of the month, except in november, where it is the third
# osm
OSM = False
# vierter donnerstag in ungeraden monaten
# bits und Bäume Lübeck
BITSUNDBAEUME = False
# jeden zweiten Dienstag im Monat um 18:31
#Freifunk Lübeck
FFHLORGA = True
# jeden dritten Donnerstag im Monat 19:00 bis 22:00 Uhr
year = 2024
start_date_string = str(year) + "-01-01"
end_date_string = str(year) + "-12-31"
date_format = '%Y-%m-%d'
start_date = datetime.datetime.strptime(start_date_string, date_format)
end_date = datetime.datetime.strptime(end_date_string, date_format)
cet = pytz.timezone('Europe/Berlin')
def is_open_space(_date_candidate):
wd = _date_candidate.weekday()
md = _date_candidate.day
mo = _date_candidate.month
if mo == 1 and md == 1:
return False
if mo == 12 and md > 23:
return False
if not wd == 2:
return False
return True
def is_nth_xday_of_month(_date_candidate, _year, _mo, _n, _x):
print(_date_candidate)
print("is " + str(_n) + "th " + str(_x) + "day of " + str(_mo));
_start_string = str(_year) + "-" + str(_mo) + "-01"
if _mo < 10:
_start_string = str(_year) + "-0" + str(_mo) + "-01"
_start = datetime.datetime.strptime(_start_string, date_format)
counter = 0
while _start.month == _mo:
if _start.weekday() == _x:
print("ok, its an " + str(_x) + "day")
counter = counter + 1
print("counter " + str(counter))
if counter == _n:
print("????")
print(_start)
print(_date_candidate)
if _start == _date_candidate:
return True
_start += datetime.timedelta(days=1)
return False
def is_nth_thursday_of_month(_date_candidate, _n):
return is_nth_xday_of_month(_date_candidate, _date_candidate.year, _date_candidate.month, _n, 3)
def is_nth_tuesday_of_month(_date_candidate, _n):
return is_nth_xday_of_month(_date_candidate, _date_candidate.year, _date_candidate.month, _n, 1)
def is_plenum(_date_candidate):
if not mo == 11 and is_nth_thursday_of_month(_date_candidate, 2):
return True
if mo == 11 and is_nth_thursday_of_month(_date_candidate, 3):
return True
return False
def is_reinigung(_date_candidate):
wd = _date_candidate.weekday()
if wd == 2:
return True
return False
def is_osm(_date_candidate):
_mo = _date_candidate.month
_year = _date_candidate.year
if _mo % 2 == 1 and is_nth_thursday_of_month(_date_candidate, 4):
return True
return False
def is_bits_und_baeume(_date_candidate):
_year = _date_candidate.year
_mo = _date_candidate.month
if is_nth_tuesday_of_month(_date_candidate, 1):
return True
return False
def is_ffhl(_date_candidate):
if is_nth_thursday_of_month(_date_candidate, 3):
return True
return False
def replace_date_in_template(_template, _tag, _date):
return _template.replace(_tag, _date.strftime("%Y-%m-%d %H:%M:%S %z"))
def set_start_date(_template, _date):
return replace_date_in_template(_template, "<EVENTSTART>", _date)
def set_end_date(_template, _date):
return replace_date_in_template(_template, "<EVENTEND>", _date)
def set_uuid(_template, _uuid):
return _template.replace("<UUID>", str(_uuid))
def create_open_space(_date):
with open('openspace.txt') as f:
_openspace_template = f.read()
_start = cet.localize(_date.replace(hour=19, minute=00, second=00))
_end = cet.localize(_date.replace(hour=23, minute=59, second=00))
_openspace_template = set_start_date(_openspace_template, _start)
_openspace_template = set_end_date(_openspace_template, _end)
_openspace_template = set_uuid(_openspace_template, uuid.uuid4())
filename = _start.strftime("%Y-%m-%d") + "-openspace.md"
with open("created/" + filename, 'w') as out:
out.write(_openspace_template)
def create_plenum(_date):
with open('plenum.txt') as f:
_plenum_template = f.read()
_start = cet.localize(_date.replace(hour=19, minute=00, second=00))
_end = cet.localize(_date.replace(hour=20, minute=00, second=00))
_plenum_template = set_start_date(_plenum_template, _start)
_plenum_template = set_end_date(_plenum_template, _end)
_plenum_template = set_uuid(_plenum_template, uuid.uuid4())
filename = _start.strftime("%Y-%m-%d") + "-plenum.md"
with open("created/" + filename, 'w') as out:
out.write(_plenum_template)
def create_reinigung(_date):
with open('reinigung.txt') as f:
_reinigung_template = f.read()
_start = cet.localize(_date.replace(hour=9, minute=00, second=00))
_end = cet.localize(_date.replace(hour=18, minute=00, second=00))
_reinigung_template = set_start_date(_reinigung_template, _start)
_reinigung_template = set_end_date(_reinigung_template, _end)
_reinigung_template = set_uuid(_reinigung_template, uuid.uuid4())
filename = _start.strftime("%Y-%m-%d") + "-reinigung.md"
with open("created/" + filename, 'w') as out:
out.write(_reinigung_template)
def create_osm(_date):
with open('osm.txt') as f:
_osm_template = f.read()
_start = cet.localize(_date.replace(hour=19, minute=00, second=00))
_end = cet.localize(_date.replace(hour=22, minute=00, second=00))
_osm_template = set_start_date(_osm_template, _start)
_osm_template = set_end_date(_osm_template, _end)
_osm_template = set_uuid(_osm_template, uuid.uuid4())
filename = _start.strftime("%Y-%m-%d") + "-osm.md"
with open("created/" + filename, 'w') as out:
out.write(_osm_template)
def create_bits_und_baeume(_date):
with open('bitsundbäume-treffen.txt') as f:
_bitsundbaeume_template = f.read()
_start = cet.localize(_date.replace(hour=18, minute=31, second=00))
_end = cet.localize(_date.replace(hour=22, minute=00, second=00))
_bitsundbaeume_template = set_start_date(_bitsundbaeume_template, _start)
_bitsundbaeume_template = set_end_date(_bitsundbaeume_template, _end)
_bitsundbaeume_template = set_uuid(_bitsundbaeume_template, uuid.uuid4())
filename = _start.strftime("%Y-%m-%d") + "-bitsundbaeume-treffen.md"
with open("created/" + filename, 'w') as out:
out.write(_bitsundbaeume_template)
def create_ffhl(_date):
with open('ffhl-orga.txt') as f:
_ffhl_orga_template = f.read()
_start = cet.localize(_date.replace(hour=18, minute=31, second=00))
_end = cet.localize(_date.replace(hour=22, minute=00, second=00))
_ffhl_orga_template = set_start_date(_ffhl_orga_template, _start)
_ffhl_orga_template = set_end_date(_ffhl_orga_template, _end)
_ffhl_orga_template = set_uuid(_ffhl_orga_template, uuid.uuid4())
filename = _start.strftime("%Y-%m-%d") + "-ffhl-orga.md"
with open("created/" + filename, 'w') as out:
out.write(_ffhl_orga_template)
date_to_check = start_date
while date_to_check <= end_date:
if OPENSPACE:
result = is_open_space(date_to_check)
if result:
create_open_space(date_to_check)
if PLENUM:
result = is_plenum(date_to_check)
if result:
create_plenum(date_to_check)
if REINIGUNG:
result = is_reinigung(date_to_check)
if result:
create_reinigung(date_to_check)
if OSM:
result = is_osm(date_to_check)
if result:
create_osm(date_to_check)
if BITSUNDBAEUME:
result = is_bits_und_baeume(date_to_check)
if result:
create_bits_und_baeume(date_to_check)
if FFHLORGA:
result = is_ffhl(date_to_check)
if result:
create_ffhl(date_to_check)
date_to_check += datetime.timedelta(days=1)
---
layout: [eventcal]
title: "Open Space/Chaostreff"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
contact: info@chaotikum.org
locations:
- Augenprüfraum
- Wartezimmer
- Lager
- Confy Zone
short: "Jeden Mittwoch findet im Nobreakspace das Chaostreff und der Open Space statt. Schaut gerne vorbei."
---
osm.txt 0 → 100644
---
layout: [eventcal]
title: "OSM-Stammtisch"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
contact: luebeck@lists.openstreetmap.de
organizer: OSM Lübeck
locations:
- Augenprüfraum
- Confy Zone
short: "Stammtisch von und für OpenStreetMap Begeisterte"
---
---
layout: [eventcal]
title: "Plenum"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
contact: info@chaotikum.org
locations:
- Augenprüfraum
short: "Was passiert gerade im Space. Was plant ihr? Was würdet ihr gerne besprechen? Bringt eure Themen rund um die Nbsp-Community mit."
---
---
layout: [eventcal]
title: "Zeitfenster Reinigungsdienst: Bitte Flächen freimachen!"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
nofrontpage: true
contact: info@chaotikum.org
locations:
- Augenprüfraum
- Wartezimmer
- Confy Zone
short: "Das Reinigungsunternehmen reinigt den Space."
---
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment