mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
Add delete file helper function
This commit is contained in:
parent
ef72832e5a
commit
39e1caec0f
1 changed files with 10 additions and 0 deletions
|
@ -1270,3 +1270,13 @@ def browse_path(path=None, include_hidden=False, filter_ext=''):
|
||||||
break
|
break
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
def delete_file(file_path):
|
||||||
|
logger.info("Tautulli Helpers :: Deleting file: %s", file_path)
|
||||||
|
try:
|
||||||
|
os.remove(file_path)
|
||||||
|
return True
|
||||||
|
except OSError:
|
||||||
|
logger.error("Tautulli Helpers :: Failed to delete file: %s", file_path)
|
||||||
|
return False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue