Compare commits

..

No commits in common. "037ddb0af69a65c0d91d83166187efbcfad12982" and "47c4260b5e55518272420a3e77110abe2fd5abd4" have entirely different histories.

4 changed files with 26 additions and 55 deletions

View File

@ -146,19 +146,10 @@ datum, vreme, lokacija, tema, tip,
02-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ejabberd/xmpp server), workshop, 02-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ejabberd/xmpp server), workshop,
03-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pi (1998), movie, 03-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pi (1998), movie,
04-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack, 04-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack,
09-06-2024, 14:00, DC Krov https://www.openstreetmap.org/node/10594728522, Game Jam, hack,
10-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Obrada prirodnih jezika kroz Python, lecture, 10-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Obrada prirodnih jezika kroz Python, lecture,
11-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ideološka diskusija, discussion, 11-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ideološka diskusija, discussion,
17-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Diskusija o P2P mrežama, discussion, 17-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Diskusija o P2P mrežama, discussion,
18-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Softverski hakaton, hack, 18-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Softvar hakaton, hack,
24-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Home-made SoC #4, lecture, 24-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna revizija, hack,
25-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna bleja i revizija, meeting, 25-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna bleja i revizija, meeting,
30-06-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ldap server/nalozi korisnika), workshop, 30-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ldap server/nalozi korisnika), workshop,
01-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, 1984 (1956), movie
02-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Open-source SoC, lecture,
08-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lightning talks, lighting,
09-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton, hack,
12-07-2024, 15:00, KC Gnezdo https://osm.org/go/xftd8rbl2, Uticaj tehnologije na kulturu, lecture,
29-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, OnionShare, lecture
20-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, CryptoPals #1, workshop
15-09-2024, 12:00, KC Magacin https://www.openstreetmap.org/node/1226456745#map=19/44.81314/20.45378, Dekonferencija, conference,

Can't render this file because it has a wrong number of fields in line 30.

View File

