forked from KolibriOS/kolibrios.org
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 961692241a | |||
| f9a07bcadd | |||
| d0b267f0ea |
3
configs/banner.ini
Normal file
3
configs/banner.ini
Normal file
@@ -0,0 +1,3 @@
|
||||
[banner]
|
||||
url = https://summerofcode.withgoogle.com/programs/2026/organizations/kolibrios-project-team
|
||||
img = gsoc.png
|
||||
@@ -14,9 +14,10 @@ forum = Forum
|
||||
wiki = Wiki
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = KolibriOS ist zu Git gewechselt!
|
||||
text = Schau dir unsere neue entwicklerfreundliche Infrastruktur an
|
||||
[banner]
|
||||
header = KolibriOS wurde zu GSoC 2026 angenommen!
|
||||
text = Informieren Sie sich über Programmdetails und unsere Projektideen
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} ist ein winziges, aber unglaublich leistungsfähiges und
|
||||
|
||||
@@ -14,9 +14,10 @@ forum = Forum
|
||||
wiki = Wiki
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = KolibriOS moved to Git!
|
||||
text = Check our new developers-friendly infrastructure
|
||||
[banner]
|
||||
header = KolibriOS accepted to GSoC 2026!
|
||||
text = Check program details and our project ideas
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} is a tiny yet incredibly powerful and fast operating system for
|
||||
|
||||
@@ -14,9 +14,10 @@ forum = Foro
|
||||
wiki = Wiki
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = ¡KolibriOS se ha trasladado a Git!
|
||||
text = Mira nuestra nueva infraestructura amigable para desarrolladores
|
||||
[banner]
|
||||
header = ¡KolibriOS fue aceptado en GSoC 2026!
|
||||
text = Consulta los detalles del programa y nuestras ideas de proyecto
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} es un sistema operativo diminuto, pero increíblemente potente y
|
||||
|
||||
@@ -14,9 +14,10 @@ forum = Forum
|
||||
wiki = Wiki
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = KolibriOS a déménagé sur Git !
|
||||
text = Découvrez notre nouvelle infrastructure conviviale pour les développeurs
|
||||
[banner]
|
||||
header = KolibriOS a été accepté au GSoC 2026 !
|
||||
text = Consultez les détails du programme et nos idées de projets
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} est un système d`exploitation minuscule, mais incroyablement
|
||||
|
||||
@@ -14,10 +14,10 @@ forum = Forum
|
||||
wiki = Wiki
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = KolibriOS si è spostato su Git!
|
||||
text = Dai un`occhiata alla nostra nuova infrastruttura pensata per gli
|
||||
sviluppatori
|
||||
[banner]
|
||||
header = KolibriOS è stato accettato al GSoC 2026!
|
||||
text = Consulta i dettagli del programma e le nostre idee di progetto
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} è un sistema operativo minuscolo, ma incredibilmente potente e
|
||||
|
||||
@@ -14,9 +14,10 @@ forum = Forum
|
||||
wiki = Wiki
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = KolibriOS is verhuisd naar Git!
|
||||
text = Bekijk onze nieuwe, ontwikkelaarsvriendelijke infrastructuur
|
||||
[banner]
|
||||
header = KolibriOS is geaccepteerd voor GSoC 2026!
|
||||
text = Bekijk de programmadetails en onze projectideeën
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} is een klein maar ongelooflijk krachtig en snel
|
||||
|
||||
@@ -14,9 +14,10 @@ forum = Форум
|
||||
wiki = Вики
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = КолибриОС перешла на Git!
|
||||
text = Ознакомьтесь с нашей новой, удобной для разработчиков инфраструктурой
|
||||
[banner]
|
||||
header = KolibriOS принята в GSoC 2026!
|
||||
text = Ознакомьтесь с деталями программы и нашими идеями проектов
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} — это крошечная, но невероятно мощная и быстрая операционная
|
||||
|
||||
@@ -14,9 +14,10 @@ forum = 论坛
|
||||
wiki = 百科
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = KolibriOS 现已拥抱 Git!
|
||||
text = 来看看我们全新又对开发者友好的代码仓库吧:
|
||||
[banner]
|
||||
header = KolibriOS 已被 GSoC 2026 录取!
|
||||
text = 查看项目详情和我们的项目创意
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} 是一个体积微小、功能强大、响应迅速的,面向 x86 兼容机的操作系统。
|
||||
|
||||
@@ -14,9 +14,10 @@ forum = 論壇
|
||||
wiki = 百科
|
||||
git = Git
|
||||
|
||||
[git]
|
||||
header = KolibriOS 現已移入 Git!
|
||||
text = 來看看我們又新又友好的代碼倉庫吧:
|
||||
[banner]
|
||||
header = KolibriOS 已入選 GSoC 2026!
|
||||
text = 查看計畫詳情和我們的專案構想
|
||||
alt = GSoC
|
||||
|
||||
[article]
|
||||
p1 = {kolibrios} 是一個空間小、功能強、回應快的,面向 x86 兼容機的作業系統。
|
||||
|
||||
@@ -3,7 +3,7 @@ import threading
|
||||
import time
|
||||
|
||||
|
||||
STATUS_URL = "https://builds.kolibrios.org/status.html"
|
||||
STATUS_URL = "http://builds.kolibrios.org/status.html"
|
||||
STATUS_SEC = 300 # refetch each 5 minutes
|
||||
|
||||
autobuild_date = {"YYYY": "YYYY", "MM": "MM", "DD": "DD"}
|
||||
@@ -17,7 +17,6 @@ def _refresh_build_date_once():
|
||||
global autobuild_date, autobuild_vers
|
||||
try:
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
req = Request(
|
||||
STATUS_URL,
|
||||
headers={
|
||||
@@ -30,46 +29,58 @@ def _refresh_build_date_once():
|
||||
r.headers.get_content_charset() or "utf-8", "replace"
|
||||
)
|
||||
|
||||
ver_re = re.compile(
|
||||
r"\b(\d+\.\d+\.\d+\.\d+\+\d{3,8}-[0-9a-fA-F]{7,40})\b"
|
||||
)
|
||||
last_ver = None
|
||||
|
||||
rows = re.findall(r"(<tr\b[^>]*>.*?</tr>)", html, flags=re.I | re.S)
|
||||
if not rows:
|
||||
return
|
||||
|
||||
last_commit_ver = None
|
||||
|
||||
for row in rows:
|
||||
cls = re.search(r'class\s*=\s*"([^"]*)"', row, flags=re.I)
|
||||
classes = cls.group(1).lower() if cls else ""
|
||||
|
||||
text = re.sub(r"<[^>]+>", " ", row)
|
||||
|
||||
if "commit" in classes:
|
||||
mver = re.search(
|
||||
r"\b(\d+\.\d+\.\d+\.\d+\+\d{3,8}-[0-9a-fA-F]{7,40})\b", row
|
||||
)
|
||||
mver = ver_re.search(row)
|
||||
if mver:
|
||||
last_commit_ver = mver.group(1)
|
||||
|
||||
elif "success" in classes:
|
||||
mts = re.search(
|
||||
r"\b(\d{4})\.(\d{2})\.(\d{2})\s+\d{2}:\d{2}:\d{2}\b", text
|
||||
last_ver = mver.group(1)
|
||||
continue
|
||||
if "success" not in classes:
|
||||
continue
|
||||
text = re.sub(r"<[^>]+>", " ", row)
|
||||
mts = re.search(
|
||||
r"\b(\d{4})\.(\d{2})\.(\d{2})\s+\d{2}:\d{2}:\d{2}\b", text
|
||||
)
|
||||
if mts:
|
||||
autobuild_date["YYYY"], autobuild_date["MM"], autobuild_date["DD"] = mts.groups()
|
||||
else:
|
||||
mds = re.search(r"\b(\d{2})\.(\d{2})\.(\d{4})\b", text)
|
||||
if not mds:
|
||||
return
|
||||
autobuild_date["YYYY"], autobuild_date["MM"], autobuild_date["DD"] = (
|
||||
mds.group(3),
|
||||
mds.group(2),
|
||||
mds.group(1),
|
||||
)
|
||||
if not mts:
|
||||
mds = re.search(r"\b(\d{2})\.(\d{2})\.(\d{4})\b", text)
|
||||
if mds:
|
||||
autobuild_date["YYYY"] = mds.group(1)
|
||||
autobuild_date["MM"] = mds.group(2)
|
||||
autobuild_date["DD"] = mds.group(3)
|
||||
else:
|
||||
return
|
||||
else:
|
||||
(
|
||||
autobuild_date["YYYY"],
|
||||
autobuild_date["MM"],
|
||||
autobuild_date["DD"],
|
||||
) = mts.groups()
|
||||
if last_ver:
|
||||
autobuild_vers = last_ver
|
||||
return
|
||||
|
||||
if last_commit_ver:
|
||||
autobuild_vers = last_commit_ver
|
||||
# Fallback for plain-text log format (no HTML table)
|
||||
# Example: 2025.09.20 20:45:10 user 💚 Build processing completed successfully. Thank you.
|
||||
log_line_re = re.compile(
|
||||
r"^(\d{4})\.(\d{2})\.(\d{2})\s+\d{2}:\d{2}:\d{2}\s+(.*)$"
|
||||
)
|
||||
for raw in html.splitlines():
|
||||
mline = log_line_re.match(raw.strip())
|
||||
if not mline:
|
||||
continue
|
||||
yyyy, mm, dd, rest = mline.groups()
|
||||
mver = ver_re.search(rest)
|
||||
if mver:
|
||||
last_ver = mver.group(1)
|
||||
if "Build processing completed successfully" in rest:
|
||||
autobuild_date["YYYY"], autobuild_date["MM"], autobuild_date["DD"] = yyyy, mm, dd
|
||||
if last_ver:
|
||||
autobuild_vers = last_ver
|
||||
return
|
||||
|
||||
except Exception:
|
||||
|
||||
50
modules/configs.py
Normal file
50
modules/configs.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from os import path, listdir
|
||||
from configparser import ConfigParser
|
||||
import threading
|
||||
|
||||
|
||||
_configs = {}
|
||||
_loaded = False
|
||||
_load_lock = threading.Lock()
|
||||
|
||||
|
||||
def load_all_configs():
|
||||
new_configs = {}
|
||||
|
||||
configs_dir = "configs"
|
||||
if not path.isdir(configs_dir):
|
||||
return new_configs
|
||||
|
||||
for filename in sorted(listdir(configs_dir)):
|
||||
if not filename.endswith(".ini"):
|
||||
continue
|
||||
|
||||
file_path = path.join(configs_dir, filename)
|
||||
cp = ConfigParser()
|
||||
with open(file_path, encoding="utf-8") as f:
|
||||
cp.read_file(f)
|
||||
|
||||
for section in cp.sections():
|
||||
section_data = new_configs.setdefault(section, {})
|
||||
section_data.update(dict(cp[section]))
|
||||
|
||||
return new_configs
|
||||
|
||||
|
||||
def ensure_loaded():
|
||||
global _configs, _loaded
|
||||
with _load_lock:
|
||||
if _loaded:
|
||||
return
|
||||
_configs = load_all_configs()
|
||||
_loaded = True
|
||||
|
||||
|
||||
def get_section(name):
|
||||
ensure_loaded()
|
||||
return dict(_configs.get(name, {}))
|
||||
|
||||
|
||||
def get_all_sections():
|
||||
ensure_loaded()
|
||||
return {section: dict(values) for section, values in _configs.items()}
|
||||
@@ -2,6 +2,8 @@ from os import path, listdir
|
||||
from configparser import ConfigParser
|
||||
import threading
|
||||
|
||||
from modules import configs
|
||||
|
||||
|
||||
translations = {}
|
||||
locales_name = {}
|
||||
@@ -33,6 +35,13 @@ def load_all_locales():
|
||||
section: dict(cp[section]) for section in cp.sections()
|
||||
}
|
||||
|
||||
shared_sections = configs.get_all_sections()
|
||||
if shared_sections:
|
||||
for locale_translation in new_translations.values():
|
||||
for section_name, section_values in shared_sections.items():
|
||||
locale_section = locale_translation.setdefault(section_name, {})
|
||||
locale_section.update(section_values)
|
||||
|
||||
new_locales_code = locales_code_default + tuple(sorted(locales_code_extra))
|
||||
new_locales_name = {
|
||||
locale_code: new_translations[locale_code]["title"]["language"]
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
BIN
static/img/banners/gsoc.png
Normal file
BIN
static/img/banners/gsoc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
BIN
static/img/icons/i_irc.png
Normal file
BIN
static/img/icons/i_irc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 510 B |
BIN
static/img/icons/i_matrix.png
Normal file
BIN
static/img/icons/i_matrix.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 239 B |
@@ -16,7 +16,9 @@ $c-shadow-soft: #1C1A281F;
|
||||
$c-article-bd: #C0B9C491;
|
||||
|
||||
$c-primary: #609A21;
|
||||
$c-primary-ink: #609A21AA;
|
||||
|
||||
$c-banner: #F9AB00;
|
||||
$c-banner-ink: #F9AB00AA;
|
||||
|
||||
$c-link: #0472D8;
|
||||
$c-link-hover: #0053B9;
|
||||
@@ -180,12 +182,21 @@ body {
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
box-shadow: inset 0 0 0 4px $c-primary-ink;
|
||||
box-shadow: inset 0 0 0 4px $c-banner-ink;
|
||||
}
|
||||
|
||||
table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
td {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
|
||||
&:first-child,
|
||||
&:last-child {
|
||||
width: 128px;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
@@ -193,7 +204,7 @@ body {
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: $c-primary;
|
||||
color: $c-banner;
|
||||
font-size: 2.5em;
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
@@ -202,14 +213,14 @@ body {
|
||||
margin: 0em;
|
||||
}
|
||||
|
||||
.p-link {
|
||||
margin-top: 16px;
|
||||
color: $c-primary;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $c-primary;
|
||||
display: block;
|
||||
margin-top: 16px;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
font-weight: bold;
|
||||
color: $c-banner;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,7 +486,7 @@ iframe {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
p, .p-link {
|
||||
p {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{% include 'tmpl/_menu.htm' %}
|
||||
|
||||
<div id="article">
|
||||
{% include 'tmpl/_git.htm' %}
|
||||
{% include 'tmpl/_banner.htm' %}
|
||||
|
||||
{% include 'tmpl/_article.htm' %}
|
||||
|
||||
|
||||
17
templates/tmpl/_banner.htm
Normal file
17
templates/tmpl/_banner.htm
Normal file
@@ -0,0 +1,17 @@
|
||||
<a id="banner" href="{{ _('banner:url') }}" target="_blank">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="128">
|
||||
<img src="{{ url_for('static', filename='img/logo.png') }}" alt="{{ _('title:index')}}">
|
||||
</td>
|
||||
<td valign="top">
|
||||
<h1>{{ _('banner:header') }}</h1>
|
||||
<p>{{ _('banner:text') }}</p>
|
||||
<a href="{{ _('banner:url') }}">{{ _('banner:url') }}</a>
|
||||
</td>
|
||||
<td valign="top" width="128">
|
||||
<img src="{{ url_for('static', filename='img/banners/' + _('banner:img')) }}" alt="{{ _('banner:alt') }}">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</a>
|
||||
@@ -1,19 +0,0 @@
|
||||
<a id="banner" href="https://git.kolibrios.org" target="_blank">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="128">
|
||||
<img src="{{ url_for('static', filename='img/logo.png') }}" alt="KolibriOS">
|
||||
</td>
|
||||
<td valign="top">
|
||||
<h1>{{ _('git:header') }}</h1>
|
||||
<p>{{ _('git:text') }}</p>
|
||||
<p class="p-link">
|
||||
<a href="https://git.kolibrios.org">https://git.kolibrios.org</a>
|
||||
</p>
|
||||
</td>
|
||||
<td valign="top" width="128">
|
||||
<img src="{{ url_for('static', filename='img/gitea.png') }}" alt="Gitea">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</a>
|
||||
@@ -14,4 +14,14 @@
|
||||
<a href="https://www.reddit.com/r/KolibriOS/" target="_blank">
|
||||
<img src="{{ url_for('static', filename='img/icons/i_reddit.png') }}" alt="Reddit">Reddit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p class="p-socials">
|
||||
<a href="https://matrix.to/#/#kolibrios:lair.moe" target="_blank">
|
||||
<img src="{{ url_for('static', filename='img/icons/i_matrix.png') }}" alt="Matrix">Matrix
|
||||
</a>
|
||||
<br />
|
||||
<a href="irc://kolibrios.org" target="_blank">
|
||||
<img src="{{ url_for('static', filename='img/icons/i_irc.png') }}" alt="IRC">IRC
|
||||
</a>
|
||||
</p>
|
||||
Reference in New Issue
Block a user