From 7162ebdafebac03a07bdde7dc89d6241b80f0117 Mon Sep 17 00:00:00 2001 From: Justin C Date: Fri, 8 Dec 2023 17:47:39 -0500 Subject: [PATCH] Removes use of and /Users/thetacom/projects/hexabyte modules info panel for better cross-platform support. --- hexabyte/widgets/info_panel.py | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hexabyte/widgets/info_panel.py b/hexabyte/widgets/info_panel.py index be53caa..a237070 100644 --- a/hexabyte/widgets/info_panel.py +++ b/hexabyte/widgets/info_panel.py @@ -1,8 +1,7 @@ """Sidebar Info Panel.""" -import grp -import pwd import stat from hashlib import md5, sha1 +from pathlib import Path from textual.app import ComposeResult from textual.containers import Horizontal @@ -78,7 +77,8 @@ def update_stats(self) -> None: """Update file size info.""" if self.editor is None: return - stats = self.editor.api.filepath.stat() + filepath: Path = self.editor.api.filepath + stats = filepath.stat() size_value = self.query_one("#size-value", Static) file_size = stats.st_size mb_size = file_size // MB @@ -88,10 +88,10 @@ def update_stats(self) -> None: kb_size = file_size // KB size_value.update(f"{kb_size:,} KB ({file_size:,} bytes)") owner_value = self.query_one("#owner-value", Static) - owner_value.update(pwd.getpwuid(stats.st_uid).pw_name) + owner_value.update(filepath.owner) group_value = self.query_one("#group-value", Static) - group_value.update(grp.getgrgid(stats.st_gid).gr_name) + group_value.update(filepath.group) perm_value = self.query_one("#permissions-value", Static) perm_value.update(stat.filemode(stats.st_mode)) diff --git a/pyproject.toml b/pyproject.toml index cf62334..143df60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hexabyte" -version = "0.8.3" +version = "0.8.4" description = "A modern, modular, and robust TUI hex editor." keywords = ["commandline", "hexeditor", "binary", "hexadecimal", "raw", "byteview", "bytes"] repository = "https://github.com/thetacom/hexabyte"