mirror of
https://github.com/bliksemlabs/PyMeshCoreGUI.git
synced 2026-06-12 02:04:56 +02:00
Initial commit
PyMeshCore GUI is an open-source desktop application for interacting with the MeshCore network. It focuses on **chatting, prototyping, and development** on top of MeshCore, with an emphasis on desktop workflows and developer accessibility. The project is built using PySide6 (Qt for Python) and meshcore-py.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
|
||||
class Message:
|
||||
def __init__(self, payload: dict[str, Any]):
|
||||
self.payload = payload
|
||||
|
||||
@property
|
||||
def timestamp(self) -> datetime | None:
|
||||
ts = self.payload.get("sender_timestamp")
|
||||
return datetime.fromtimestamp(ts) if ts else None
|
||||
|
||||
@property
|
||||
def text(self) -> str:
|
||||
return self.payload.get("text", "")
|
||||
|
||||
def formatted(self) -> str:
|
||||
if self.timestamp:
|
||||
time_str = self.timestamp.strftime("%Y-%m-%d %H:%M:%S")
|
||||
return f"[{time_str}] {self.text}"
|
||||
return self.text
|
||||
Reference in New Issue
Block a user