original_docstring:  fetch geoip addresses, if not downloaded or outdated force an update
              :return: iterator
          
docstring: fetch geoip addresses, if not downloaded or outdated force an update
docstring_tokens: fetch geoip addresses if not downloaded or outdated force an update
code: def _fetch_geo(self, geoitem):
          """ fetch geoip addresses, if not downloaded or outdated force an update
              :return: iterator
          """
          do_update = True
          if os.path.isfile('/usr/local/share/GeoIP/alias/NL-IPv4'):
              fstat = os.stat('/usr/local/share/GeoIP/alias/NL-IPv4')
              if (time.time() - fstat.st_mtime) < (86400 - 90):
                  do_update = False
          if do_update:
              syslog.syslog(syslog.LOG_ERR, 'geoip updated (files: %s lines: %s)' % geoip.download_geolite())
  
          for proto in self._proto.split(','):
              geoip_filename = "/usr/local/share/GeoIP/alias/%s-%s" % (geoitem, proto)
              if os.path.isfile(geoip_filename):
                  with open(geoip_filename) as f_in:
                      for line in f_in:
                          for address in self._parse_address(line):
                              yield address
code_tokens: def _fetch_geo ( self , geoitem ) : do_update = True if os . path . isfile ( '/usr/local/share/GeoIP/alias/NL-IPv4' ) : fstat = os . stat ( '/usr/local/share/GeoIP/alias/NL-IPv4' ) if ( time . time ( ) - fstat . st_mtime ) < ( 86400 - 90 ) : do_update = False if do_update : syslog . syslog ( syslog . LOG_ERR , 'geoip updated (files: %s lines: %s)' % geoip . download_geolite ( ) ) for proto in self . _proto . split ( ',' ) : geoip_filename = "/usr/local/share/GeoIP/alias/%s-%s" % ( geoitem , proto ) if os . path . isfile ( geoip_filename ) : with open ( geoip_filename ) as f_in : for line in f_in : for address in self . _parse_address ( line ) : yield address
short_docstring: fetch geoip addresses, if not downloaded or outdated force an update
short_docstring_tokens: fetch geoip addresses if not downloaded or outdated force an update
comment: """ fetch geoip addresses, if not downloaded or outdated force an update
              :return: iterator
          """