Index: trunk/fundraiser-statistics/fundraiser-scripts/fundraiser_reporting.py |
— | — | @@ -69,6 +69,7 @@ |
70 | 70 | delta = datetime.timedelta(hours=-hours_back) |
71 | 71 | |
72 | 72 | time_obj = now + delta |
| 73 | + now = now + datetime.timedelta(hours=-1) # Move an hour back to terminate at 55 minute |
73 | 74 | |
74 | 75 | if time_obj.month < 10: |
75 | 76 | month = '0' + str(time_obj.month) |
— | — | @@ -102,7 +103,7 @@ |
103 | 104 | hour_e = str(now.hour) |
104 | 105 | |
105 | 106 | start_time = str(time_obj.year) + month + day + hour + '0000' |
106 | | - end_time = str(now.year) + month_e + day_e + hour_e + '0000' |
| 107 | + end_time = str(now.year) + month_e + day_e + hour_e + '5500' |
107 | 108 | |
108 | 109 | return [start_time, end_time] |
109 | 110 | |
— | — | @@ -552,9 +553,9 @@ |
553 | 554 | |
554 | 555 | # Current date & time |
555 | 556 | now = datetime.datetime.now() |
556 | | - UTC = 8 |
557 | | - delta = datetime.timedelta(hours=UTC) |
558 | | - now = now + delta |
| 557 | + #UTC = 8 |
| 558 | + #delta = datetime.timedelta(hours=UTC) |
| 559 | + #now = now + delta |
559 | 560 | |
560 | 561 | # ESTABLISH THE START TIME TO PULL ANALYTICS |
561 | 562 | hours_back = 24 |
— | — | @@ -622,13 +623,13 @@ |
623 | 624 | |
624 | 625 | # Look at campaigns over the past 24 hours |
625 | 626 | now = datetime.datetime.now() |
626 | | - hours_back = 24 |
| 627 | + hours_back = 72 |
627 | 628 | times = self.gen_date_strings_hr(now, hours_back) |
628 | 629 | |
629 | 630 | query_obj = qs.query_store() |
630 | 631 | sql_stmnt = mh.read_sql('./sql/report_latest_campaign.sql') |
631 | 632 | sql_stmnt = query_obj.format_query(query_name, sql_stmnt, [times[0]]) |
632 | | - |
| 633 | + print sql_stmnt |
633 | 634 | campaign_index = query_obj.get_campaign_index(query_name) |
634 | 635 | time_index = query_obj.get_time_index(query_name) |
635 | 636 | |