From 0f66efc771f97f913b621f5e9926860dd73a2200 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 13 Jul 2018 00:45:29 -0700 Subject: [PATCH] No need to default `upper`, just let it be None. --- timesearch/timesearch.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/timesearch/timesearch.py b/timesearch/timesearch.py index f302f66..2a2b289 100644 --- a/timesearch/timesearch.py +++ b/timesearch/timesearch.py @@ -61,11 +61,6 @@ def timesearch( if lower is None: lower = 0 - if upper is None: - upper = common.get_now() + 86400 - - form = '{lower} - {upper} +{gain}' - if username: submissions = pushshift.get_submissions_from_user(username, lower=lower, upper=upper) else: @@ -74,6 +69,8 @@ def timesearch( if do_supplement: submissions = pushshift.supplement_reddit_data(submissions, chunk_size=100) submissions = common.generator_chunker(submissions, 200) + + form = '{lower} - {upper} +{gain}' for chunk in submissions: chunk.sort(key=lambda x: x.created_utc) new_count = database.insert(chunk)['new_submissions']