mirror of
https://codeberg.org/hyperreal/daily-event-logger
synced 2024-11-25 11:53:42 +01:00
Update to 0.1.0; use fall colors
This commit is contained in:
parent
d09aaf6731
commit
3bcc2bf656
2
setup.py
2
setup.py
@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="daily-event-logger",
|
name="daily-event-logger",
|
||||||
version="0.0.13",
|
version="0.1.0",
|
||||||
license="GPL-3.0",
|
license="GPL-3.0",
|
||||||
author="Jeffrey Serio",
|
author="Jeffrey Serio",
|
||||||
author_email="hyperreal@fedoraproject.org",
|
author_email="hyperreal@fedoraproject.org",
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"""elog - daily event logger."""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import json
|
import json
|
||||||
@ -15,7 +17,7 @@ from rich.traceback import install
|
|||||||
|
|
||||||
install(show_locals=True)
|
install(show_locals=True)
|
||||||
|
|
||||||
VERSION = "0.0.13"
|
VERSION = "0.1.0"
|
||||||
|
|
||||||
default_date = dt.date.today().strftime("%Y-%m-%d")
|
default_date = dt.date.today().strftime("%Y-%m-%d")
|
||||||
ELOG_DIR = os.getenv("ELOG_DIR")
|
ELOG_DIR = os.getenv("ELOG_DIR")
|
||||||
@ -72,10 +74,10 @@ def elog_list(args):
|
|||||||
with open(selected_elog_file, "r") as ef:
|
with open(selected_elog_file, "r") as ef:
|
||||||
json_data = json.load(ef)
|
json_data = json.load(ef)
|
||||||
|
|
||||||
table = Table(style="#8700ff", header_style="bold", box=box.ROUNDED)
|
table = Table(style="#84562c", header_style="bold", box=box.ROUNDED)
|
||||||
table.add_column("Index", justify="right", style="#ffff00")
|
table.add_column("Index", justify="right", style="#fb4934")
|
||||||
table.add_column("Timestamp", justify="left", style="#ff8700")
|
table.add_column("Timestamp", justify="left", style="#d62b00")
|
||||||
table.add_column("Message", justify="left")
|
table.add_column("Message", justify="left", style="#e3d499")
|
||||||
|
|
||||||
for i in range(len(json_data)):
|
for i in range(len(json_data)):
|
||||||
if json_data[i]["timestamp"] > ts_from and json_data[i]["timestamp"] < ts_to:
|
if json_data[i]["timestamp"] > ts_from and json_data[i]["timestamp"] < ts_to:
|
||||||
@ -357,12 +359,7 @@ search_parser = subparsers.add_parser(
|
|||||||
"search", description="Search for keywords in elog files"
|
"search", description="Search for keywords in elog files"
|
||||||
)
|
)
|
||||||
search_parser.add_argument(
|
search_parser.add_argument(
|
||||||
"-w",
|
"-w", "--word", required=True, type=str, action="store", help="Word to search for"
|
||||||
"--word",
|
|
||||||
required=True,
|
|
||||||
type=str,
|
|
||||||
action="store",
|
|
||||||
help="Word to search for",
|
|
||||||
)
|
)
|
||||||
search_parser.set_defaults(func=elog_search)
|
search_parser.set_defaults(func=elog_search)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user