Skip to content

Commit 28873fc

Browse files
author
Damien Detcherry
committed
Removed the recognition reporting files. Don't need them anymore
1 parent 56105e6 commit 28873fc

8 files changed

+16
-200
lines changed

get_capturio.py

+3-24
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
from models.image_storage import ImageStorage
1616
from models.image_recognition import ImageRecognition
1717

18-
from config import Config
1918
from incoming_mail import IncomingMailHandler
2019
from get_capturio_mail import GetMailHandler
21-
from encryption import Encryption
2220
from moodstocks import Moodstocks
2321

2422
class GetCapturioHandler(InboundMailHandler):
@@ -201,38 +199,19 @@ def buildResponseMail(self, recognitionID):
201199
requesterAttachment = (self.requestedVcardName, self.requestedVcardContent)
202200
requesterAttachments = [requesterAttachment]
203201

204-
conf = Config()
205-
site_url = conf.site_url
206-
207-
# We encrypt the recognition ID for the error reporting URL for the requester
208-
encryptedIDForRequester = Encryption.getEncryptedIDForRequesterError(recognitionID)
209-
logging.info("Encrypted ID for Requester: %s" % encryptedIDForRequester)
210-
211-
urlForRequester = site_url + "reportrequester?id=%s&crypt=%s" % (recognitionID, encryptedIDForRequester)
212-
logging.info("URL that the requester can use to report an error: %s", urlForRequester)
213-
214-
self.responseHandler.sendResponse("vcardAttached", requesterAttachments, urlForRequester)
202+
self.responseHandler.sendResponse("vcardAttached", requesterAttachments)
215203

216204
#----------------------------
217205

218206
self.alertRecognition = GetMailHandler(self.requestedMail)
219207

220-
# We encrypt the recognition ID for the error reporting URL for the requester
221-
encryptedIDForRequested = Encryption.getEncryptedIDForRequestedError(recognitionID)
222-
logging.info("Encrypted ID for Requested: %s" % encryptedIDForRequested)
223-
224-
urlForRequested = site_url + "reportrequested?id=%s&crypt=%s" % (recognitionID, encryptedIDForRequested)
225-
logging.info("URL that the requested can use to report an error: %s", urlForRequested)
226-
227208
# We now instantiate the attachment for the requested
228209
if((self.requesterVcardName) and (self.requesterVcardContent)):
229210
requestedAttachment = (self.requesterVcardName, self.requesterVcardContent)
230211
requestedAttachments = [requestedAttachment]
231-
232-
self.alertRecognition.sendAlert("justCapturedRequesterWithVcard", requestedAttachments, urlForRequested, self.requesterLabel, self.requesterMail)
233-
212+
self.alertRecognition.sendAlert("justCapturedRequesterWithVcard", requestedAttachments, self.requesterLabel, self.requesterMail)
234213
else:
235-
self.alertRecognition.sendAlert("justCapturedRequesterWithoutVcard", None, urlForRequested, self.requesterLabel, self.requesterMail)
214+
self.alertRecognition.sendAlert("justCapturedRequesterWithoutVcard", None, self.requesterLabel, self.requesterMail)
236215

237216

238217
application = webapp.WSGIApplication([GetCapturioHandler.mapping()], debug=True)

get_capturio_mail.py

+12-18
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, senderMail):
1010
to = senderMail
1111
)
1212

