From 9574166efbf891ebf0c09f7c23e45829629b66e2 Mon Sep 17 00:00:00 2001 From: Eshan Roy Date: Mon, 3 Jun 2024 05:50:27 +0530 Subject: [PATCH] :book: docs(do_shutdown) explanation added --- snigdhaos-kernel-manager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snigdhaos-kernel-manager.py b/snigdhaos-kernel-manager.py index 5042c18..3f8d0bf 100644 --- a/snigdhaos-kernel-manager.py +++ b/snigdhaos-kernel-manager.py @@ -64,10 +64,16 @@ class Main(Gtk.Application): Gtk.Application.do_startup(self) def do_shutdown(self): + # invoking this method, the shutdown process of the Gtk application is initiated Gtk.Application.do_shutdown(self) + # checks if a file, referred to by the variable lock_file, exists in the file system + # os.path.exists() function checks whether the specified path exists and returns True if it does, and False otherwise if os.path.exists(lock_file): + # if the file specified by lock_file exists, this removes it from the file system os.remove(lock_file) + # checks if a file specified by the variable pid_file exists in the file system if os.path.exists(pid_file): + # if the file specified by pid_file exists, removes it from the file system os.remove(pid_file) def signal_handler(sig, frame): @@ -111,4 +117,4 @@ if __name__ == "__main__": else: fn.sys.exit(1) except Exception as e: - print("Exception in __main__: %s" % e) \ No newline at end of file + print("Exception in __main__: %s" % e)