From 53f9f9f3ac5c5a3e8fe8d8a3a386b815fee37611 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sat, 24 Sep 2016 20:55:25 +0300 Subject: [PATCH] Add remove_file method to utils --- youtube_dl_gui/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youtube_dl_gui/utils.py b/youtube_dl_gui/utils.py index 1ed13dc..f19f330 100644 --- a/youtube_dl_gui/utils.py +++ b/youtube_dl_gui/utils.py @@ -106,6 +106,12 @@ os_path_expanduser = convert_on_bounds(os.path.expanduser) if os.name == 'nt': os_startfile = convert_on_bounds(os.startfile) +def remove_file(filename): + if os_path_exists(filename): + os.remove(filename) + return True + + return False def remove_shortcuts(path): """Return given path after removing the shortcuts. """