Skip to content

Commit

Permalink
Merge pull request #345 from TeamMsgExtractor/next-release
Browse files Browse the repository at this point in the history
v0.39.2
  • Loading branch information
TheElementalOfDestruction authored Feb 27, 2023
2 parents b6460e0 + e50be1e commit 569176a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**v0.39.2**
* Fixed issues with `AttachmentBase.name` that could cause it to generate wrong.
* Added convenience function `MSGFile.exportBytes` which returns the exported version from `MSGFile.export` as bytes instead of writing it to a file or file-like object.

**v0.39.1**
* [[TeamMsgExtractor #333](https://github.com/TeamMsgExtractor/msg-extractor/issues/333)] Fixed typo in a warning.
* [[TeamMsgExtractor #334](https://github.com/TeamMsgExtractor/msg-extractor/issues/334)] Removed `__del__` method from `MSGFile`. It was there for cleanup, but wasn't planned well enough to stop it from causing issues. It may be reintroduced in the future if I can manage to remove the issues.
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ your access to the newest major version of extract-msg.
.. |License: GPL v3| image:: https://img.shields.io/badge/License-GPLv3-blue.svg
:target: LICENSE.txt

.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.39.1-blue.svg
:target: https://pypi.org/project/extract-msg/0.39.1/
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.39.2-blue.svg
:target: https://pypi.org/project/extract-msg/0.39.2/

.. |PyPI2| image:: https://img.shields.io/badge/python-3.6+-brightgreen.svg
:target: https://www.python.org/downloads/release/python-367/
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sys.path.insert(0, os.path.abspath(".."))

__author__ = 'Destiny Peterson & Matthew Walker'
__version__ = '0.39.1'
__version__ = '0.39.2'
__year__ = '2023'


Expand Down
4 changes: 2 additions & 2 deletions extract_msg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__author__ = 'Destiny Peterson & Matthew Walker'
__date__ = '2023-02-12'
__version__ = '0.39.1'
__date__ = '2023-02-26'
__version__ = '0.39.2'

import logging

Expand Down
2 changes: 1 addition & 1 deletion extract_msg/attachment_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def name(self) -> Optional[str]:
"""
The best name available for the file. Uses long filename before short.
"""
if type == AttachmentType.MSG:
if self.type is AttachmentType.MSG:
if self.displayName:
return self.displayName + '.msg'
return self.longFilename or self.shortFilename
Expand Down
9 changes: 9 additions & 0 deletions extract_msg/msg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import codecs
import copy
import datetime
import io
import logging
import os
import pathlib
Expand Down Expand Up @@ -517,6 +518,14 @@ def export(self, path) -> None:
writer.fromMsg(self)
writer.write(path)

def exportBytes(self) -> bytes:
"""
Saves a new copy of the MSG file, returning the bytes.
"""
out = io.BytesIO()
self.export(out)
return out.getvalue()

def fixPath(self, inp, prefix : bool = True) -> str:
"""
Changes paths so that they have the proper prefix (should :param prefix:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ universal=1
all =
extract-msg[mime]
mime =
python-magic>=0.4.27,<0.5.0
python-magic>=0.4.27,<0.5

0 comments on commit 569176a

Please sign in to comment.