ultralytics 8.0.33 security updates and fixes (#896)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Mert Can Demir <validatedev@gmail.com>
This commit is contained in:
parent
a5a3ce88b3
commit
254adfa652
24 changed files with 87 additions and 61 deletions
|
|
@ -6,7 +6,6 @@ import os
|
|||
import urllib
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile
|
||||
|
||||
|
||||
class WorkingDirectory(contextlib.ContextDecorator):
|
||||
|
|
@ -57,16 +56,6 @@ def increment_path(path, exist_ok=False, sep='', mkdir=False):
|
|||
return path
|
||||
|
||||
|
||||
def unzip_file(file, path=None, exclude=('.DS_Store', '__MACOSX')):
|
||||
# Unzip a *.zip file to path/, excluding files containing strings in exclude list
|
||||
if path is None:
|
||||
path = Path(file).parent # default path
|
||||
with ZipFile(file) as zipObj:
|
||||
for f in zipObj.namelist(): # list all archived filenames in the zip
|
||||
if all(x not in f for x in exclude):
|
||||
zipObj.extract(f, path=path)
|
||||
|
||||
|
||||
def file_age(path=__file__):
|
||||
# Return days since last file update
|
||||
dt = (datetime.now() - datetime.fromtimestamp(Path(path).stat().st_mtime)) # delta
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue