From 00171f2171d47b917912139a48b8c6ffa64778cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20W=C3=BChrer?= Date: Tue, 21 May 2024 14:55:26 +0200 Subject: yamlbrowser: add datetime --- bin/yamlbrowser | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin/yamlbrowser') diff --git a/bin/yamlbrowser b/bin/yamlbrowser index 92068b4..7b5e9a9 100755 --- a/bin/yamlbrowser +++ b/bin/yamlbrowser @@ -4,6 +4,7 @@ import sys import yaml from qtpy import QtGui, QtWidgets, QtCore from qtpy.QtWidgets import QApplication, QTreeWidget, QTreeWidgetItem, QLabel +from datetime import datetime def _make_children (parent:QTreeWidgetItem, d) -> QTreeWidgetItem: """ @@ -26,6 +27,7 @@ def _make_children (parent:QTreeWidgetItem, d) -> QTreeWidgetItem: , int: lambda p, d : QTreeWidgetItem ([p.text (0), str(d)]) , float: lambda p, d : QTreeWidgetItem ([p.text (0), str(d)]) , bool: lambda p, d : QTreeWidgetItem ([p.text (0), str(d)]) + , datetime: lambda p, d : QTreeWidgetItem ([p.text (0), str(d)]) , type(None): lambda p, d : QTreeWidgetItem ([p.text (0), str(d)]) }[type (d)] (parent, d) -- cgit v1.2.3