Archived
1
1
Fork 0

Merge pull request #30 from joshlay/housekeeping

v0.1.17: misc housekeeping
This commit is contained in:
Josh Lay 2023-05-11 21:41:04 -05:00 committed by GitHub
commit e3c10fd419
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 10 deletions

View file

@ -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

View file

@ -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 <pypi@jlay.io>"]
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"

View file

@ -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;
}

View file

@ -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