Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

simplify the code a little bit

  • Loading branch information...
commit c609f171078ef03861ac641590d2abcd50086a23 1 parent aba634d
@Rafiot Rafiot authored
Showing with 6 additions and 4 deletions.
  1. +4 −2 lib/ranking/reports.py
  2. +2 −2 website/master_controler.py
View
6 lib/ranking/reports.py
@@ -67,10 +67,12 @@ def set_date(self, date):
self.date = date.isoformat()
return self.date
- def set_sources(self, date):
+ def set_sources(self, date = None):
"""
Set the sources paset on a `date`
"""
+ if date is None:
+ date = self.date
self.sources = self.global_db.smembers(\
'{date}{sep}{key}'.format( date = date, \
sep = self.separator,\
@@ -107,7 +109,7 @@ def __init__(self, date, ip_version = 4):
self.last_ranking = None
self.date_raw = date
self.set_date(date)
- self.set_sources(date)
+ self.set_sources()
self.set_dates()
def flush_temp_db(self):
View
4 website/master_controler.py
@@ -41,8 +41,8 @@ def set_params(self, date = None):
self.graph_first_date = datetime.date.today() - datetime.timedelta(days=30)
if date is None:
date = self.graph_last_date
- date = self.report.set_date(date)
- self.report.set_sources(date)
+ self.report.set_date(date)
+ self.report.set_sources()
self.report.set_dates()
Please sign in to comment.
Something went wrong with that request. Please try again.