Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Pull out magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
robyoung committed Aug 1, 2013
1 parent 0bc9b43 commit fe766d6
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions backdrop/contrib/evl_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ def ceg_volumes(rows):
http://goo.gl/52VcMe
"""
RELICENSING_WEB_INDEX = 5
RELICENSING_IVR_INDEX = 6
RELICENSING_AGENT_INDEX = 9
SORN_WEB_INDEX = 11
SORN_IVR_INDEX = 12
SORN_AGENT_INDEX = 13
AGENT_AUTOMATED_DUPES_INDEX = 15
CALLS_ANSWERED_BY_ADVISOR_INDEX = 17

def ceg_keys(rows):
return [
"_timestamp", "timeSpan", "relicensing_web", "relicensing_ivr",
Expand All @@ -23,9 +32,15 @@ def ceg_rows(rows):
if not isinstance(date, datetime):
return
yield [
date, "month", rows[5][column], rows[6][column],
rows[9][column], rows[11][column], rows[12][column],
rows[13][column], rows[15][column], rows[17][column]
date, "month",
rows[RELICENSING_WEB_INDEX][column],
rows[RELICENSING_IVR_INDEX][column],
rows[RELICENSING_AGENT_INDEX][column],
rows[SORN_WEB_INDEX][column],
rows[SORN_IVR_INDEX][column],
rows[SORN_AGENT_INDEX][column],
rows[AGENT_AUTOMATED_DUPES_INDEX][column],
rows[CALLS_ANSWERED_BY_ADVISOR_INDEX][column],
]

def ceg_date(rows, column):
Expand Down

0 comments on commit fe766d6

Please sign in to comment.