Subversion Repositories SmartDukaan

Rev

Rev 18058 | Rev 18382 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18058 Rev 18059
Line 345... Line 345...
345
    for r in result:
345
    for r in result:
346
        agentLoginList.append(str(r[0]))
346
        agentLoginList.append(str(r[0]))
347
    
347
    
348
    conn.close()
348
    conn.close()
349
    
349
    
350
    if len(list(set(agentLoginList))) >= 0:    
350
    if len(list(set(agentLoginList))) > 0:    
351
        datesql=FRESH_QUERY_LOGIN_TIME
351
        datesql=FRESH_QUERY_LOGIN_TIME
352
        conn = getDbConnection()
352
        conn = getDbConnection()
353
        cursor = conn.cursor()
353
        cursor = conn.cursor()
354
        cursor.execute(datesql)
354
        cursor.execute(datesql)
355
        result = cursor.fetchall()
355
        result = cursor.fetchall()
Line 722... Line 722...
722
    averageLoginTime=0
722
    averageLoginTime=0
723
    loginTime=0
723
    loginTime=0
724
    for r in result:
724
    for r in result:
725
        loginTime+=r[1].seconds
725
        loginTime+=r[1].seconds
726
        agentLoginList.append(str(r[0]))
726
        agentLoginList.append(str(r[0]))
727
    if len(list(set(agentLoginList))) >= 0:
727
    if len(list(set(agentLoginList))) > 0:
728
        averageLoginTime=loginTime/len(list(set(agentLoginList)))
728
        averageLoginTime=loginTime/len(list(set(agentLoginList)))
729
        hours=averageLoginTime/3600
729
        hours=averageLoginTime/3600
730
        minutesLeft=(averageLoginTime%3600)/60
730
        minutesLeft=(averageLoginTime%3600)/60
731
        worksheet.write(14,1,len(list(set(agentLoginList))),center_alignment)
731
        worksheet.write(14,1,len(list(set(agentLoginList))),center_alignment)
732
        worksheet.write(15,1,str(hours) + ':'+ str(minutesLeft),center_alignment)   
732
        worksheet.write(15,1,str(hours) + ':'+ str(minutesLeft),center_alignment)   
Line 1266... Line 1266...
1266
        m.setSubject(title)
1266
        m.setSubject(title)
1267
        m.setHtmlBody(message+"<br>"+message1+"<br>"+message2)
1267
        m.setHtmlBody(message+"<br>"+message1+"<br>"+message2)
1268
        m.send()
1268
        m.send()
1269
 
1269
 
1270
if __name__ == '__main__':
1270
if __name__ == '__main__':
1271
    main()
1271
    main()
1272
1272