13-
def sendResponse(self, typeOfResponse, attachments = None, url = None):
13+
def sendResponse(self, typeOfResponse, attachments = None):
1414
if(typeOfResponse == "noAttachment"):
1515
self.responseMail.subject = "We didn't find any ID image in your last email"
1616
self.responseMail.body = """
@@ -27,7 +27,7 @@ def sendResponse(self, typeOfResponse, attachments = None, url = None):
2727
We're sorry but we did not recognize the extension of your image. Please make sure to send a .jpeg/.jpg , .png or .gif image.
2828
"""
2929
elif(typeOfResponse == "noMatchingImage"):
30-
self.responseMail.subject = "We didn't find any vcard associated with your image"
30+
self.responseMail.subject = "We don't know this image"
3131
self.responseMail.body = """
3232
We're sorry but we don't know this image. Please retry with a picture with more light and/or precision.
3333
"""
@@ -40,9 +40,7 @@ def sendResponse(self, typeOfResponse, attachments = None, url = None):
4040
self.responseMail.subject = "[Capturio rocks] Please find attached the vcard you requested"
4141
self.responseMail.body = """
4242
Please find attached the vcard associated with the image you sent earlier. Isn't it magical? Feel free to send us other images.
43-
44-
If this is not the right vcard (more than exceptional), please click the following link to report it: %s. Our team will take a look at it ASAP. Thanks for helping us improve our service.
45-
""" % (url)
43+
"""
4644
self.responseMail.attachments = attachments
4745
elif(typeOfResponse == "error"):
4846
self.responseMail.subject = "An error occurred"
@@ -56,9 +54,9 @@ def sendResponse(self, typeOfResponse, attachments = None, url = None):
5654
signature = """
5755
Ping us soon again!
5856
59-
Captur.io's crew
57+
Captur.io crew
6058
61-
PS: If your vcard is not associated yet with your ID, send both to post@captur.io. For more information, go to http://captur.io
59+
PS: If your vcard is not associated yet with one of your personal object, just send both to post@captur.io. For more information, go to http://captur.io
6260
"""
6361

6462
self.responseMail.body = hello + self.responseMail.body + signature
@@ -67,31 +65,27 @@ def sendResponse(self, typeOfResponse, attachments = None, url = None):
6765
logging.info("responseMail sent")
6866

6967

70-
def sendAlert(self, typeOfResponse, attachments = None, url = None, label = None, mail = None):
68+
def sendAlert(self, typeOfResponse, attachments = None, label = None, mail = None):
7169

7270
if(typeOfResponse == "justCapturedRequesterWithVcard"):
73-
self.responseMail.subject = "You have been captured by another person on Captur.io"
71+
self.responseMail.subject = "[Vcard attached] You have been captured by another person on Captur.io"
7472
self.responseMail.body = """
75-
The following person: %s (%s) captured you with Capturio! He just receives your vcard because you have probably shown him your ID! Please find also attached his own vcard.
76-
77-
If you think there is an error, please click the following link to report it: %s. Our team will take a look at it ASAP. Thanks for helping us improve our service.
78-
""" % (label, mail, url)
73+
The following person: %s (%s) captured you with Capturio! He just receives your vcard because you have probably shown him your Capturio object! Please find also attached his own vcard.
74+
""" % (label, mail)
7975
self.responseMail.attachments = attachments
8076
elif(typeOfResponse == "justCapturedRequesterWithoutVcard"):
8177
self.responseMail.subject = "You have been captured by another person on Captur.io"
8278
self.responseMail.body = """
83-
The following person: %s (%s) captured you with Capturio! He just receives your vcard because you have probably shown him your ID!
84-
85-
If you think there is an error, please click the following link to report it: %s. Our team will take a look at it ASAP. Thanks for helping us improve our service.
86-
""" % (label, mail, url)
79+
The following person: %s (%s) captured you with Capturio! He just receives your vcard because you have probably shown him your Capturio object!
80+
""" % (label, mail)
8781

8882
hello = """
8983
Hey,
9084
"""
9185
signature = """
9286
Ping us soon again!
9387
94-
Capturio's crew
88+
Capturio crew
9589
"""
9690

9791
self.responseMail.body = hello + self.responseMail.body + signature

post_capturio_mail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def sendResponse(self, typeOfResponse, URL = ""):
7373
signature = """
7474
Ping us soon again!
7575
76-
Capturio's crew
76+
Capturio crew
7777
"""
7878

7979
self.responseMail.body = hello + self.responseMail.body + signature

report_error_requested.py

-69
This file was deleted.

report_error_requester.py

-69
This file was deleted.

templates/report_error/error_reported.html

-9
This file was deleted.

templates/report_error/invalid_link.html

-5
This file was deleted.

templates/report_error/nothing_found.html

-5
This file was deleted.

0 commit comments

Comments
 (0)