Skip to content

Commit

Permalink
morreeee linting
Browse files Browse the repository at this point in the history
  • Loading branch information
thundergolfer-two committed Mar 2, 2018
1 parent d22fe50 commit 5b92bfc
Show file tree
Hide file tree
Showing 2 changed files with 301 additions and 314 deletions.
6 changes: 5 additions & 1 deletion maicroft/activity_metrics_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ def process_metrics(user, comment):
Process the part of a comment that relates to metrics.
"""

comment_timestamp = datetime.datetime.fromtimestamp(
comment.created_utc, tz=pytz.utc
)

user.commented_dates.append(comment_timestamp)
user.comments_gilded += comment.gilded

days_ago_60 = user.today - datetime.timedelta(60)
if (comment_timestamp.date() - days_ago_60).days > 0:
user.metrics["heatmap"][
(comment_timestamp.date() - days_ago_60).days*24 + \
(comment_timestamp.date() - days_ago_60).days*24 +
comment_timestamp.hour
] += 1
user.metrics["recent_karma"][
Expand Down

0 comments on commit 5b92bfc

Please sign in to comment.