From ed2b919db4e00446161f53eceae94b303d466c4b Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Fri, 14 Oct 2022 21:54:39 +0100 Subject: [PATCH] Reorder functions --- app/musicmuster.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/musicmuster.py b/app/musicmuster.py index 76acbbc..c94351e 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -99,6 +99,28 @@ class Window(QMainWindow, Ui_MainWindow): self.timer.start(Config.TIMER_MS) self.connect_signals_slots() + def about(self) -> None: + """Get git tag and database name""" + + try: + git_tag = str( + subprocess.check_output( + ['git', 'describe'], stderr=subprocess.STDOUT + ) + ).strip('\'b\\n') + except subprocess.CalledProcessError as exc_info: + git_tag = str(exc_info.output) + + with Session() as session: + dbname = session.bind.engine.url.database + + QMessageBox.information( + self, + "About", + f"MusicMuster {git_tag}\n\nDatabase: {dbname}", + QMessageBox.Ok + ) + def clear_selection(self) -> None: """ Clear selected row""" @@ -408,28 +430,6 @@ class Window(QMainWindow, Ui_MainWindow): self.stop_playing(fade=True) - def about(self) -> None: - """Get git tag and database name""" - - try: - git_tag = str( - subprocess.check_output( - ['git', 'describe'], stderr=subprocess.STDOUT - ) - ).strip('\'b\\n') - except subprocess.CalledProcessError as exc_info: - git_tag = str(exc_info.output) - - with Session() as session: - dbname = session.bind.engine.url.database - - QMessageBox.information( - self, - "About", - f"MusicMuster {git_tag}\n\nDatabase: {dbname}", - QMessageBox.Ok - ) - def get_one_track(self, session: Session) -> Optional[Tracks]: """Show dialog box to select one track and return it to caller"""