Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Miguel Ángel González Gallardo
/
AnalizadorLogs
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2e3cc054
authored
Mar 31, 2021
by
Miguel Ángel González Gallardo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Apertura parametrizada del fichero mediante GUI
parent
1ad000ff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
1 deletions
codigo/Filtros.py
codigo/Gui.py
codigo/VentanaAbrir.py
codigo/__pycache__/Filtros.cpython-38.pyc
codigo/__pycache__/VentanaAbrir.cpython-38.pyc
codigo/Filtros.py
View file @
2e3cc054
UMBRAL_T
=
1
#<<Parametrizar esto
def
getFormatosFromCSV
(
cad
):
if
cad
!=
""
and
cad
[
len
(
cad
)
-
1
]
!=
';'
:
cad
=
cad
+
';'
ret
=
[]
c
=
0
aux
=
""
while
c
<
len
(
cad
):
if
cad
[
c
]
==
';'
:
if
aux
[
0
]
!=
'.'
:
aux
=
'.'
+
aux
ret
.
append
(
aux
)
aux
=
""
else
:
aux
+=
cad
[
c
]
c
+=
1
return
ret
def
ordenarPorSesion
(
registros
):
for
i
in
range
(
len
(
registros
)):
for
j
in
range
(
len
(
registros
)):
...
...
codigo/Gui.py
View file @
2e3cc054
from
tkinter
import
filedialog
from
tkinter
import
*
from
tkinter
import
*
from
tkinter
import
ttk
from
tkinter
import
messagebox
from
ObtencionRegistro
import
obtenerRegistros
from
Dato
import
Dato
from
Filtros
import
getFormatosFromCSV
from
VentanaAbrir
import
VentanaAbrir
from
Gestor
import
*
#r = obtenerRegistros(RUTA_ARCHIVO, E_SPIDERING, EXTENSIONES_ADMITIDAS, EXTENSIONES_NOADMITIDAS, UMBRAL_SESIONES)
...
...
@@ -13,9 +15,25 @@ def f_abrir():
RUTA_ARCHIVO
=
filedialog
.
askopenfilename
(
initialdir
=
"/"
,
title
=
"Seleccione fichero"
,
filetypes
=
(
(
"all files"
,
"*.*"
),
(
"txt files"
,
"*.txt"
),
(
"log files"
,
"*.log"
)))
v
=
VentanaAbrir
()
global
EXTENSIONES_ADMITIDAS
EXTENSIONES_ADMITIDAS
=
getFormatosFromCSV
(
v
.
formadmin
.
get
())
global
EXTENSIONES_NOADMITIDAS
EXTENSIONES_NOADMITIDAS
=
getFormatosFromCSV
(
v
.
formnoadmin
.
get
())
global
E_SPIDERING
E_SPIDERING
=
v
.
es
==
1
global
UMBRAL_SESIONES
try
:
UMBRAL_SESIONES
=
int
(
float
(
v
.
umb
.
get
()))
except
:
UMBRAL_SESIONES
=
1800
v
.
cerrarVentana
()
global
REG
REG
=
obtenerRegistros
(
RUTA_ARCHIVO
,
E_SPIDERING
,
EXTENSIONES_ADMITIDAS
,
EXTENSIONES_NOADMITIDAS
,
UMBRAL_SESIONES
)
insertaRegistros
()
...
...
@@ -41,6 +59,15 @@ def barraMenu(ventana):
menu2
=
Menu
(
barramenu
)
barramenu
.
add_cascade
(
menu
=
menu2
,
label
=
'Analisis'
)
# Boton Abrir
'''menu2.add_command(label='Abrir...',
command=f_abrir,
underline=0, compound=RIGHT)
menu2.add_separator() # Agrega un separador
# Boton Salir
menu2.add_command(label='Salir', command=f_salir,
underline=0, compound=RIGHT)'''
menu3
=
Menu
(
barramenu
)
barramenu
.
add_cascade
(
menu
=
menu3
,
label
=
'Ayuda'
)
...
...
@@ -56,6 +83,7 @@ def getDatosRegistro(registro, atributos):
return
aux
def
insertaRegistros
():
tabla
.
delete
(
*
tabla
.
get_children
())
global
REG
for
r
in
REG
:
tabla
.
insert
(
""
,
END
,
values
=
getDatosRegistro
(
r
,
atributos
))
...
...
codigo/VentanaAbrir.py
0 → 100644
View file @
2e3cc054
import
tkinter
as
ttk
from
tkinter
import
*
class
VentanaAbrir
:
def
__init__
(
self
):
self
.
es
=
IntVar
()
self
.
app
=
Tk
()
self
.
app
.
geometry
(
'450x200'
)
checkb
=
ttk
.
Checkbutton
(
self
.
app
,
text
=
"eSpidering"
,
variable
=
self
.
es
,
onvalue
=
1
,
offvalue
=
0
)
checkb
.
place
(
x
=
40
,
y
=
30
)
self
.
lb1
=
ttk
.
Label
(
self
.
app
,
text
=
"Formatos admitidos (separar con ;):"
)
self
.
lb1
.
place
(
x
=
40
,
y
=
60
)
self
.
formadmin
=
ttk
.
Entry
(
self
.
app
)
self
.
formadmin
.
place
(
x
=
300
,
y
=
60
)
self
.
lb2
=
ttk
.
Label
(
self
.
app
,
text
=
"Formatos no admitidos (separar con ;):"
)
self
.
lb2
.
place
(
x
=
40
,
y
=
90
)
self
.
umb
=
ttk
.
Entry
(
self
.
app
)
self
.
umb
.
place
(
x
=
150
,
y
=
120
)
self
.
lb3
=
ttk
.
Label
(
self
.
app
,
text
=
"Umbral sesiones:"
)
self
.
lb3
.
place
(
x
=
40
,
y
=
120
)
self
.
formnoadmin
=
ttk
.
Entry
(
self
.
app
,
text
=
"Formatos no admitidos (separar con ;)"
)
self
.
formnoadmin
.
place
(
x
=
300
,
y
=
90
)
self
.
boton
=
ttk
.
Button
(
self
.
app
,
text
=
"Aceptar"
,
command
=
self
.
app
.
quit
)
self
.
boton
.
place
(
x
=
150
,
y
=
160
)
self
.
app
.
mainloop
()
print
(
"destruido..."
)
def
cerrarVentana
(
self
):
self
.
app
.
destroy
()
\ No newline at end of file
codigo/__pycache__/Filtros.cpython-38.pyc
View file @
2e3cc054
No preview for this file type
codigo/__pycache__/VentanaAbrir.cpython-38.pyc
0 → 100644
View file @
2e3cc054
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment