aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/online_duration.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-06-21 01:06:26 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-06-21 01:06:26 +0300
commita69e91cbb19f1f74f779b20bf66f7220edfbae44 (patch)
treeb7a7f20eed9e0a1db555fd7da5b8c5c9c1eac6df /bin/online_duration.py
parentreplace users' "screen names" with their "domains" (diff)
downloadvk-scripts-a69e91cbb19f1f74f779b20bf66f7220edfbae44.tar.gz
vk-scripts-a69e91cbb19f1f74f779b20bf66f7220edfbae44.zip
add asserts just in case
Diffstat (limited to 'bin/online_duration.py')
-rw-r--r--bin/online_duration.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/online_duration.py b/bin/online_duration.py
index f074b08..5ddb34a 100644
--- a/bin/online_duration.py
+++ b/bin/online_duration.py
@@ -93,6 +93,10 @@ class OutputConverterJSON:
_WEEKDAY_FIELD = 'weekday'
_HOUR_FIELD = 'hour'
+ assert _DATE_FIELD not in map(str, _OUTPUT_USER_FIELDS)
+ assert _WEEKDAY_FIELD not in map(str, _OUTPUT_USER_FIELDS)
+ assert _HOUR_FIELD not in map(str, _OUTPUT_USER_FIELDS)
+
@staticmethod
def convert_user(user):
obj = OrderedDict()
@@ -124,6 +128,8 @@ class OutputWriterJSON:
_DURATION_FIELD = 'duration'
+ assert _DURATION_FIELD not in map(str, _OUTPUT_USER_FIELDS)
+
_CONVERT_KEY = {
Grouping.USER: OutputConverterJSON.convert_user,
Grouping.DATE: OutputConverterJSON.convert_date,