1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Make Cocoa use the new FTP report-sender

This commit is contained in:
Virgil Dupras
2014-01-26 15:27:02 -05:00
parent 1104e24408
commit 60ca27b5e1
6 changed files with 21 additions and 18 deletions

View File

@@ -10,14 +10,18 @@ import ftplib
import io
import time
import threading
import logging
def send_error_report(text):
def do():
conn = ftplib.FTP('drop.hardcoded.net')
conn.login()
conn.cwd('/drop')
textfp = io.BytesIO(text.encode('utf-8'))
cmd = 'STOR report%d.txt' % time.time()
conn.storbinary(cmd, textfp)
try:
conn = ftplib.FTP('drop.hardcoded.net')
conn.login()
conn.cwd('/drop')
textfp = io.BytesIO(text.encode('utf-8'))
cmd = 'STOR report%d.txt' % time.time()
conn.storbinary(cmd, textfp)
except Exception as e:
logging.warning("Couldn't send error report: %s", e)
threading.Thread(target=do).start()