Permalink
Browse files

minor fix

  • Loading branch information...
volpino committed Mar 18, 2012
1 parent 01eb1cb commit 248d2634176264379be9cdd068015d06072a27dc
Showing with 2 additions and 4 deletions.
  1. +2 −4 countries_stats.py
View
@@ -82,7 +82,7 @@ def process_ip(self, elem):
return
try:
self._country = self.gi.country_name_by_addr(elem.text)
- except (pygeoip.GeoIPError, IndexError, KeyError):
+ except Exception:
logging.warn("Skipping IP %s", elem.text)
else:
if self._country:
@@ -114,9 +114,7 @@ def process_revision(self, _):
end = datetime.date.today()
for dt in rrule(MONTHLY, dtstart=start, until=end):
dt = dt.strftime("%Y/%m")
- if dt in self.data:
- break
- else:
+ if dt not in self.data:
self.data[dt] = Counter()
self.data[current_date][self._country] += 1

0 comments on commit 248d263

Please sign in to comment.