forked from Decentrala/website
Compare commits
18 Commits
62778e2679
...
df32ef6116
Author | SHA1 | Date | |
---|---|---|---|
df32ef6116 | |||
c3da6e392d | |||
81f136b7cb | |||
5edf754421 | |||
ac0d32559c | |||
7df04ecf71 | |||
25662d7bda | |||
12235ab51e | |||
62da74bf99 | |||
a321ebe765 | |||
a70fd1369e | |||
768f1c66e6 | |||
fb50c076fe | |||
b31a1b5ebf | |||
ab15c97e5e | |||
702ab07e03 | |||
3232cdcf09 | |||
aec8f74ed2 |
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/python3
|
||||
#! /usr/bin/env python3
|
||||
|
||||
# needs lowdown and feegden installed
|
||||
# feedgen can be installed with pip
|
||||
|
1
blog.py
Normal file → Executable file
1
blog.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
||||
#! /usr/bin/env python3
|
||||
# just testing markdown library for now
|
||||
|
||||
from markdown import markdown as to_markdown
|
||||
|
1
build_pages.py
Normal file → Executable file
1
build_pages.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
||||
#! /usr/bin/env python3
|
||||
import os
|
||||
|
||||
PAGES = [
|
||||
|
@ -1,5 +1,5 @@
|
||||
datum, vreme, lokacija, tema
|
||||
20-12-2022, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u računarske mreze, firewall
|
||||
20-12-2022, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u računarske mreže
|
||||
03-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton žurka
|
||||
16-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Radionica privatnosti na internetu
|
||||
04-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton žurka
|
||||
@ -24,14 +24,14 @@ datum, vreme, lokacija, tema
|
||||
17-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lan party
|
||||
18-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pentest radionica nastavak
|
||||
23-04-2023, 19:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u mreže
|
||||
03-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, Otvaranje izlozbe (Q&A)
|
||||
03-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, Otvaranje izložbe (Q&A)
|
||||
03-05-2023, 18:00, KC Grad https://www.openstreetmap.org/node/4118716889, Linux install fest
|
||||
04-05-2023, 17:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
|
||||
04-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u racunarske mreze
|
||||
04-05-2023, 17:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izložba (Q&A)
|
||||
04-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u računarske mreže
|
||||
04-05-2023, 21:00, n/a, Online sastanak sa Zajednicom za slobodnu tehnologiju iz Kikinde
|
||||
05-05-2023, 15:30, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
|
||||
06-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
|
||||
07-05-2023, 16:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (diskusija)
|
||||
05-05-2023, 15:30, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izložba (Q&A)
|
||||
06-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izložba (Q&A)
|
||||
07-05-2023, 16:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izložba (diskusija)
|
||||
08-05-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Linux install day
|
||||
09-05-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cryptoparty - Uvod u privatnost
|
||||
11-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u računarske mreže
|
||||
@ -45,7 +45,7 @@ datum, vreme, lokacija, tema
|
||||
27-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
|
||||
03-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, DNS
|
||||
04-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
|
||||
10-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Blender, 3D modelovanje
|
||||
10-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Blender
|
||||
11-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
|
||||
17-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, OpenGL
|
||||
18-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
|
||||
@ -65,7 +65,17 @@ datum, vreme, lokacija, tema
|
||||
05-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity - phishing
|
||||
11-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Radionica kreativnog pisanja
|
||||
12-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tehno veče
|
||||
18-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Stop reklamama - diskusija
|
||||
19-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity - kako početi?
|
||||
18-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity - kako početi?
|
||||
19-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Stop reklamama - diskusija
|
||||
25-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Email server E02
|
||||
26-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lambda racun E02
|
||||
26-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lambda račun E02
|
||||
02-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šamirov algoritam za deljenje tajni
|
||||
03-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hackathon
|
||||
09-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lighting talks
|
||||
14-10-2023, 12:00, Matematički Fakultet (učionica 821) https://www.openstreetmap.org/node/4705189523, Linux install day
|
||||
16-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Audio radionica
|
||||
17-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Libreboot
|
||||
23-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tor
|
||||
24-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Proslava rođendana Decentrale
|
||||
30-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Rešavanje Rubikove kocke
|
||||
31-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Vim
|
||||
|
|
43
image_poster.py
Normal file → Executable file
43
image_poster.py
Normal file → Executable file
@ -1,5 +1,6 @@
|
||||
#! /usr/bin/env python
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import freetype
|
||||
import io
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
@ -8,13 +9,19 @@ import datetime as dt
|
||||
from dateutil import relativedelta
|
||||
|
||||
CURRENT_TIME = dt.date.today()
|
||||
NEXT_MONTH = CURRENT_TIME
|
||||
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
|
||||
DAYS_OF_WEEK_SR = ("PON", "UTO", "SRE", "ČET", "PET", "SUB", "NED")
|
||||
MONTHS_SR = ("Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust",\
|
||||
"Septembar", "Oktobar", "Novembar", "Decembar")
|
||||
|
||||
def parseArgs(parser):
|
||||
"""
|
||||
Parse all arguments and return the list of argument values
|
||||
"""
|
||||
parser.add_argument("month", metavar = "MM", help = "two digit number representing the month for which to generate poster", default = "empty", nargs = "?")
|
||||
return parser.parse_args()
|
||||
|
||||
def load_events(csv_path:str) -> list[dict]:
|
||||
def load_events(csv_path:str, month:int) -> list[dict]:
|
||||
events = []
|
||||
with open(csv_path) as csv_file:
|
||||
csv_reader = csv.reader(csv_file)
|
||||
@ -27,11 +34,11 @@ def load_events(csv_path:str) -> list[dict]:
|
||||
current_event = {"date":event_date_parsed,
|
||||
"time":event_time,
|
||||
"title":event_title.strip()}
|
||||
if event_date_parsed >= NEXT_MONTH:
|
||||
if event_date_parsed >= month:
|
||||
events.append(current_event)
|
||||
return events
|
||||
|
||||
def drawPoster(events, bg, fg):
|
||||
def drawPoster(events, bg, fg, month:int):
|
||||
fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=110)
|
||||
fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=60)
|
||||
fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=45)
|
||||
@ -45,12 +52,15 @@ def drawPoster(events, bg, fg):
|
||||
_, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade)
|
||||
draw.text(((W-w)/2, 120), header, font=fontFacade, fill=fg)
|
||||
|
||||
subheader = f"Plan za {MONTHS_SR[NEXT_MONTH.month - 1]}"
|
||||
subheader = f"Plan za {MONTHS_SR[month.month - 1]}"
|
||||
_, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka)
|
||||
draw.text(((W-w)/2, 240), subheader, font=fontIosevka, fill=fg)
|
||||
|
||||
height = 410
|
||||
|
||||
draw.text((120, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg)
|
||||
height += 100
|
||||
|
||||
for event in events:
|
||||
date = DAYS_OF_WEEK_SR[event["date"].weekday()]
|
||||
day = event["date"].day
|
||||
@ -79,11 +89,26 @@ def drawPoster(events, bg, fg):
|
||||
|
||||
return img
|
||||
|
||||
def main():
|
||||
# Parse arguments
|
||||
parser = argparse.ArgumentParser(description="Generate images of the poster")
|
||||
args = parseArgs(parser)
|
||||
|
||||
events = load_events("dogadjaji.csv")
|
||||
# Set month based on user input
|
||||
month = NEXT_MONTH
|
||||
if args.month.isdigit():
|
||||
month = dt.date(CURRENT_TIME.year, int(args.month), 1)
|
||||
elif args.month != "empty":
|
||||
print("Month has to be specified as a number. I will use next month as the default")
|
||||
|
||||
img = drawPoster(events, (0, 0, 0), (20, 250, 50))
|
||||
# Load events and draw a poseter
|
||||
events = load_events("dogadjaji.csv", month)
|
||||
|
||||
img = drawPoster(events, (0, 0, 0), (20, 250, 50), month)
|
||||
img.save('poster_dark.png')
|
||||
|
||||
img = drawPoster(events, (255, 255, 255), (0, 0, 0))
|
||||
img = drawPoster(events, (255, 255, 255), (0, 0, 0), month)
|
||||
img.save('poster_light.png')
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -30,10 +30,6 @@
|
||||
<a href="/events">events</a> resources, and tutorials.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://search.dmz.rs/">Search</a></td>
|
||||
<td><a href="https://github.com/searxng/searxng/">SearXNG</a> instance used for Web searching.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://pastebin.dmz.rs/">Pastebin</a></td>
|
||||
<td><a href="https://privatebin.info/">PrivateBin</a> instance we use for sharing text files</td>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<h1>Webring</h1>
|
||||
<ul>
|
||||
<li><a href="https://tilde.zone/explore">Tilde Zone</a></li>
|
||||
<li><a href="https://pionir.org">Pionir school</a></li>
|
||||
<li><a href="https://tilda.center">Tilda Center</a></li>
|
||||
</ul>
|
@ -35,12 +35,6 @@
|
||||
<a href="/projects">projekte</a> kao i ostale <a href="/events">događaje</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://search.dmz.rs/">Search</a></td>
|
||||
<td><a href="https://github.com/searxng/searxng/">SearXNG</a> instanca koju koristimo za pretraživanje Interneta.
|
||||
Bolji od Google-a.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://pastebin.dmz.rs/">Pastebin</a></td>
|
||||
<td><a href="https://privatebin.info/">PrivateBin</a> instanca koju koristimo za brzo deljenje tekstualnih fajlova
|
||||
|
@ -1,4 +1,5 @@
|
||||
<h1>Webring</h1>
|
||||
<ul>
|
||||
<li><a href="https://tilde.zone/explore">Tilde Zone</a></li>
|
||||
<li><a href="https://pionir.org">Slobodna škola Pionir</a></li>
|
||||
<li><a href="https://tilda.center">Tilda Centar</a></li>
|
||||
</ul>
|
1
poster.py
Normal file → Executable file
1
poster.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
||||
#! /usr/bin/env python3
|
||||
import csv
|
||||
import datetime as dt
|
||||
from dateutil import relativedelta
|
||||
|
4
prep.py
Normal file → Executable file
4
prep.py
Normal file → Executable file
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import csv
|
||||
from datetime import datetime
|
||||
@ -9,7 +9,7 @@ DAYS_EN = ["MON ", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
|
||||
def load_events(csv_path:str) -> list[dict]:
|
||||
events = []
|
||||
with open(csv_path) as csv_file:
|
||||
csv_reader = csv.reader(csv_file)
|
||||
csv_reader = csv.reader(csv_file, skipinitialspace=True)
|
||||
next(csv_reader, None)
|
||||
for event in csv_reader:
|
||||
event_date = event[0]
|
||||
|
Loading…
Reference in New Issue
Block a user