Compare commits

..

No commits in common. "610e1a28013c2fa6ac2ccc8819a0c2e456c88889" and "1d887c9fdf8f2b83b6fc384fadabfd428b536b5b" have entirely different histories.

4 changed files with 49 additions and 66 deletions

View File

@ -41,20 +41,12 @@ EditScreen Label {
#message-dialog {
padding: 0 1;
grid-rows: 3fr 1fr;
max-width: 75%;
max-height: 75%;
width: 50%;
height: 50%;
border: tall gray 100%;
}
#button-container {
align: center middle;
}
#cancel-button-container {
align: left middle;
}
#confirm-button-container {
align: right middle;
}

View File

@ -5,7 +5,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
"""
import argparse
import logging
from textwrap import dedent
from google.protobuf import descriptor
from google.protobuf.message import Message
@ -17,7 +16,7 @@ from textual.containers import Container, Grid, Horizontal
from textual.logging import TextualHandler
from textual.screen import ModalScreen
from textual.validation import Number
from textual.widgets import Button, Footer, Header, Input, Label, Pretty, Select, TextArea, Tree
from textual.widgets import Button, Footer, Header, Input, Label, Pretty, Select, Tree
from textual.widgets.tree import TreeNode
from gp2040ce_bintools import _version, core_parser, handler
@ -58,12 +57,12 @@ class EditScreen(ModalScreen):
# we don't handle whatever these are yet
self.input_field = Label(repr(self.field_value), id='field-input')
yield Grid(
Container(Label(self.field_descriptor.full_name, id='field-name'), id='field-name-container'),
Container(self.input_field, id='input-field-container'),
Container(Pretty('', id='input-errors', classes='hidden'), id='error-container'),
Horizontal(Container(Button("Cancel", id='cancel-button'), id='cancel-button-container'),
Container(Button("Confirm", id='confirm-button'), id='confirm-button-container'),
id='button-container'),
Container(Label(self.field_descriptor.full_name, id="field-name"), id="field-name-container"),
Container(self.input_field, id="input-field-container"),
Container(Pretty('', id='input-errors', classes='hidden'), id="error-container"),
Horizontal(Button("Confirm", id='confirm-button'),
Button("Cancel", id='cancel-button'),
id="button-container"),
id='edit-dialog',
)
@ -115,8 +114,8 @@ class MessageScreen(ModalScreen):
def compose(self) -> ComposeResult:
"""Build the pop-up window with the desired message displayed."""
yield Grid(
Container(TextArea(self.text, id='message-text', read_only=True), id='text-container'),
Container(Button("OK", id='ok-button'), id='button-container'),
Container(Label(self.text, id="message-text"), id="text-container"),
Container(Button("OK", id='ok-button'), id="button-container"),
id='message-dialog',
)
@ -132,7 +131,6 @@ class ConfigEditor(App):
('a', 'add_node', "Add Node"),
('s', 'save', "Save Config"),
('q', 'quit', "Quit"),
('?', 'about', "About"),
]
CSS_PATH = "config_tree.css"
TITLE = F"GP2040-CE Configuration Editor - {_version.version}"
@ -190,15 +188,6 @@ class ConfigEditor(App):
"""Take the appropriate action for this type of node."""
self._modify_node(node_event.node)
def action_about(self) -> None:
"""Display a help/about popup."""
self.push_screen(MessageScreen(dedent("""
gp2040ce-binary-tools - Tools for working with GP2040-CE firmware and storage binaries
Copyright © 2023 Brian S. Stephan <bss@incorporeal.org>
Made available WITHOUT ANY WARRANTY under the GNU General Public License, version 3 or later.
""")))
def action_add_node(self) -> None:
"""Add a node to the tree item, if allowed by the tree and config section."""
tree = self.query_one(Tree)

View File

@ -10,11 +10,11 @@ aiosignal==1.3.1
# via aiohttp
attrs==23.2.0
# via aiohttp
bandit==1.7.8
bandit==1.7.7
# via gp2040ce-binary-tools (pyproject.toml)
build==1.1.1
build==1.0.3
# via pip-tools
cachetools==5.3.3
cachetools==5.3.2
# via tox
chardet==5.2.0
# via tox
@ -24,8 +24,10 @@ click==8.1.7
# textual-dev
colorama==0.4.6
# via tox
coverage[toml]==7.4.3
# via pytest-cov
coverage[toml]==7.4.1
# via
# coverage
# pytest-cov
decorator==5.1.1
# via gp2040ce-binary-tools (pyproject.toml)
distlib==0.3.8
@ -65,9 +67,9 @@ frozenlist==1.4.1
# via
# aiohttp
# aiosignal
grpcio==1.62.1
grpcio==1.60.0
# via grpcio-tools
grpcio-tools==1.62.1
grpcio-tools==1.60.0
# via gp2040ce-binary-tools (pyproject.toml)
idna==3.6
# via yarl
@ -75,10 +77,11 @@ iniconfig==2.0.0
# via pytest
isort==5.13.2
# via flake8-isort
linkify-it-py==2.0.3
linkify-it-py==2.0.2
# via markdown-it-py
markdown-it-py[linkify,plugins]==3.0.0
# via
# markdown-it-py
# mdit-py-plugins
# rich
# textual
@ -88,17 +91,17 @@ mdit-py-plugins==0.4.0
# via markdown-it-py
mdurl==0.1.2
# via markdown-it-py
msgpack==1.0.8
msgpack==1.0.7
# via textual-dev
multidict==6.0.5
multidict==6.0.4
# via
# aiohttp
# yarl
mypy==1.9.0
mypy==1.8.0
# via gp2040ce-binary-tools (pyproject.toml)
mypy-extensions==1.0.0
# via mypy
packaging==24.0
packaging==23.2
# via
# build
# pyproject-api
@ -107,7 +110,7 @@ packaging==24.0
# tox
pbr==6.0.0
# via stevedore
pip-tools==7.4.1
pip-tools==7.3.0
# via gp2040ce-binary-tools (pyproject.toml)
platformdirs==4.2.0
# via
@ -117,7 +120,7 @@ pluggy==1.4.0
# via
# pytest
# tox
protobuf==4.25.3
protobuf==4.25.2
# via grpcio-tools
pycodestyle==2.11.1
# via flake8
@ -130,15 +133,13 @@ pygments==2.17.2
pyproject-api==1.6.1
# via tox
pyproject-hooks==1.0.0
# via
# build
# pip-tools
pytest==8.1.1
# via build
pytest==7.4.4
# via
# gp2040ce-binary-tools (pyproject.toml)
# pytest-asyncio
# pytest-cov
pytest-asyncio==0.23.5.post1
pytest-asyncio==0.23.4
# via gp2040ce-binary-tools (pyproject.toml)
pytest-cov==4.1.0
# via gp2040ce-binary-tools (pyproject.toml)
@ -146,7 +147,7 @@ pyusb==1.2.1
# via gp2040ce-binary-tools (pyproject.toml)
pyyaml==6.0.1
# via bandit
rich==13.7.1
rich==13.7.0
# via
# bandit
# textual
@ -154,27 +155,27 @@ setuptools-scm==8.0.4
# via gp2040ce-binary-tools (pyproject.toml)
snowballstemmer==2.2.0
# via pydocstyle
stevedore==5.2.0
stevedore==5.1.0
# via bandit
textual==0.52.1
textual==0.47.1
# via
# gp2040ce-binary-tools (pyproject.toml)
# textual-dev
textual-dev==1.5.1
textual-dev==1.4.0
# via gp2040ce-binary-tools (pyproject.toml)
tox==4.14.1
tox==4.12.1
# via gp2040ce-binary-tools (pyproject.toml)
typing-extensions==4.10.0
typing-extensions==4.9.0
# via
# mypy
# setuptools-scm
# textual
# textual-dev
uc-micro-py==1.0.3
uc-micro-py==1.0.2
# via linkify-it-py
virtualenv==20.25.1
virtualenv==20.25.0
# via tox
wheel==0.43.0
wheel==0.42.0
# via pip-tools
yarl==1.9.4
# via aiohttp

View File

@ -4,14 +4,15 @@
#
# pip-compile --output-file=requirements/requirements.txt pyproject.toml
#
grpcio==1.62.1
grpcio==1.60.0
# via grpcio-tools
grpcio-tools==1.62.1
grpcio-tools==1.60.0
# via gp2040ce-binary-tools (pyproject.toml)
linkify-it-py==2.0.3
linkify-it-py==2.0.2
# via markdown-it-py
markdown-it-py[linkify,plugins]==3.0.0
# via
# markdown-it-py
# mdit-py-plugins
# rich
# textual
@ -19,19 +20,19 @@ mdit-py-plugins==0.4.0
# via markdown-it-py
mdurl==0.1.2
# via markdown-it-py
protobuf==4.25.3
protobuf==4.25.2
# via grpcio-tools
pygments==2.17.2
# via rich
pyusb==1.2.1
# via gp2040ce-binary-tools (pyproject.toml)
rich==13.7.1
rich==13.7.0
# via textual
textual==0.52.1
textual==0.47.1
# via gp2040ce-binary-tools (pyproject.toml)
typing-extensions==4.10.0
typing-extensions==4.9.0
# via textual
uc-micro-py==1.0.3
uc-micro-py==1.0.2
# via linkify-it-py
# The following packages are considered to be unsafe in a requirements file: