Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
EventGen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
chaotikum
EventGen
Commits
993b014e
Commit
993b014e
authored
1 year ago
by
Lukas Ruge
Browse files
Options
Downloads
Patches
Plain Diff
mehr vorlagen, mehr logig
parent
36b2b0c1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
5min.txt
+18
-0
18 additions, 0 deletions
5min.txt
main.py
+84
-8
84 additions, 8 deletions
main.py
nook.txt
+17
-0
17 additions, 0 deletions
nook.txt
with
119 additions
and
8 deletions
5min.txt
0 → 100644
+
18
−
0
View file @
993b014e
---
layout: [eventcal]
title: "5 Minuten Termine"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
contact: info@chaotikum.org
stream: tbd
recording: true
locations:
- Augenprüfraum
sets:
- kofferblau
short: "Du hast 300 Sekunden: Was ist dein Thema?"
---
This diff is collapsed.
Click to expand it.
main.py
+
84
−
8
View file @
993b014e
...
...
@@ -22,10 +22,18 @@ OSM = False
BITSUNDBAEUME
=
False
# jeden zweiten Dienstag im Monat um 18:31
#Freifunk Lübeck
FFHLORGA
=
Tru
e
#
Freifunk Lübeck
FFHLORGA
=
Fals
e
# jeden dritten Donnerstag im Monat 19:00 bis 22:00 Uhr
# Nook
NOOK
=
False
# zweiter freitag im Npvember (und der darauf folgende samsatag)
# Fünf Minuten Termine
FUENF_MIN_TERMINE
=
True
# üblicherweise am vierten Mitwoch im letzten monat des quartals außer dezember (also März, Juni, September)
year
=
2024
start_date_string
=
str
(
year
)
+
"
-01-01
"
end_date_string
=
str
(
year
)
+
"
-12-31
"
...
...
@@ -82,10 +90,19 @@ 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_nth_wednesday_of_month
(
_date_candidate
,
_n
):
return
is_nth_xday_of_month
(
_date_candidate
,
_date_candidate
.
year
,
_date_candidate
.
month
,
_n
,
2
)
def
is_nth_friday_of_month
(
_date_candidate
,
_n
):
return
is_nth_xday_of_month
(
_date_candidate
,
_date_candidate
.
year
,
_date_candidate
.
month
,
_n
,
4
)
def
is_plenum
(
_date_candidate
):
if
not
mo
==
11
and
is_nth_thursday_of_month
(
_date_candidate
,
2
):
_mo
=
_date_candidate
.
month
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
):
if
_
mo
==
11
and
is_nth_thursday_of_month
(
_date_candidate
,
3
):
return
True
return
False
...
...
@@ -99,15 +116,12 @@ def is_reinigung(_date_candidate):
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
...
...
@@ -118,6 +132,21 @@ def is_ffhl(_date_candidate):
return
True
return
False
def
is_nook
(
_date_candidate
):
_mo
=
_date_candidate
.
month
if
_mo
==
11
and
is_nth_friday_of_month
(
_date_candidate
,
2
):
return
True
def
is_fuenf_min
(
_date_candidate
):
_mo
=
_date_candidate
.
month
if
_mo
==
3
or
_mo
==
6
or
_mo
==
9
:
if
is_nth_wednesday_of_month
(
_date_candidate
,
4
):
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
"
))
...
...
@@ -134,6 +163,10 @@ def set_uuid(_template, _uuid):
return
_template
.
replace
(
"
<UUID>
"
,
str
(
_uuid
))
def
set_year
(
_template
,
_year
):
return
_template
.
replace
(
"
<YEAR>
"
,
str
(
_year
))
def
create_open_space
(
_date
):
with
open
(
'
openspace.txt
'
)
as
f
:
_openspace_template
=
f
.
read
()
...
...
@@ -217,7 +250,7 @@ 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
))
_start
=
cet
.
localize
(
_date
.
replace
(
hour
=
18
,
minute
=
00
,
second
=
00
))
_end
=
cet
.
localize
(
_date
.
replace
(
hour
=
22
,
minute
=
00
,
second
=
00
))
_ffhl_orga_template
=
set_start_date
(
_ffhl_orga_template
,
_start
)
...
...
@@ -228,6 +261,41 @@ def create_ffhl(_date):
with
open
(
"
created/
"
+
filename
,
'
w
'
)
as
out
:
out
.
write
(
_ffhl_orga_template
)
def
create_nook
(
_date
):
with
open
(
'
nook.txt
'
)
as
f
:
_nook_template
=
f
.
read
()
_start
=
cet
.
localize
(
_date
.
replace
(
hour
=
17
,
minute
=
00
,
second
=
00
))
_end
=
cet
.
localize
(
_date
.
replace
(
hour
=
22
,
minute
=
59
,
second
=
00
))
_end
+=
datetime
.
timedelta
(
days
=
1
)
# nnok has two days
_nook_template
=
set_start_date
(
_nook_template
,
_start
)
_nook_template
=
set_end_date
(
_nook_template
,
_end
)
_nook_template
=
set_uuid
(
_nook_template
,
uuid
.
uuid4
())
_nook_template
=
set_year
(
_nook_template
,
_start
.
year
)
filename
=
_start
.
strftime
(
"
%Y-%m-%d
"
)
+
"
-nook.md
"
with
open
(
"
created/
"
+
filename
,
'
w
'
)
as
out
:
out
.
write
(
_nook_template
)
def
create_fuenf_min
(
_date
):
with
open
(
'
5min.txt
'
)
as
f
:
_5min_template
=
f
.
read
()
_start
=
cet
.
localize
(
_date
.
replace
(
hour
=
20
,
minute
=
00
,
second
=
00
))
_end
=
cet
.
localize
(
_date
.
replace
(
hour
=
21
,
minute
=
59
,
second
=
00
))
_5min_template
=
set_start_date
(
_5min_template
,
_start
)
_5min_template
=
set_end_date
(
_5min_template
,
_end
)
_5min_template
=
set_uuid
(
_5min_template
,
uuid
.
uuid4
())
filename
=
_start
.
strftime
(
"
%Y-%m-%d
"
)
+
"
-5min.md
"
with
open
(
"
created/
"
+
filename
,
'
w
'
)
as
out
:
out
.
write
(
_5min_template
)
date_to_check
=
start_date
while
date_to_check
<=
end_date
:
if
OPENSPACE
:
...
...
@@ -254,5 +322,13 @@ while date_to_check <= end_date:
result
=
is_ffhl
(
date_to_check
)
if
result
:
create_ffhl
(
date_to_check
)
if
NOOK
:
result
=
is_nook
(
date_to_check
)
if
result
:
create_nook
(
date_to_check
)
if
FUENF_MIN_TERMINE
:
result
=
is_fuenf_min
(
date_to_check
)
if
result
:
create_fuenf_min
(
date_to_check
)
date_to_check
+=
datetime
.
timedelta
(
days
=
1
)
This diff is collapsed.
Click to expand it.
nook.txt
0 → 100644
+
17
−
0
View file @
993b014e
---
layout: [eventcal]
title: "NooK <YEAR>"
eventdate: <EVENTSTART>
eventend: <EVENTEND>
#https://www.uuidgenerator.net/
uid: <UUID>
contact: contact@nook-luebeck.de
organizer: NooK Orga
recording: true
stream: https://<YEAR>.nook-luebeck.de/live
locations:
- Audimax Uni Lübeck
sets:
- leihbar
short: "Zweitägige Konferenz auf dem Campus der Uni Lübeck mit vielen Vorträgen, Ständen, Kunst und spannenden Themen."
---
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment