Compare commits

..

No commits in common. "83f109ee60f393f98bc113700053d707fe0b5f7e" and "b34f39c0130a68390948ff681e825ec8affc8ad8" have entirely different histories.

5 changed files with 7 additions and 22 deletions

2
.gitignore vendored
View File

@ -8,5 +8,5 @@ maps/map_all.png
maps/map_all_dark.png
log/
*.db
config*.cfg
config.cfg
TODO

View File

@ -9,21 +9,6 @@ console = Console()
conn = sqlite3.connect(f'{selfpath}/../ipinfo.db')
c = conn.cursor()
# GeoLoc
def get_geoloc(codigo):
if codigo == 200:
consulta = """
SELECT DISTINCT geoloc FROM registro WHERE ip in ( SELECT `ip` from visita WHERE cod_html=='200');
"""
else:
consulta = """
SELECT DISTINCT geoloc FROM registro WHERE ip in ( SELECT `ip` from visita WHERE cod_html!='200');
"""
c.execute(consulta)
resp = c.fetchall()
return resp
# Detalle Visitas por pais
def vistas_pais_detalle(pais, codigo=''):
if codigo == '':

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 260 KiB

View File

@ -41,7 +41,6 @@ def map300(geolocs):
def maps_gen(locs_200, locs_300):
maps_thumbs(locs_200, locs_300)
map200(locs_200)
map300(locs_300)
for loc in locs_300:

View File

@ -1,7 +1,6 @@
import os
import time
import subprocess
from consultas.querys_sqlite import get_geoloc
from iplocate import re, requests, token, filtro_ip_propia, selfpath, parser, log_usage
from json import loads
from datetime import datetime
@ -469,8 +468,10 @@ def mapsgen():
Llama a función maps_gen con estas listas de valores como argumentos.
"""
try:
loc_200 = get_geoloc(200)
loc_300 = get_geoloc(300)
stmn = session.query(Registro.geoloc.distinct()).join('visitas').where(Visita.cod_html==200)
loc_200 = session.execute(stmn).all()
stmn = session.query(Registro.geoloc.distinct()).join('visitas').where(Visita.cod_html!=200)
loc_300 = session.execute(stmn).all()
maps_gen(loc_200, loc_300)
except Exception as ex:
print('Exception mapsgen: ', ex)
print('Exception: ', ex)