Formatting and adding the requirements that were removed as part of the "Included charset detection" patch that was reverted. Added all but chardet~=3.0.4 which is not needed with this fix.
This commit is contained in:
parent
f71ef226bf
commit
14b318b0e2
@ -51,13 +51,13 @@ class BaseFolder:
|
|||||||
# Establish some policies
|
# Establish some policies
|
||||||
self.policy = {
|
self.policy = {
|
||||||
'7bit':
|
'7bit':
|
||||||
policy.default.clone(cte_type='7bit',utf8=False,refold_source='none'),
|
policy.default.clone(cte_type='7bit', utf8=False, refold_source='none'),
|
||||||
'7bit-RFC':
|
'7bit-RFC':
|
||||||
policy.default.clone(cte_type='7bit',utf8=False,refold_source='none',linesep='\r\n'),
|
policy.default.clone(cte_type='7bit', utf8=False, refold_source='none', linesep='\r\n'),
|
||||||
'8bit':
|
'8bit':
|
||||||
policy.default.clone(cte_type='8bit',utf8=True,refold_source='none'),
|
policy.default.clone(cte_type='8bit', utf8=True, refold_source='none'),
|
||||||
'8bit-RFC':
|
'8bit-RFC':
|
||||||
policy.default.clone(cte_type='8bit',utf8=True,refold_source='none',linesep='\r\n'),
|
policy.default.clone(cte_type='8bit', utf8=True, refold_source='none', linesep='\r\n'),
|
||||||
}
|
}
|
||||||
# Parsers
|
# Parsers
|
||||||
self.parse = {
|
self.parse = {
|
||||||
@ -370,7 +370,7 @@ class BaseFolder:
|
|||||||
return len(self.getmessagelist())
|
return len(self.getmessagelist())
|
||||||
|
|
||||||
def getmessage(self, uid):
|
def getmessage(self, uid):
|
||||||
"""Returns and email message object."""
|
"""Returns an email message object."""
|
||||||
|
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@ -662,7 +662,7 @@ class BaseFolder:
|
|||||||
"""Adds new header to the provided message.
|
"""Adds new header to the provided message.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
- msg: message itself
|
- msg: message object
|
||||||
- headername: name of the header to add
|
- headername: name of the header to add
|
||||||
- headervalue: value of the header to add
|
- headervalue: value of the header to add
|
||||||
|
|
||||||
@ -673,7 +673,7 @@ class BaseFolder:
|
|||||||
self.ui.debug('', 'addmessageheader: called to add %s: %s' %
|
self.ui.debug('', 'addmessageheader: called to add %s: %s' %
|
||||||
(headername, headervalue))
|
(headername, headervalue))
|
||||||
|
|
||||||
msg.add_header(headername,headervalue)
|
msg.add_header(headername, headervalue)
|
||||||
return
|
return
|
||||||
|
|
||||||
def getmessageheader(self, msg, headername):
|
def getmessageheader(self, msg, headername):
|
||||||
@ -682,7 +682,7 @@ class BaseFolder:
|
|||||||
Header name is case-insensitive.
|
Header name is case-insensitive.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
- msg: message itself
|
- msg: message object
|
||||||
- headername: name of the header to be searched
|
- headername: name of the header to be searched
|
||||||
|
|
||||||
Returns: header value or None if no such header was found.
|
Returns: header value or None if no such header was found.
|
||||||
@ -697,7 +697,7 @@ class BaseFolder:
|
|||||||
Header name is case-insensitive.
|
Header name is case-insensitive.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
- msg: message itself
|
- msg: message object
|
||||||
- headername: name of the header to be searched
|
- headername: name of the header to be searched
|
||||||
|
|
||||||
Returns: list of header values or empty list if no such header was
|
Returns: list of header values or empty list if no such header was
|
||||||
@ -705,13 +705,13 @@ class BaseFolder:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.ui.debug('', 'getmessageheaderlist: called to get %s' % name)
|
self.ui.debug('', 'getmessageheaderlist: called to get %s' % name)
|
||||||
return msg.get_all(headername,[])
|
return msg.get_all(headername, [])
|
||||||
|
|
||||||
def deletemessageheaders(self, msg, header_list):
|
def deletemessageheaders(self, msg, header_list):
|
||||||
"""Deletes headers in the given list from the message.
|
"""Deletes headers in the given list from the message.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
- msg: message itself
|
- msg: message object
|
||||||
- header_list: list of headers to be deleted or just the header name
|
- header_list: list of headers to be deleted or just the header name
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -731,8 +731,8 @@ class BaseFolder:
|
|||||||
Date field header by default.
|
Date field header by default.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
- msg: message itself
|
- msg: message object
|
||||||
- header: headers to extract the date from
|
- header: header to extract the date from
|
||||||
|
|
||||||
Returns: timestamp or `None` in the case of failure.
|
Returns: timestamp or `None` in the case of failure.
|
||||||
"""
|
"""
|
||||||
|
@ -254,7 +254,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
|
|
||||||
# Interface from BaseFolder
|
# Interface from BaseFolder
|
||||||
def getmessage(self, uid):
|
def getmessage(self, uid):
|
||||||
"""Returns and email message object."""
|
"""Returns an email message object."""
|
||||||
|
|
||||||
filename = self.messagelist[uid]['filename']
|
filename = self.messagelist[uid]['filename']
|
||||||
filepath = os.path.join(self.getfullname(), filename)
|
filepath = os.path.join(self.getfullname(), filename)
|
||||||
|
@ -3,3 +3,8 @@ gssapi[kerberos]
|
|||||||
portalocker[cygwin]
|
portalocker[cygwin]
|
||||||
rfc6555
|
rfc6555
|
||||||
distro
|
distro
|
||||||
|
|
||||||
|
imaplib2~=3.5
|
||||||
|
urllib3~=1.25.9
|
||||||
|
certifi~=2020.6.20
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user