Skip to content

Commit

Permalink
Removes use of and /Users/thetacom/projects/hexabyte modules info pan…
Browse files Browse the repository at this point in the history
…el for better cross-platform support.
  • Loading branch information
thetacom committed Dec 8, 2023
1 parent e54e381 commit 7162ebd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions hexabyte/widgets/info_panel.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 7162ebd

Please sign in to comment.