v0.29.0
- [TeamMsgExtractor #207] Made it so that unspecified dates are handled properly. For clarification, an unspecified date is a custom value in MSG files for dates that means that the date is unspecified. It is distinctly different from a property not existing, which will still return None. For unspecified dates,
datetime.datetime.maxis returned. While perhaps not the best solution, it will have to do for now. - Fixed an issue where
utils.parseTypewas returning a string for the date when it makes more sense to return an actual datetime instance. - [TeamMsgExtractor #165] [TeamMsgExtractor #191] Completely redesigned all existing save functions. You can now properly save to custom locations under custom file names. This change may break existing code for several reasons. First, all arguments have been changed to keyword arguments. Second, a few keyword arguments have been renamed to better fit the naming conventions.
- [TeamMsgExtractor #200] Changed imports to use relative imports instead of hard imports where applicable.
- Updated the save functions to no longer rely on the current working directory to save things. The module now does what it can to use hard pathing so that if you spontaneously change working directory it will not cause problems. This should also allow for saving to be threaded, if I am correct.
- [TeamMsgExtractor #197] Added new property
Message.defaultFolderName. This property returns the default name to be used for a Message if none of the options change the name. - [TeamMsgExtractor #201] Fixed an issue where if the class type was all caps it would not be recognized. According to the documentation the comparisons should have been case insensitive, but I must have misread it at some point.
- [TeamMsgExtractor #202] Module will now handle path lengths in a semi-intelligent way to determine how best to save the MSG files. Default path length max is 255.
- [TeamMsgExtractor #203] Fixed an issue where having multiple "." characters in your file name would cause the directories to be incorrectly named when using the
useFileName(nowuseMsgFilename) argument in the save function. - [TeamMsgExtractor #204] Fixed an issue where the failsafe name used by attachments wasn't being encoded before hand causing encoding errors.
- MSG files with a type of simply
IPMwill now be returned asMSGFilebyopenMsg, as this specifies that no format has been specified. - [TeamMsgExtractor #214] Attachments that error because the MSG class type wasn't recognized or isn't supported will now correctly be
UnsupportedAttachmentinstead ofBrokenAttachment. - Improved internal code in many functions to make them faster and more efficient.
openMsgwill now tell you if a class type is simply unsupported rather than unrecognized. If it is found in the list, the function will raiseUnsupportedMSGTypeError.- Added caching to
MSGFile.listDir. I found that if you have larger files this single function might be taking up over half of the processing time because of how many times it is used in the module. - Fully implemented raw saving.
- Extended the
Contactclass to have more properties. - Added new function
MSGFile._ensureSetTypedwhich acts like the other ensure set functions but doesn't require you to know the type. Prefer to use other ensure set function when you know exactly what type it will be. - Changed
Message.saveRawtoMSGFile.saveRaw. - Changed
MSGFile.saveRawto take a path and save the contents to a zip file. - Corrected the help doc to reflect the current repository (was still on mattgwwalker).
- Fixed a bug that would cause an exception on trying to access the RTF body on a file that didn't have one. This is now correctly returning
None. - The
rawkeyword ofMessage.savenow actually works. - Added property
Attachment.randomFilenamewhich allows you to get the randomly generated name for attachments that don't have a usable one otherwise. - Added function
Attachment.regenerateRandomNamefor creating a new random name if necessary. - Added function
Attachment.getFilename. This function is used to get the name an attachment will be saved with given the specified arguments. Arguments are identical toAttachment.save. - Changed pull requests to reflect new style.
- Added additional properties for defined MSG file fields.
- Added zip file support for the
Attachment.saveandMessage.save. Simply pass a path for thezipkeyword argument and it will create a newZipFileinstance and save all of it's data inside there. Alternatively, you can pass an instance of a class that is either aZipFileorZipFile-like and it will simply use that. When this argument is defined, thecustomPathargument refers to the path inside the zip file. - Added the
htmlandrtfkeywords toMessage.save. These will attempt to save the body in the html or rtf format, respectively. If the program cannot save in those formats, it will raise an exception unless theallowFallbackkeyword argument isTrue. - Changed
utils.hasLento usehasattrinstead of the try-except method it was using. - Added new option
recipientSeparatortoMessageBaseallowing you to specify a custom recipient separator (default is ";" to match Microsoft Outlook). - Changed the
openMsgfunction inAttachmentto not be strict. This allows you to actually open the MSG file even if we don't recognize the type of embedded MSG that is being used. - Attempted to normalize encoding names throughout the module so that a certain encoding will only show up using one name and not multiple.
- Finally figured out what CRC32 algorithm is used in named properties after directly asking in a Microsoft forum (see the thread here). Fortunately the is already defined in the
compressed-rtfmodule so we can take advantage of that. - Reworked
MessageBase._genRecipientto improve it (because what on earth was that code it was using before?). Variables in the function are now more descriptive. Added comments in several places. - Many renames to better fit naming convention:
dev.setup_dev_loggertodev.setupDevLogger.MSGFile.fix_pathtoMSGFile.fixPath.MessageBase.save_attachmentstoMessageBase.saveAttachments.*.Existstoexists.*.ExistsTypedPropertyto*.existsTypedProperty.prop.create_proptoprop.createProp.Properties.attachment_counttoProperties.attachmentCount.Properties.next_attachment_idtoProperties.nextAttachmentId.Properties.next_recipient_idtoProperties.nextRecipientId.Properties.recipient_counttoProperties.recipientCount.utils.get_command_argstoutils.getCommandArgs.utils.get_full_class_nametoutils.getFullClassName.utils.get_inputtoutils.getInput.utils.has_lentoutils.hasLen.utils.setup_loggingtoutils.setupLogging.constants.int_to_data_typetoconstants.intToDataType.constants.int_to_intelligencetoconstants.intToIntelligence.constants.int_to_recipient_typetoconstants.intToRecipientType.- Misc internal function variables.