Esempio n. 1
0
    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')
Esempio n. 2
0
    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')
Esempio n. 3
0
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[:]
Esempio n. 4
0
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[:]
Esempio n. 5
0
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)
Esempio n. 6
0
 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)
Esempio n. 7
0
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)
Esempio n. 8
0
 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)
Esempio n. 9
0
# 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

Esempio n. 10
0
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)
Esempio n. 11
0
 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)
Esempio n. 12
0
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)
Esempio n. 13
0
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)
Esempio n. 14
0
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)
Esempio n. 15
0
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)
Esempio n. 16
0
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)
Esempio n. 17
0
# 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):
Esempio n. 18
0
 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)
Esempio n. 19
0
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)
Esempio n. 20
0
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)
Esempio n. 21
0
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)
Esempio n. 22
0
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)