@ -7,7 +7,6 @@ from PIL import Image, ImageDraw, ImageFont
import csv import csv
import datetime as dt import datetime as dt
from dateutil import relativedelta from dateutil import relativedelta
from cairosvg import svg2png
CURRENT_TIME = dt.date.today() CURRENT_TIME = dt.date.today()
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1) NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
@ -23,7 +22,6 @@ def parseArgs(parser):
return parser.parse_args() return parser.parse_args()
def load_events(csv_path:str, month:int) -> list[dict]: def load_events(csv_path:str, month:int) -> list[dict]:
monthafter = month + relativedelta.relativedelta(months=1, day=1)
events = [] events = []
with open(csv_path) as csv_file: with open(csv_path) as csv_file:
csv_reader = csv.reader(csv_file) csv_reader = csv.reader(csv_file)
@ -36,35 +34,35 @@ def load_events(csv_path:str, month:int) -> list[dict]:
current_event = {"date":event_date_parsed, current_event = {"date":event_date_parsed,
"time":event_time, "time":event_time,
"title":event_title.strip()} "title":event_title.strip()}
if event_date_parsed >= month and event_date_parsed < monthafter: if event_date_parsed >= month:
events.append(current_event) events.append(current_event)
return events return events
def drawPoster(events, bg, fg, month:int): def drawPoster(events, bg, fg, month:int):
fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=365) fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=110)
fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=200) fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=60)
fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=150) fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=45)
W = 3508 W = 1200
H = 4960 H = 1500
img = Image.new('RGB', (W, H), bg) img = Image.new('RGB', (W, H), bg)
draw = ImageDraw.Draw(img) draw = ImageDraw.Draw(img)
header = "DECENTRALA" header = "DECENTRALA"
_, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade) _, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade)
draw.text(((W-w)/2, 165), header, font=fontFacade, fill=fg) 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[month.month - 1]}"
_, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka) _, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka)
draw.text(((W-w)/2, 560), subheader, font=fontIosevka, fill=fg) draw.text(((W-w)/2, 240), subheader, font=fontIosevka, fill=fg)
height = 990 height = 370
draw.text((165, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg) draw.text((120, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg)
height += 200 height += 60
draw.text((165, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg) draw.text((120, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg)
height += 300 height += 90
# Write list of events to sperate text file as well # Write list of events to sperate text file as well
textfile=open("poster.txt","w") textfile=open("poster.txt","w")
@ -82,8 +80,8 @@ def drawPoster(events, bg, fg, month:int):
title = event["title"] title = event["title"]
pad = " " if event["date"].day < 10 else "" pad = " " if event["date"].day < 10 else ""
eventText = f"{date} {day}. {pad} {title}" eventText = f"{date} {day}. {pad} {title}"
draw.text((165, height), eventText, font=fontIosevkaSmall, fill=fg) draw.text((120, height), eventText, font=fontIosevkaSmall, fill=fg)
height += 200 height += 70
# Add event to textfile # Add event to textfile
textfile.write(eventText + "\n") textfile.write(eventText + "\n")
@ -91,39 +89,22 @@ def drawPoster(events, bg, fg, month:int):
textfile.close() textfile.close()
def drawCircle(x, y): def drawCircle(x, y):
r = 50 r = 10
draw.ellipse((x - r, y - r, x + r, y+r), fill=fg, outline=(0, 0, 0), width=0) draw.ellipse((x - r, y - r, x + r, y+r), fill=fg, outline=(0, 0, 0), width=0)
LCX = 415 # logo center x LCX = 950 # logo center x
LCY = 4350 # logo center y LCY = 1200 # logo center y
d = 190 # delta d = 50 # delta
drawCircle(LCX - d, LCY) drawCircle(LCX - d, LCY)
drawCircle(LCX, LCY) drawCircle(LCX, LCY)
drawCircle(LCX, LCY - d) drawCircle(LCX, LCY - d)
drawCircle(LCX, LCY + d) drawCircle(LCX, LCY + d)
drawCircle(LCX + d, LCY) drawCircle(LCX + d, LCY)
draw.line([(LCX - d, LCY), (LCX + d, LCY)], fill=fg, width=20, joint=None) draw.line([(LCX - d, LCY), (LCX + d, LCY)], fill=fg, width=5, joint=None)
draw.line([(LCX, LCY), (LCX, LCY + d), (LCX + d, LCY), (LCX, LCY - d)], fill=fg, width=20, joint=None) draw.line([(LCX, LCY), (LCX, LCY + d), (LCX + d, LCY), (LCX, LCY - d)], fill=fg, width=5, joint=None)
draw.text((LCX - 1.7*d, LCY + 1.5*d), "dmz.rs", font=fontIosevka, fill=fg) draw.text((LCX - 1.7*d, LCY + 1.5*d), "dmz.rs", font=fontIosevka, fill=fg)
mesh_svg = svg2png(url='site/img/mesh-light.svg')
mesh_svg_bytes = io.BytesIO(mesh_svg)
mesh_img = Image.open(mesh_svg_bytes)
if bg == (0,0,0):
pixdata = mesh_img.load()
for y in range(mesh_img.size[1]):
for x in range(mesh_img.size[0]):
if pixdata[x,y] != (0,0,0,0):
pixdata[x, y] = (0, 100, 0, 255)
mesh_img = mesh_img.resize((W,H))
mesh_img.thumbnail((W,H), Image.Resampling.LANCZOS)
mesh_w, mesh_h = mesh_img.size
mesh_position = (W - mesh_w, H - mesh_h)
img.paste(mesh_img, mesh_position, mesh_img)
return img return img
def main(): def main():

View File

@ -1,7 +1,7 @@
<h1>O nama</h1> <h1>O nama</h1>
<dl> <dl>
<dt>Statut:</dt> <dt>Statut:</dt>
<dd> Sve odluke se donose po principu direktne demokratije. Nas statut mozete pogledati na <a href="/statute">stranici za statut</a>. </dd> <dd> Sve odluke se donose po principu direktne demokratije. Nas statut mozete pogledati na <a href="/en/statute">stranici za statut</a>. </dd>
<dt>Kontakt:</dt> <dt>Kontakt:</dt>
<dd>Možeš nam poslati mejl na adresu <a href="mailto:dmz@dmz.rs">dmz@dmz.rs</a> ili se možeš pridružiti našem <a href="https://forum.dmz.rs">Forumu</a>.</dd> <dd>Možeš nam poslati mejl na adresu <a href="mailto:dmz@dmz.rs">dmz@dmz.rs</a> ili se možeš pridružiti našem <a href="https://forum.dmz.rs">Forumu</a>.</dd>

View File

@ -13,7 +13,6 @@ TYPES_DICT = {
"lighting": ("kratka predavanja", "short talks"), "lighting": ("kratka predavanja", "short talks"),
"movie": ("film", "movie"), "movie": ("film", "movie"),
"meeting": ("sastanak", "meeting"), "meeting": ("sastanak", "meeting"),
"conference": ("konferencija", "conference"),
} }
def load_events(csv_path:str) -> list[dict]: def load_events(csv_path:str) -> list[dict]: