Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added missing reloadifnecessary

  • Loading branch information...
commit 1402d7ef14252383fa84fc14e797a34f074121e7 1 parent 229f312
authored March 22, 2013

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  src/postomaat/plugins/geoip.py
5  src/postomaat/plugins/geoip.py
@@ -40,11 +40,10 @@ def __init__(self, filename, **kw):
40 40
             self.logger=logging.getLogger(str(self))
41 41
         if not hasattr(self,'lastreload'):
42 42
             self.lastreload=0
43  
-        self.file = filename
44 43
         
45 44
         self._initlocal(**kw)
46 45
         
47  
-        self.reloadifnecessary(self.file)
  46
+        self.reloadifnecessary(filename)
48 47
         
49 48
     
50 49
     def reloadifnecessary(self, filename):
@@ -88,6 +87,7 @@ def _reallyloadData(self, filename):
88 87
         
89 88
     
90 89
     def country_code(self, ip):
  90
+        self.reloadifnecessary(self.filename)
91 91
         cc = u''
92 92
         try:
93 93
             cc = self.geoip.country_code_by_addr(ip)
@@ -96,6 +96,7 @@ def country_code(self, ip):
96 96
         return cc
97 97
     
98 98
     def country_name(self, cc):
  99
+        self.reloadifnecessary(self.filename)
99 100
         country = 'unknown'
100 101
         if cc:
101 102
             i = pygeoip.const.COUNTRY_CODES.index(cc)

0 notes on commit 1402d7e

Please sign in to comment.
Something went wrong with that request. Please try again.