r85708 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85707‎ | r85708 | r85709 >
Date:00:48, 9 April 2011
Author:rfaulk
Status:deferred
Tags:
Comment:
modified references to gen_date_strings_* to reference the more general gen_date_string.
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/classes/TimestampProcessor.py (modified) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/classes/fundraiser_reporting.py (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/fundraiser_reporting.py
@@ -272,9 +272,9 @@
273273 #now = now + delta
274274
275275
276 - # ESTABLISH THE START TIME TO PULL ANALYTICS
 276+ """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=1 """
277277 hours_back = 24
278 - times = self.gen_date_strings_hr(now, hours_back)
 278+ times = self.gen_date_strings(now, hours_back,1,1)
279279
280280 start_time = times[0]
281281 end_time = times[1]
@@ -322,9 +322,9 @@
323323 #now = now + delta
324324
325325
326 - # ESTABLISH THE START TIME TO PULL ANALYTICS
327 - days_back = 7
328 - times = self.gen_date_strings_day(now, days_back)
 326+ """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=0 """
 327+ hours_back = 7 * 24 # 7 days back
 328+ times = self.gen_date_strings(now, hours_back,1,0)
329329
330330 start_time = times[0]
331331 end_time = times[1]
@@ -539,9 +539,9 @@
540540 #delta = datetime.timedelta(hours=UTC)
541541 #now = now + delta
542542
543 - # ESTABLISH THE START TIME TO PULL ANALYTICS
 543+ """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=1 """
544544 hours_back = 24
545 - times = self.gen_date_strings_hr(now, hours_back)
 545+ times = self.gen_date_strings(now, hours_back,1,1)
546546
547547 start_time = times[0]
548548 end_time = times[1]
@@ -628,10 +628,10 @@
629629 query_name = 'report_latest_campaign'
630630 self.init_db()
631631
632 - # Look at campaigns over the past 24 hours
 632+ """ Look at campaigns over the past 24 hours - TS format=1, TS resolution=1 """
633633 now = datetime.datetime.now()
634634 hours_back = 72
635 - times = self.gen_date_strings_hr(now, hours_back)
 635+ times = self.gen_date_strings(now, hours_back,1,1)
636636
637637 query_obj = qs.QueryStore()
638638 sql_stmnt = mh.read_sql('./sql/report_latest_campaign.sql')
@@ -779,9 +779,9 @@
780780 #delta = datetime.timedelta(hours=UTC)
781781 #now = now + delta
782782
783 - # ESTABLISH THE START TIME TO PULL ANALYTICS
 783+ """ ESTABLISH THE START TIME TO PULL ANALYTICS - TS format=1, TS resolution=1 """
784784 hours_back = 24
785 - times = self.gen_date_strings_hr(now, hours_back)
 785+ times = self.gen_date_strings_hr(now, hours_back,1,1)
786786
787787 start_time = times[0]
788788 end_time = times[1]
Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/TimestampProcessor.py
@@ -34,6 +34,18 @@
3535 databases. This includes mapping among timestamp formats and converting those formats to indexed
3636 lists and dictionaries.
3737
 38+ Examples of format definitions:
 39+
 40+ format 1 - 20080101000606
 41+ format 2 - 2008-01-01 00:06:06
 42+
 43+ Examples of resolution definitions:
 44+
 45+ resolution 0 - xxxx-xx-xx 00:00:00
 46+ resolution 1 - xxxx-xx-xx xx:00:00
 47+ resolution 2 - xxxx-xx-xx xx:xx:00
 48+ resolution 3 - xxxx-xx-xx xx:xx:xx
 49+
3850 METHODS:
3951
4052 normalize_timestamps - Takes a list of timestamps as input and converts it to a set of days, hours, or minutes counting back from 0

Status & tagging log