]> git.scottworley.com Git - srec/commitdiff
Turns out we don't need to track filename in Recording
authorScott Worley <scottworley@scottworley.com>
Mon, 6 Oct 2025 06:01:51 +0000 (23:01 -0700)
committerScott Worley <scottworley@scottworley.com>
Mon, 6 Oct 2025 06:01:51 +0000 (23:01 -0700)
The closure that updates the filesize display just captures it, it
doesn't need to fish it out of the global.

srec.py

diff --git a/srec.py b/srec.py
index 01b5a8ca7ec1200aff08d41fe85e718f224f5341..35efcaf19e451f101eb77a8a024c241c41c13a7d 100644 (file)
--- a/srec.py
+++ b/srec.py
@@ -20,7 +20,6 @@ from gi.repository import GLib  # nopep8 pylint: disable=wrong-import-position
 
 @dataclass
 class Recording:
-    filename: str
     process: subprocess.Popen[bytes]
 
 
@@ -77,7 +76,6 @@ def on_start_recording(_: Gtk.Button, stack: Gtk.Stack) -> None:
                ['-f', 'pulse', '-ac', '2', '-i', 'default', filename])
     # pylint: disable=consider-using-with
     recording = Recording(
-        filename=filename,
         process=subprocess.Popen(command, stdin=subprocess.PIPE))
     stack.set_visible_child_name("recording")