summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2017-10-23 09:54:21 +0200
committerMatěj Cepl <mcepl@cepl.eu>2017-10-23 09:54:21 +0200
commit3192b0e2ae05a8e0ce951272a7e99ea571587c2f (patch)
treef96da3c4a311df8e8bf5bed2ad43a5a7bbd7a445
parentfa31ad3b3b16a2d5439071787055ccfc65a24451 (diff)
downloadimap-folder-training-3192b0e2ae05a8e0ce951272a7e99ea571587c2f.tar.gz
Don't use .format() in logging
-rwxr-xr-xtrain_bogofilter8
1 files changed, 4 insertions, 4 deletions
diff --git a/train_bogofilter b/train_bogofilter
index 00f444d..45d7c7f 100755
--- a/train_bogofilter
+++ b/train_bogofilter
@@ -15,11 +15,11 @@ def process_folder(proc_fld_name, bogofilter_param, end_fld_name):
client.select(proc_fld_name)
_, resp = client.search(None, "ALL")
messages = resp[0].split()
- logging.debug('messages = {0}'.format(messages))
+ logging.debug('messages = %s', messages)
proc_msg_count = 0
for msgId in messages:
- logging.debug('msgId = {0}'.format(msgId))
+ logging.debug('msgId = %s', msgId)
typ, msg_data = client.fetch(msgId, '(RFC822)')
msg = hparser.parsestr(msg_data[0][1])
@@ -61,8 +61,8 @@ server = config.get("imap-training", "server")
client = imaplib.IMAP4_SSL(server)
client.login(login, password)
-for box in [('Spam', 's', 'Deleted Items'), ('Ham', 'n', 'INBOX')]:
- logging.debug('box = {0}'.format(box))
+for box in [('Junk', 's', 'Deleted Items'), ('Ham', 'n', 'INBOX')]:
+ logging.debug('box = %s', box)
processedCounter += process_folder(box[0], box[1], box[2])
client.logout()