From 400eac87720664aacb89a7a05661ba7d7ae9baf5 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Thu, 11 May 2023 21:24:18 -0500 Subject: [PATCH 1/4] add language hints for highlighting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9fe7aea..aa39b3d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A Python module/TUI for AMD GPU statistics Tested _only_ on `RX6000` series cards; APUs and more _may_ be supported. Please file an issue if finding incompatibility! ## Installation -``` +```bash pip install amdgpu-stats ``` To use the _TUI_, run `amdgpu-stats` in your terminal of choice. For the _module_, see below! @@ -15,7 +15,7 @@ To use the _TUI_, run `amdgpu-stats` in your terminal of choice. For the _module ## Module Introduction: -``` +```python In [1]: import amdgpu_stats.utils In [2]: amdgpu_stats.utils.AMDGPU_CARDS From 24e356c2e49798a1e5d94b87b30419e374a602ce Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Thu, 11 May 2023 21:24:40 -0500 Subject: [PATCH 2/4] add classifiers, bump version --- pyproject.toml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 10b260c..c0eb160 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,23 @@ [tool.poetry] name = "amdgpu-stats" -version = "0.1.16" +version = "0.1.17" description = "A module/TUI for AMD GPU statistics" authors = ["Josh Lay "] repository = "https://github.com/joshlay/amdgpu_stats" license = "MIT" readme = "README.md" documentation = "https://amdgpu-stats.readthedocs.io/en/latest/" +classifiers = [ + "Environment :: Console", + "Environment :: GPU", + "Intended Audience :: Developers", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: System Administrators", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] [tool.poetry.dependencies] python = "^3.9" From b4ebb37b114d1eca3875ffb8f82bc629ffdd18cc Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Thu, 11 May 2023 21:35:47 -0500 Subject: [PATCH 3/4] styling: add bottom border to main area, +top/bottom scrollbar borders --- src/amdgpu_stats/style.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/amdgpu_stats/style.css b/src/amdgpu_stats/style.css index 861d6fa..9102d5d 100644 --- a/src/amdgpu_stats/style.css +++ b/src/amdgpu_stats/style.css @@ -7,6 +7,7 @@ GPUStatsWidget { width: 100%; /* min-width: 50;*/ } + .logs { height: 1fr; } @@ -24,6 +25,13 @@ TabbedContent { height: 1fr; } +TabPane { + padding: 0 1; + border-bottom: heavy $primary-background; + border-subtitle-color: $text-disabled; + height: 1fr; +} + Notification { dock: bottom; layer: notification; @@ -60,3 +68,8 @@ Footer { .footer--key { background: #004578; } + +ScrollBar { + border-top: solid $panel-lighten-3; + border-bottom: solid $panel-lighten-3; +} From e0401baa0ed1fe2756aa72c569ac78967f20aca6 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Thu, 11 May 2023 21:36:15 -0500 Subject: [PATCH 4/4] subtitle tweaks --- src/amdgpu_stats/tui.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/amdgpu_stats/tui.py b/src/amdgpu_stats/tui.py index 57d8271..0d5df63 100644 --- a/src/amdgpu_stats/tui.py +++ b/src/amdgpu_stats/tui.py @@ -183,7 +183,8 @@ class app(App): # pylint: disable=invalid-name # set the title - same as the class, but with spaces TITLE = 'AMD GPU Stats' - SUB_TITLE = '' + # set a default subtitle, will change with the active tab + SUB_TITLE = f'cards: {list(AMDGPU_CARDS)}' # setup keybinds BINDINGS = [ @@ -243,9 +244,8 @@ class app(App): # pylint: disable=invalid-name def on_tabbed_content_tab_activated(self, event: TabbedContent.TabActivated): """Listens to 'TabActivated' event, sets subtitle""" - # if self.tabbed_container.active == "tab_logs": - active_title = event.tabbed_content.active.title().replace('Tab_', '') - if event.tabbed_content.active == "tab_logs": - self.sub_title = active_title # pylint: disable=attribute-defined-outside-init - elif event.tabbed_content.active == "tab_stats": - self.sub_title = f'{active_title}: {list(AMDGPU_CARDS)}' # pylint: disable=attribute-defined-outside-init + active_tab = event.tabbed_content.active.replace('tab_', '') + if active_tab == "logs": + self.sub_title = active_tab # pylint: disable=attribute-defined-outside-init + elif active_tab == "stats": + self.sub_title = f'cards: {list(AMDGPU_CARDS)}' # pylint: disable=attribute-defined-outside-init