Exemplo n.º 1
0
def main(users, \
         start, \
         end, \
         whereToLook = None, \
         pattern = r", RETR",\
         email = False):
    if whereToLook == None:
        whereToLook = "\\\\fcpap01.fcproduction.local\\G6Log\\firstcoverage.com-transfers-%s.log" % end
    
    while end >= start:
        print end
        #print whereToLook
        for user in users:
            ##if os.path.isfile(downloads):
            ##    f = open(downloads)
            find = r"%s%s" % (user, pattern)
            print user
            mainpattern = re.compile(find, re.I)
            try:
                QuantCharterCheck.processFile(whereToLook, mainpattern, datetime.date.today(), validateOnly=True)
            except IOError:
                pass 
            print
            end -= datetime.timedelta(days=1)    
            whereToLook = "\\\\fcpap01.fcproduction.local\\G6Log\\firstcoverage.com-transfers-%s.log" % end

    if email:
        #Still need to build the email body with downloaders
        Email.notify()
Exemplo n.º 2
0
    print downloads
    supressRow = True
    for row in range(sheet.nrows-1):
        if( (sheet.cell_value(rowx = row+1, colx = 9) == '-' or sheet.cell_value(rowx = row+1, colx = 9) == '')\
            and sheet.cell_value(rowx = row+1, colx = 10) == ''):
            user = sheet.cell_value(rowx = row+1, colx = 3)
            if (user == ''):
                continue            
            #print user
            find = r"%s%s" % (user, pattern)
            ##errMsg = r"%s,PASV" % user
            ##print find
            mainpattern = re.compile(find, re.I)
            ##pasv = re.compile(errMsg)
            try:
                downloaders = QuantCharterCheck.processFile(downloads, mainpattern, start)
                if (supressRow):
                    ##processFile(downloads, re.compile(r"%s%s" % ('glg', pattern)), 1, 7, start, validateOnly=True)
                    supressRow = False
                    ##processFile(authentication, pasv, row+1, 7, start, err=True)
            except IOError:
                pass           
    #print downloaders
    start += datetime.timedelta(days=1)    
    downloads = "\\\\fcpap01.fcproduction.local\\G6Log\\firstcoverage.com-transfers-%s.log" % start
    ##authentication = "\\\\fcpap01.fcproduction.local/G6Log/firstcoverage.com-%s.log" % start

QuantEmailSender.generateQuantEmail(test, sheet, downloaders, ["\\\\Fcpstorage01\\reporting\\QuantCharterSpreadsheet.xls"])