Permalink
Browse files

added missing reloadifnecessary

  • Loading branch information...
1 parent 229f312 commit 1402d7ef14252383fa84fc14e797a34f074121e7 neonknight committed Mar 22, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/postomaat/plugins/geoip.py
@@ -40,11 +40,10 @@ def __init__(self, filename, **kw):
self.logger=logging.getLogger(str(self))
if not hasattr(self,'lastreload'):
self.lastreload=0
- self.file = filename
self._initlocal(**kw)
- self.reloadifnecessary(self.file)
+ self.reloadifnecessary(filename)
def reloadifnecessary(self, filename):
@@ -88,6 +87,7 @@ def _reallyloadData(self, filename):
def country_code(self, ip):
+ self.reloadifnecessary(self.filename)
cc = u''
try:
cc = self.geoip.country_code_by_addr(ip)
@@ -96,6 +96,7 @@ def country_code(self, ip):
return cc
def country_name(self, cc):
+ self.reloadifnecessary(self.filename)
country = 'unknown'
if cc:
i = pygeoip.const.COUNTRY_CODES.index(cc)

0 comments on commit 1402d7e

Please sign in to comment.