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()
import xlrd import re import TrackedUsers import QuantCharterCheck import QuantEmailSender test = False trackedUsers = [r'hbkticker',r'QuantResearchGroup', r'csnevill', r'stevenscapital', r'PFTC', r'BGI'] end = datetime.date.today() if not test: start = end + datetime.timedelta(days = -30) else: start = end + datetime.timedelta(days = -30) #be sure you can connect to FCPAP01 QuantCharterCheck.checkConnection() TrackedUsers.main(trackedUsers, end, end) downloads = "\\\\fcpap01.fcproduction.local\\G6Log\\firstcoverage.com-transfers-%s.log" % start quants = xlrd.open_workbook("\\\\Fcpstorage01\\reporting\\QuantCharterSpreadsheet.xls") sheet = quants.sheet_by_index(0) pattern = r", RETR" while start <= end: print start 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) == ''):