fix: time
Build / Flatpak (x86_64) (push) Failing after 3m47s Details

This commit is contained in:
0xMRTT 2023-08-02 17:52:22 +02:00
parent 763573b255
commit da25c1624c
3 changed files with 30 additions and 10 deletions

View File

@ -12,8 +12,8 @@
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/9d/19/59961b522e6757f0c9097e4493fa906031b95b3ebe9360b2c3083561a6b4/certifi-2023.5.7-py3-none-any.whl",
"sha256": "c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"
"url": "https://files.pythonhosted.org/packages/4c/dd/2234eab22353ffc7d94e8d13177aaa050113286e93e7b40eae01fbf7c3d9/certifi-2023.7.22-py3-none-any.whl",
"sha256": "92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"
},
{
"type": "file",
@ -32,8 +32,8 @@
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/8a/03/ad9306a50d05c166e3456fe810f33cee2b8b2a7a6818ec5d4908c4ec6b36/urllib3-2.0.3-py3-none-any.whl",
"sha256": "48e7fafa40319d358848e1bc6809b208340fafe2096f1725d05d67443d0483d1"
"url": "https://files.pythonhosted.org/packages/9b/81/62fd61001fa4b9d0df6e31d47ff49cfa9de4af03adecf339c7bc30656b37/urllib3-2.0.4-py3-none-any.whl",
"sha256": "de7df1803967d2c2a98e4b11bb7d6bd9210474c46e8a0401514e3a42a75ebde4"
}
]
},
@ -88,8 +88,22 @@
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/8a/03/ad9306a50d05c166e3456fe810f33cee2b8b2a7a6818ec5d4908c4ec6b36/urllib3-2.0.3-py3-none-any.whl",
"sha256": "48e7fafa40319d358848e1bc6809b208340fafe2096f1725d05d67443d0483d1"
"url": "https://files.pythonhosted.org/packages/9b/81/62fd61001fa4b9d0df6e31d47ff49cfa9de4af03adecf339c7bc30656b37/urllib3-2.0.4-py3-none-any.whl",
"sha256": "de7df1803967d2c2a98e4b11bb7d6bd9210474c46e8a0401514e3a42a75ebde4"
}
]
},
{
"name": "python3-Babel",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"Babel\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/df/c4/1088865e0246d7ecf56d819a233ab2b72f7d6ab043965ef327d0731b5434/Babel-2.12.1-py3-none-any.whl",
"sha256": "b4246fb7677d3b98f501a39d43396d3cafdc8eadb045f4a31be01863f655c610"
}
]
}

View File

@ -6,4 +6,5 @@ requests
tqdm
charset-normalizer
idna
urllib3
urllib3
Babel

View File

@ -17,9 +17,12 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
import time
from datetime import datetime
import locale
from gi.repository import Gtk, Gio, Adw, GLib
from babel.dates import format_date, format_datetime, format_time
from babel import Locale
from bavarder.constants import app_id, build_type, rootdir
from bavarder.widgets.thread_item import ThreadItem
@ -339,6 +342,8 @@ class BavarderWindow(Adw.ApplicationWindow):
if shortcuts:
self.app.set_accels_for_action(f"win.{name}", shortcuts)
def get_time(self):
return format_time(datetime.now())
def add_user_item(self, content):
@ -346,7 +351,7 @@ class BavarderWindow(Adw.ApplicationWindow):
{
"role": "user",
"content": content,
"time": time.strftime("%X")
"time": self.get_time(),
}
)
@ -356,7 +361,7 @@ class BavarderWindow(Adw.ApplicationWindow):
c = {
"role": "assistant",
"content": content,
"time": time.strftime("%X"),
"time": self.get_time(),
}
if self.app.local_mode and self.app.model_name: