forked from Decentrala/website
Compare commits
No commits in common. "df32ef6116034bb65437ed7b81c4ce80d1375cbd" and "62778e267991531e8afd021a30b0710c9881a59b" have entirely different histories.
df32ef6116
...
62778e2679
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python3
|
||||
#! /usr/bin/python3
|
||||
|
||||
# needs lowdown and feegden installed
|
||||
# feedgen can be installed with pip
|
||||
|
1
blog.py
Executable file → Normal file
1
blog.py
Executable file → Normal file
@ -1,4 +1,3 @@
|
||||
#! /usr/bin/env python3
|
||||
# just testing markdown library for now
|
||||
|
||||
from markdown import markdown as to_markdown
|
||||
|
1
build_pages.py
Executable file → Normal file
1
build_pages.py
Executable file → Normal file
@ -1,4 +1,3 @@
|
||||
#! /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 mreže
|
||||
20-12-2022, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u računarske mreze, firewall
|
||||
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 izložbe (Q&A)
|
||||
03-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, Otvaranje izlozbe (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 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, 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, 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 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)
|
||||
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)
|
||||
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
|
||||
10-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Blender, 3D modelovanje
|
||||
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,17 +65,7 @@ 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, Cybersecurity - kako početi?
|
||||
19-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Stop reklamama - diskusija
|
||||
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?
|
||||
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 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
|
||||
26-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lambda racun E02
|
|
43
image_poster.py
Executable file → Normal file
43
image_poster.py
Executable file → Normal file
@ -1,6 +1,5 @@
|
||||
#! /usr/bin/env python3
|
||||
#! /usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import freetype
|
||||
import io
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
@ -9,19 +8,13 @@ import datetime as dt
|
||||
from dateutil import relativedelta
|
||||
|
||||
CURRENT_TIME = dt.date.today()
|
||||
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
|
||||
NEXT_MONTH = CURRENT_TIME
|
||||
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, month:int) -> list[dict]:
|
||||
def load_events(csv_path:str) -> list[dict]:
|
||||
events = []
|
||||
with open(csv_path) as csv_file:
|
||||
csv_reader = csv.reader(csv_file)
|
||||
@ -34,11 +27,11 @@ def load_events(csv_path:str, month:int) -> list[dict]:
|
||||
current_event = {"date":event_date_parsed,
|
||||
"time":event_time,
|
||||
"title":event_title.strip()}
|
||||
if event_date_parsed >= month:
|
||||
if event_date_parsed >= NEXT_MONTH:
|
||||
events.append(current_event)
|
||||
return events
|
||||
|
||||
def drawPoster(events, bg, fg, month:int):
|
||||
def drawPoster(events, bg, fg):
|
||||
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)
|
||||
@ -52,15 +45,12 @@ def drawPoster(events, bg, fg, month:int):
|
||||
_, _, 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[month.month - 1]}"
|
||||
subheader = f"Plan za {MONTHS_SR[NEXT_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
|
||||
@ -89,26 +79,11 @@ def drawPoster(events, bg, fg, month:int):
|
||||
|
||||
return img
|
||||
|
||||
def main():
|
||||
# Parse arguments
|
||||
parser = argparse.ArgumentParser(description="Generate images of the poster")
|
||||
args = parseArgs(parser)
|
||||
|
||||
# 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")
|
||||
events = load_events("dogadjaji.csv")
|
||||
|
||||
# Load events and draw a poseter
|
||||
events = load_events("dogadjaji.csv", month)
|
||||
|
||||
img = drawPoster(events, (0, 0, 0), (20, 250, 50), month)
|
||||
img = drawPoster(events, (0, 0, 0), (20, 250, 50))
|
||||
img.save('poster_dark.png')
|
||||
|
||||
img = drawPoster(events, (255, 255, 255), (0, 0, 0), month)
|
||||
img = drawPoster(events, (255, 255, 255), (0, 0, 0))
|
||||
img.save('poster_light.png')
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -30,6 +30,10 @@
|
||||
<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,5 +1,4 @@
|
||||
<h1>Webring</h1>
|
||||
<ul>
|
||||
<li><a href="https://pionir.org">Pionir school</a></li>
|
||||
<li><a href="https://tilda.center">Tilda Center</a></li>
|
||||
<li><a href="https://tilde.zone/explore">Tilde Zone</a></li>
|
||||
</ul>
|
@ -35,6 +35,12 @@
|
||||
<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,5 +1,4 @@
|
||||
<h1>Webring</h1>
|
||||
<ul>
|
||||
<li><a href="https://pionir.org">Slobodna škola Pionir</a></li>
|
||||
<li><a href="https://tilda.center">Tilda Centar</a></li>
|
||||
<li><a href="https://tilde.zone/explore">Tilde Zone</a></li>
|
||||
</ul>
|
1
poster.py
Executable file → Normal file
1
poster.py
Executable file → Normal file
@ -1,4 +1,3 @@
|
||||
#! /usr/bin/env python3
|
||||
import csv
|
||||
import datetime as dt
|
||||
from dateutil import relativedelta
|
||||
|
4
prep.py
Executable file → Normal file
4
prep.py
Executable file → Normal file
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python3
|
||||
#! /usr/bin/env python
|
||||
|
||||
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, skipinitialspace=True)
|
||||
csv_reader = csv.reader(csv_file)
|
||||
next(csv_reader, None)
|
||||
for event in csv_reader:
|
||||
event_date = event[0]
|
||||
|
Loading…
Reference in New Issue
Block a user