Commit 5168c88c authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Vincent A

weboob.applications: use some python3 imports for email/io

parent f8b69fab
......@@ -21,7 +21,7 @@ from __future__ import print_function
from datetime import timedelta
from email import message_from_string, message_from_file
from email.Header import decode_header
from email.header import decode_header
from email.mime.text import MIMEText
from smtplib import SMTP
import os
......
......@@ -27,7 +27,7 @@ from __future__ import print_function
from threading import Thread, Lock
import copy
import sys
import StringIO
from io import StringIO
import os
import re
import subprocess
......@@ -163,7 +163,7 @@ class HistoryThread(Thread):
self.boomoney.importIndex = self.boomoney.importIndex + 1
return
boobank.stderr = StringIO.StringIO()
boobank.stderr = StringIO()
boobank.stdout = boobank.stderr
id, backend = self.account.split("@")
module_name, foo = boobank.weboob.backends_config.get_backend(backend)
......@@ -176,7 +176,7 @@ class HistoryThread(Thread):
content = ''
boobank.error = False
while count <= MAX_RETRIES and not (found and not boobank.error):
boobank.options.outfile = StringIO.StringIO()
boobank.options.outfile = StringIO()
boobank.error = False
# executing history command
......@@ -205,8 +205,8 @@ class HistoryThread(Thread):
# postprocessing of the ofx content to match MSMoney expectations
content = re.sub(r'<BALAMT>Not loaded', r'<BALAMT></BALAMT>', content)
input = StringIO.StringIO(content)
output = StringIO.StringIO()
input = StringIO(content)
output = StringIO()
field = {}
fields = ' '
for line in input:
......@@ -464,7 +464,7 @@ class Boomoney(Boobank):
def getList(self):
self.onecmd("select id label")
self.options.outfile = StringIO.StringIO()
self.options.outfile = StringIO()
self.onecmd("list")
listContent = self.options.outfile.getvalue()
self.options.outfile.close()
......
......@@ -21,8 +21,8 @@ from __future__ import print_function
from email.mime.text import MIMEText
from smtplib import SMTP
from email.Header import Header, decode_header
from email.Utils import parseaddr, formataddr, formatdate
from email.header import Header, decode_header
from email.utils import parseaddr, formataddr, formatdate
from email import message_from_file, message_from_string
from smtpd import SMTPServer
import time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment