diff --git a/docs/_gen.py b/docs/_gen.py index c37ae592..00b36e81 100644 --- a/docs/_gen.py +++ b/docs/_gen.py @@ -5,7 +5,7 @@ import os import pathlib -from typing import Dict, List, NamedTuple, Tuple +from typing import Dict, List, NamedTuple DIRECTORY = pathlib.Path(__file__).parent @@ -130,7 +130,7 @@ def readProject(root) -> Dict[str, Package]: return {x: _makePackage(x, y) for x, y in initialRead.items()} -def writeAutoGenerated(files : List[str]) -> None: +def writeAutoGenerated(files: List[str]) -> None: """ Writes the _autogen.txt file. """ @@ -139,4 +139,4 @@ def writeAutoGenerated(files : List[str]) -> None: if __name__ == '__main__': - run() \ No newline at end of file + run() diff --git a/extract_msg/__main__.py b/extract_msg/__main__.py index 80034ab4..e8231c6f 100644 --- a/extract_msg/__main__.py +++ b/extract_msg/__main__.py @@ -101,7 +101,7 @@ def strSanitize(inp): msg.saveAttachments(**kwargs) else: msg.save(**kwargs) - except Exception as e: + except Exception: try: print(f'Error with file "{x}": {traceback.format_exc()}') except UnicodeEncodeError: @@ -111,5 +111,6 @@ def strSanitize(inp): if createdZip: _zip.close() + if __name__ == '__main__': main(sys.argv) diff --git a/extract_msg/attachments/custom_att_handler/lnk_obj_att.py b/extract_msg/attachments/custom_att_handler/lnk_obj_att.py index 73054275..8db16488 100644 --- a/extract_msg/attachments/custom_att_handler/lnk_obj_att.py +++ b/extract_msg/attachments/custom_att_handler/lnk_obj_att.py @@ -7,7 +7,7 @@ from functools import cached_property -from typing import List, Optional, TYPE_CHECKING +from typing import Optional, TYPE_CHECKING from . import registerHandler from .custom_handler import CustomAttachmentHandler @@ -106,4 +106,4 @@ def obj(self) -> None: -registerHandler(LinkedObjectAttachment) \ No newline at end of file +registerHandler(LinkedObjectAttachment) diff --git a/extract_msg/attachments/web_att.py b/extract_msg/attachments/web_att.py index 8210d144..7b6ebcc1 100644 --- a/extract_msg/attachments/web_att.py +++ b/extract_msg/attachments/web_att.py @@ -71,4 +71,4 @@ def url(self) -> Optional[str]: The url for the web attachment. If this is not set, that is probably an error. """ - return self.longPathname \ No newline at end of file + return self.longPathname diff --git a/extract_msg/constants/ps.py b/extract_msg/constants/ps.py index 7b61e7a7..94cb9db9 100644 --- a/extract_msg/constants/ps.py +++ b/extract_msg/constants/ps.py @@ -43,4 +43,4 @@ PSETID_SHARING: Final[str] = '{00062040-0000-0000-C000-000000000046}' PSETID_XMLEXTRACTEDENTITIES: Final[str] = '{23239608-685D-4732-9C55-4C95CB4E8E33}' PSETID_ATTACHMENT: Final[str] = '{96357F7F-59E1-47D0-99A7-46515C183B54}' -PSETID_CALENDAR_ASSISTANT: Final[str] = '{11000E07-B51B-40D6-AF21-CAA85EDAB1D0}' \ No newline at end of file +PSETID_CALENDAR_ASSISTANT: Final[str] = '{11000E07-B51B-40D6-AF21-CAA85EDAB1D0}' diff --git a/extract_msg/constants/st.py b/extract_msg/constants/st.py index 72c06b26..3d69f6c3 100644 --- a/extract_msg/constants/st.py +++ b/extract_msg/constants/st.py @@ -93,7 +93,7 @@ ST_BE_UI16: Final[struct.Struct] = struct.Struct('>H') ST_BE_UI32: Final[struct.Struct] = struct.Struct('>I') ST_BE_UI64: Final[struct.Struct] = struct.Struct('>Q') -ST_BE_F32: Final[struct.Struct] = struct.Struct('>f') +ST_BE_F32: Final[struct.Struct] = struct.Struct('>f') ST_BE_F64: Final[struct.Struct] = struct.Struct('>d') # Structs that use the system byte order, where consistency on a single system # is all that matters. Mainly used for quick casts between signed and unsigned. @@ -107,4 +107,4 @@ ST_SBO_UI64: Final[struct.Struct] = struct.Struct('@Q') # Struct for an RGB value that, in little endian, would be an int written in hex # as 0x00BBGGRR. -ST_RGB: Final[struct.Struct] = struct.Struct(' EmailMessage: if self.body: bodyParts.attach(MIMEText(self.body, 'plain', c)) if self.htmlBody: - bodyParts.attach(MIMEText(str(bs4.BeautifulSoup(self.htmlBody)), 'html', c)) + bodyParts.attach(MIMEText(str(bs4.BeautifulSoup(self.htmlBody, features = 'html.parser')), 'html', c)) # Process attachments. for att in self.attachments: