From c5d4cbdfd8c98440e7f9ae4edf4d838059ce951a Mon Sep 17 00:00:00 2001 From: Valentin Korenjak Date: Wed, 22 Apr 2026 20:31:31 +0200 Subject: [PATCH] =?UTF-8?q?bugfix:=20about=20dialog=20ni=20deloval=20pri?= =?UTF-8?q?=20tipi=C4=8Dni=20namestitvi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appinfo.json | 2 +- projector.py | 8 ++++---- web/server.py | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/appinfo.json b/appinfo.json index 7ce46e8..2b43f66 100644 --- a/appinfo.json +++ b/appinfo.json @@ -1,7 +1,7 @@ { "name": "Projekcija", "description": "Aplikacija za projekcijo besedil pesmi na zaslon.", - "version": "0.7.0", + "version": "0.7.1", "authors": [ "Uroš Urbanija (izvorna zasnova)", "Valentin Korenjak (nadgradnje in vzdrževanje)" diff --git a/projector.py b/projector.py index b5a27f1..42710d0 100755 --- a/projector.py +++ b/projector.py @@ -34,12 +34,12 @@ import urllib.request import tempfile from db_schema import create_tables +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) +APPINFO_PATH = os.path.join(BASE_DIR, 'appinfo.json') + DB_PATH = 'songs.db' SETTINGS_PATH = 'settings.json' -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) - - class SongProjector: def __init__(self, root): self.root = root @@ -726,7 +726,7 @@ class SongProjector: def show_app_info_tkinter(self): """Prikaže informacije o aplikaciji v glavnem oknu (ukaz 9900).""" try: - with open('appinfo.json', 'r', encoding='utf-8') as f: + with open(APPINFO_PATH, 'r', encoding='utf-8') as f: info = json.load(f) self.cursor.execute("SELECT COUNT(*) FROM songs") diff --git a/web/server.py b/web/server.py index 6441271..2151586 100644 --- a/web/server.py +++ b/web/server.py @@ -204,8 +204,10 @@ def toggle_split(): def get_app_info(): """Vrne informacije o aplikaciji iz appinfo.json""" try: - # appinfo.json je v korenskem imeniku projekta - with open('appinfo.json', 'r', encoding='utf-8') as f: + # appinfo.json je v korenskem imeniku projekta (nad web/) + base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + appinfo_path = os.path.join(base_dir, 'appinfo.json') + with open(appinfo_path, 'r', encoding='utf-8') as f: info = json.load(f) # Dodaj število pesmi v bazi