Extract the parent folder name from a path
(path)
| 968 | |
| 969 | |
| 970 | def get_parent_folder(path): |
| 971 | """Extract the parent folder name from a path""" |
| 972 | if not path: |
| 973 | return "" |
| 974 | from pathlib import Path |
| 975 | |
| 976 | parent = Path(path).parent |
| 977 | if str(parent) == "." or str(parent) == "/": |
| 978 | return "" |
| 979 | return parent.name |
| 980 | |
| 981 | |
| 982 | def format_timestamp(timestamp): |
nothing calls this directly
no outgoing calls
no test coverage detected