Verison 0.45.0
·
297 commits
to master
since this release
v0.45.0
- BREAKING: Changed parsing of string multiple properties to remove the trailing null byte. This will cause the output of parsing them to differ.
- Updated typing information for some functions and classes.
- Fixed a bug with
MessageSignedBase.attachmentsthat would cause it to return None instead of an empty list if the number of normal attachments was 0 was the error behavior was set to ignore violations of the standard. - Updated
MessageSignedBase.attachmentsto usefunctools.cached_propertyinstead ofproperty. - Fixed spelling errors in some exception strings.
- Made
NamedPropertyBasea subclass ofabc.ABC. - Cleaned up some of the code for named properties to remove unused variables and remove inefficient code.
- Changed
PropBaseto be a subclass ofabc.ABC. - Added detailed versioning info to the README.
- Deprecated many private functions, including methods on many of the classes. Of primary note are
_getStreamand_getStringStream, which have been moved to the public API asgetStreamandgetStringStream. Any deprecated functions still exist and will forward to a public API function if they are not being removed. Additionally, all internal usage of them has been removed. This change is one of the big preparations that is needed for the1.0.0release.- As mentioned, a number of these deprecated functions have been moved to the public API. It is recommended that you run tests with your code after enabling deprecation warnings to see what should be changed.
- Removed items deprecated in or before
0.42.0. - Changed the API for the private method
_genRecipient. This is not intended for use outside of the module except for subclasses. The change removed the allowance of ints for the second argument, requiring that it be a valid enum type. - Convert many enum types to
IntEnum. - Extended functionality of
PropertiesStoreto allow for integer property names and getting a property based on just the ID. You can also get a list of all properties that use a given ID. - Added new function
PropertiesStore.getPropertieswhich gets a list of all properties matching the property ID. Return type is a list ofPropBaseinstances. - Added new function
PropertiesStore.getValuewhich looks for the first matchingFixedLengthPropand returns the value from it. - Improved internal code related to getting a property with a potentially unknown type.
- Added a number of entirely new functions to the public API on
MSGFile,AttachmentBase,PropertiesStore, andRecipientobjects:getMultipleBinary: Gets a multiple binary property as a list ofbytesobjects.getSingleOrMultipleBinary: A combination ofgetStreamandgetMultipleBinarywhich prefers a single binary stream. Returns a singlebytesobject or a list ofbytesobjects.getMultipleString: Gets a multiple string property as a list ofstrobjects.getSingleOrMultipleString: A combination ofgetStringStreamandgetMultipleStringwhich prefers a single string stream. Returns a single bytes objecct or a list of bytes objects.getPropertyVal: Shortcut forinstance.props.getValuethat allows new behavior to be added by overriding it.getNamedProp: Shortcut forinstance.namedProperties.get((propertyName, guid), default)that allows new behavior to be added by overriding it.
- Removed
Named._getStringStreamandNamed.sExists. The named properties storage will always use regular streams and not string streams. - Changed all
Namedmethods to no longer have a prefix argument. The prefix should always be false sense the named property mapping will only exist in the top level directory. - Adjusted
tryGetMimeTypeto allows any attachments whosedataproperty would return abytesinstance. - Changed internal code to use public API functions wherever possible. This includes making many private API functions use calls to the public API for getting bits of data.
- Fixed potential issue with
AttachmentBase.clsidwhich had the potential to cause some attachments to fail to generate a CLSID. - Outright removed or changed a significant portion of the private API. I have rarely, if ever, seen references to these parts, so this should cause you no issues. Some of these have also been moved to the public API, either identically or with changes, and the mapping is as such:
_getNamedAs->getNamedAs: Changed to always require a conversion argument. If you were previously using it to plainly get a named property or to handle the properly being None or a real value, you should use the return value ofgetNamedPropinstead._getPropertyAs->getPropertyAs: Same as above, usegetPropertyValinstead for None or plain access._getStreamAs->getStreamAs,getStringStreamAs: Once again, see above. UsegetStreamandgetStringStream, respectively.