mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Error reports are now dropped by FTP on drop.hardcoded.net
This commit is contained in:
23
hscommon/error_report.py
Normal file
23
hscommon/error_report.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2014-01-26
|
||||
# Copyright 2014 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
import ftplib
|
||||
import io
|
||||
import time
|
||||
import threading
|
||||
|
||||
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)
|
||||
|
||||
threading.Thread(target=do).start()
|
||||
Reference in New Issue
Block a user