Fix CRLF on script and continue working on translations

This commit is contained in:
Flare Starfall 2026-03-09 01:31:17 +01:00
parent 77dbf8fb06
commit 4dcf113649
7 changed files with 46 additions and 24 deletions

1
VERSION.md Normal file
View File

@ -0,0 +1 @@
0.1.0-alpha.2

9
app.py
View File

@ -11,8 +11,6 @@ from starfall.log import Log
from starfall.types import SnapshotQueue from starfall.types import SnapshotQueue
from starfall.web import WebUI from starfall.web import WebUI
CURRENT_VERSION = "0.1.0-alpha.2"
@final @final
class Application: class Application:
@ -30,7 +28,7 @@ class Application:
"OS Type: %s\nWorking Directory: %s\nApplication version: %s", "OS Type: %s\nWorking Directory: %s\nApplication version: %s",
os.name, os.name,
os.path.realpath(os.curdir), os.path.realpath(os.curdir),
CURRENT_VERSION, self.version(),
) )
self.config = Config("config.toml", "config-sample.toml") self.config = Config("config.toml", "config-sample.toml")
@ -49,6 +47,11 @@ class Application:
self.app = WebUI() self.app = WebUI()
def version(self):
with open("VERSION.md", "r") as file:
version = file.readline()
return version
def run(self): def run(self):
""" """
Starts all threads and monitors their active state. Starts all threads and monitors their active state.

View File

@ -1,5 +1,5 @@
[jinja2: **/templates/**.jinja] [jinja2: **/templates/**.jinja]
extensions=webassets.ext.jinja2.AssetsExtension
silent=false silent=false
[python: **.py] [python: **.py]
silent=false

View File

@ -30,9 +30,9 @@ function compile_pot
echo "Compiling POT file..." echo "Compiling POT file..."
set_color normal set_color normal
set -l version "$(cat VERSION.md)" set -l tl_version "$(cat VERSION.md)"
command pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot --add-location full \ command pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot --add-location full \
--project Starfall --version "$version" \ --project Starfall --version "$tl_version" \
--copyright-holder "Flare Starfall" --msgid-bugs-address "flare@theflare.at" . --copyright-holder "Flare Starfall" --msgid-bugs-address "flare@theflare.at" .
if test -d translations if test -d translations
@ -92,7 +92,26 @@ function compile_po
echo echo
end end
source .venv/bin/activate.fish if test -f .venv/bin7activate.fish
source .venv/bin/activate.fish
end
if test -f .venv/Scripts/activate.fish
source .venv/Scripts/activate.fish
end
set_color brgreen
echo -n "pybabel version >>> "
set_color normal
command pybabel --version
if test $status -ne 0
set_color brred
echo "Could not read pybabel - Please check venv"
set_color normal
return 1
end
while true while true
display_help display_help
read -p "set_color green; echo -n \"Please enter operation >>> \"; set_color normal" -n 1 -l confirm read -p "set_color green; echo -n \"Please enter operation >>> \"; set_color normal" -n 1 -l confirm

View File

@ -24,7 +24,7 @@ class MainBlueprint(BaseBlueprint):
def not_found(self, e: Any): def not_found(self, e: Any):
self.error: Any = e self.error: Any = e
return render_template( return render_template(
"404.jinja", "errors/not_found.jinja",
bp=self, bp=self,
lang=get_locale(), lang=get_locale(),
), 404 ), 404

View File

@ -1,15 +0,0 @@
{%extends 'base.jinja'%}
{%block title%}404{%endblock%}
{%block body%}
<div class="container" id="content">
<div class="card">
<h1 class="card-header">404&nbsp;<small>(Not Found)</small></h1>
<div class="card-body">
<p><strong>The location you navigated to doesn't exist.</strong></p>
<p>Go back to the <a href="/">start</a> and try again?</p>
</div>
</div>
</div>
{%endblock%}

View File

@ -0,0 +1,14 @@
{%extends 'base.jinja'%}
{%block title%}404{%endblock%}
{%block body%}
<div class="container" id="content">
<div class="card">
<h1 class="card-header">{{_('error.404.title')}}</h1>
<div class="card-body">
<p>{{_('error.404.body')}}</p>
</div>
</div>
</div>
{%endblock%}