Skip to content

Commit

Permalink
v0.29.3
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElementalOfDestruction committed Jan 19, 2022
1 parent 194495c commit 068f5c9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
**v0.29.3**
* [[TeamMsgExtractor #226](https://github.com/TeamMsgExtractor/msg-extractor/issues/198)] Fix typo in command parsing that prevented the usage of `allowFallback`.
* Fixed main still manually navigating to a new directory with os.chdir instead of using `customPath`.
* Fixed issue in main where the `--html` option was being using for both html *and* rtf. This meant if you wanted rtf it would not have used it, and if you wanted html it would have thrown an error.
* Fixed `--out-name` having no effect.
* Fixed `--out` having no effect.

**v0.29.2**
* Fixed issue where the RTF injection was accidentally doing HTML escapes for non-encapsulated streams and *not* doing escapes for encapsulated streams.
* Fixed name error in `Message.save` causing bad logic. For context, the internal variable `zip` was renamed to `_zip` to avoid a name conflict with the built-in function. Some instances of it were missed.
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ And thank you to everyone who has opened an issue and helped us track down those
.. |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.29.2-blue.svg
:target: https://pypi.org/project/extract-msg/0.29.2/
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.29.3-blue.svg
:target: https://pypi.org/project/extract-msg/0.29.3/

.. |PyPI1| image:: https://img.shields.io/badge/python-2.7+-brightgreen.svg
:target: https://www.python.org/downloads/release/python-2715/
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__ = '2022-01-16'
__version__ = '0.29.2'
__date__ = '2022-01-19'
__version__ = '0.29.3'

import logging

Expand Down
6 changes: 2 additions & 4 deletions extract_msg/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,15 @@ def main():
utils.setupLogging(args.config_path, level, args.log, args.file_logging)
for x in args.msgs:
try:
with Message(x[0]) as msg:
with utils.openMsg(x[0]) as msg:
# Right here we should still be in the path in currentdir
if args.dump_stdout:
print(msg.body)
else:
os.chdir(out)
msg.save(json = args.json, useMsgFilename = args.use_filename, contentId = args.cid, html = args.html, rtf = args.html, allowFallback = args.allowFallback)
msg.save(customPath = out, customFilename = args.out_name, json = args.json, useMsgFilename = args.use_filename, contentId = args.cid, html = args.html, rtf = args.rtf, allowFallback = args.allowFallback)
except Exception as e:
print("Error with file '" + x[0] + "': " +
traceback.format_exc())
os.chdir(currentdir)

if __name__ == '__main__':
main()
3 changes: 2 additions & 1 deletion extract_msg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def getCommandArgs(args):
parser.add_argument('--rtf', dest='rtf', action='store_true',
help='Sets whether the output should be rtf. If this is not possible, will error.')
# --allow-fallback
parser.add_argument('--allow-fallback', dest='allowFallbac', action='store_true',
parser.add_argument('--allow-fallback', dest='allowFallback', action='store_true',
help='Tells the program to fallback to a different save type if the selected one is not possible.')
# --out-name NAME
parser.add_argument('--out-name', dest = 'out_name',
Expand All @@ -228,6 +228,7 @@ def getCommandArgs(args):
help='An msg file to be parsed')

options = parser.parse_args(args)

# Check if more than one of the following arguments has been specified
if options.html + options.rtf + options.json > 1:
raise IncompatibleOptionsError('Only one of these options may be selected at a time: --html, --json, --raw, --rtf')
Expand Down

0 comments on commit 068f5c9

Please sign in to comment.