Bladeren bron

rem: removed unneeded functions

Mikael Koli 4 jaren geleden
bovenliggende
commit
6b71d29fdc
2 gewijzigde bestanden met toevoegingen van 1 en 15 verwijderingen
  1. 1 1
      redmail/email/body.py
  2. 0 14
      redmail/utils.py

+ 1 - 1
redmail/email/body.py

@@ -6,7 +6,7 @@ from typing import Dict, Union, ByteString
 from pathlib import Path
 
 
-from redmail.utils import is_filelike, is_bytes, is_pathlike
+from redmail.utils import is_bytes
 from redmail.utils import import_from_string
 
 from email.utils import make_msgid

+ 0 - 14
redmail/utils.py

@@ -11,19 +11,5 @@ def import_from_string(imp_str, if_missing="raise"):
             return None
         raise
 
-
-def is_filelike(value):
-    """Is file-like object or string of file path
-    
-    See: https://stackoverflow.com/a/1661354/13696660"""
-    try:
-        return hasattr(value, "read") or os.path.isfile(value)
-    except TypeError:
-        return False
-
 def is_bytes(value):
     return isinstance(value, (bytes, bytearray))
-
-def is_pathlike(value):
-    "Check if the value is path-like"
-    return isinstance(value, os.PathLike)