Skip to content

Commit

Permalink
Change arguments to optional
Browse files Browse the repository at this point in the history
  • Loading branch information
juga0 committed Nov 17, 2017
1 parent ecf484e commit d084ce2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions emailpgp/mime/multipartpgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@ def __init__(self, _data=None, _subtype='encrypted', boundary=None,
description = MIMEApplicationPGPDescription()
payload = MIMEApplicationPGPPayload(_data)
_subparts = [description, payload]
MIMEMultipart.__init__(self, _subtype, boundary, _subparts,
policy=policy, **_params)
MIMEMultipart.__init__(self, _subtype=_subtype, boundary=boundary,
_subparts=_subparts, policy=policy, **_params)


class MIMEApplicationPGPPayload(MIMEApplication):
"""Class for generating application/octet-stream MIME documents."""

def __init__(self, _data,
_subtype='octet-stream; name="encrypted.asc"',
_encoder=encoders.encode_noop, policy=None, **_params):
_encoder=encoders.encode_noop, policy=policy.default,
**_params):
"""Create an application/octet-stream type MIME document.
_data is a string containing the raw application data.
Expand All @@ -74,15 +75,16 @@ def __init__(self, _data,
"""
_params["Content-Description"] = "OpenPGP encrypted message"
_params["Content-Disposition"] = 'inline; filename="encrypted.asc"'
MIMEApplication.__init__(self, _data, _subtype, _encoder,
policy=policy, **_params)
MIMEApplication.__init__(self, _data=_data, _subtype=_subtype,
_encoder=_encoder, policy=policy, **_params)


class MIMEApplicationPGPDescription(MIMEApplication):
"""Class for generating application/pgp-encrypted MIME documents."""

def __init__(self, _data="Version: 1\n", _subtype='pgp-encrypted',
_encoder=encoders.encode_noop, policy=None, **_params):
_encoder=encoders.encode_noop, policy=policy.default,
**_params):
"""Create an application/pgp-encrypted type MIME document.
_data is a string containing by default Version: 1\n.
Expand All @@ -98,5 +100,5 @@ def __init__(self, _data="Version: 1\n", _subtype='pgp-encrypted',
header.
"""
_params["Content-Description"] = "PGP/MIME version identification"
MIMEApplication.__init__(self, _data, _subtype, _encoder,
policy=policy, **_params)
MIMEApplication.__init__(self, _data=_data, _subtype=_subtype,
_encoder=_encoder, policy=policy, **_params)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='emailpgp',
version='0.1.2',
version='0.1.3',
description='Extend Python email.mime classes to add MIME'
' multipart/pgp-encrypted type messages.',
long_description='',
Expand Down

0 comments on commit d084ce2

Please sign in to comment.