def outputErrors(self): if self.errors: # show the errors in a message box tkinter.messagebox.showinfo(message='\n'.join(self.errors)) # email the errors self.email('\n'.join(self.errors)) # write the errors to a file if settings.isset('standarderrordir'): with open(os.path.join(settings.get('standarderrordir'),'errorlog.txt'), 'a') as f: for error in self.errors: f.write(error + '\n')
def outputErrors(self): if self.errors: # show the errors in a message box tkinter.messagebox.showinfo(message='\n'.join(self.errors)) # email the errors self.email('\n'.join(self.errors)) # write the errors to a file if settings.isset('standarderrordir'): with open( os.path.join(settings.get('standarderrordir'), 'errorlog.txt'), 'a') as f: for error in self.errors: f.write(error + '\n')
def outputErrors(): if errors: # show the errors in a message box tkinter.messagebox.showinfo(message="\n".join(errors)) # email the errors email("\n".join(errors)) # write the errors to a file if settings.isset("stacksocialerrordir"): with open(os.path.join(settings.get("stacksocialerrordir"), "errorlog.txt"), "a") as f: for error in errors: f.write(error + "\n") # delete the errors del errors[:]
def outputErrors(): if errors: # show the errors in a message box tkinter.messagebox.showinfo(message='\n'.join(errors)) # email the errors email('\n'.join(errors)) # write the errors to a file if settings.isset('halfoffdealserrordir'): with open(os.path.join(settings.get('halfoffdealserrordir'),'errorlog.txt'), 'a') as f: for error in errors: f.write(error + '\n') # delete the errors del errors[:]
def email(body): if settings.isset('mailDSOLto'): to = settings.get('mailDSOLto') subject = 'SkuTouch could not validate orders from Dance Shoes Online' print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(self, body): if settings.isset('mailstandardto'): to = settings.get('mailstandardto') subject = 'SkuTouch could not validate orders from '+self.market print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(body): if settings.isset('mailrestaurantto'): to = settings.get('mailrestaurantto') subject = 'SkuTouch could not validate orders from Restaurant' print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(self, body): if settings.isset('mailstandardto'): to = settings.get('mailstandardto') subject = 'SkuTouch could not validate orders from ' + self.market print('Sending email to ' + to) mail.sendmail(to, subject, body)
# Brenton Klassen # Module for keeping track of incorrect orders # 12/5/2014 import os import csv import db import atexit import settings incorrectOrders = dict() filePath = '' if settings.isset('incorrectOrdersFile'): filePath = settings.get('incorrectOrdersFile') if os.path.isfile(filePath): with open(filePath) as f: for line in f: if line.strip(): lineElements = line.split() merchantId = lineElements[0].strip() shortOrderRef = lineElements[1].strip() name = ' '.join(lineElements[2:]) incorrectOrders[(merchantId, shortOrderRef)] = name
def email(body): if settings.isset('maillightaketo'): to = settings.get('maillightaketo') subject = 'SkuTouch could not validate orders from Lightake' print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(self, body): if settings.isset('mailmarvellousto'): to = settings.get('mailmarvellousto') subject = 'SkuTouch could not validate orders from Marvellous' print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(body): if settings.isset('maildealchickento'): to = settings.get('maildealchickento') subject = 'SkuTouch could not validate orders from Dealchicken' print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(body): if settings.isset("mailstacksocialto"): to = settings.get("mailstacksocialto") subject = "SkuTouch could not validate orders from StackSocial" print("Sending email to " + to) mail.sendmail(to, subject, body)
# Brenton Klassen # Module for keeping track of incorrect orders # 12/5/2014 import os import csv import db import atexit import settings incorrectOrders = dict() filePath = '' if settings.isset('incorrectOrdersFile'): filePath = settings.get('incorrectOrdersFile') if os.path.isfile(filePath): with open(filePath) as f: for line in f: if line.strip(): lineElements = line.split() merchantId = lineElements[0].strip() shortOrderRef = lineElements[1].strip() name = ' '.join(lineElements[2:]) incorrectOrders[(merchantId,shortOrderRef)] = name def exists(merchantId,shortOrderRef):
def email(body): if settings.isset('mailstacksocialto'): to = settings.get('mailstacksocialto') subject = 'SkuTouch could not validate orders from StackSocial' print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(body): if settings.isset('mailhalfoffdealsto'): to = settings.get('mailhalfoffdealsto') subject = 'SkuTouch could not validate orders from Half Off Delas' print('Sending email to ' + to) mail.sendmail(to, subject, body)
def email(body): if settings.isset('mailsweetjackto'): to = settings.get('mailsweetjackto') subject = 'SkuTouch could not validate orders from Sweetjack' print('Sending email to ' + to) mail.sendmail(to, subject, body)