# -*- coding: ISO-8859-15 -*-
  #
  # Fichero: avanzado.py
  # Copyright: Junta de Andalucia <devmaster@guadalinex.org>
  # Autor: Maria Dolores Perez Gutierrez y Nestor Chacon Manzano
  # Fecha: lun mar 27 17:01:15 CET 2006
  # Licencia: GPL v.2
  #
  # generated by wxGlade 0.3.5.1 on Tue Nov 22 13:33:24 2005
  #
  # Esta es la interfaz que muestra todos los detalles y que permite asimismo configurarlos
  # Hay secciones que requieren de mayores conocimientos por parte del usuario que si usa el asistente.
   
   
  *
  import wx
  import wx.grid
  import wx.lib.buttons
   
  # internacionalizacion
 
  LANGUAGE_DEFAULT)
 
  =wx.GetTranslation
   
   
  Frame):
  kwds):
  # begin wxGlade: MyFrame1.__init__
  DEFAULT_FRAME_STYLE
  0)
   
  **kwds)
  # Menu Bar
  = wx.MenuBar()
  self.frame_1_menubar)
  = wx.Menu()
  ITEM_NORMAL)
  self.salir)
 
  = wx.Menu()
  ITEM_NORMAL)
  self.horarios)
  ITEM_NORMAL)
  self.contenidos)
 
  = wx.Menu()
  ITEM_NORMAL)
  self.servicios)
  ITEM_NORMAL)
  self.localizacion)
  ITEM_NORMAL)
  self.expresiones)
 
  = wx.Menu()
  ITEM_NORMAL)
  ITEM_NORMAL)
  self.generar)
  self.apli)
 
  = wx.Menu()
  ITEM_NORMAL)
  self.sobre)
 
  self.GetParent()
  # Menu Bar end
  0)
 
  self.__set_properties()
  self.__do_layout()
   
  #Eventos del menu
  self.Menu01)
  self.Menu11)
  self.Menu12)
  self.Menu21)
  self.Menu22)
  self.Menu23)
  self.Menu31)
  self.Menu32)
  self.Menu42)
  self.Menu01)
  # end wxGlade#
   
  self):
  # begin wxGlade: MyFrame1.__set_properties
 
  1])
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  # statusbar fields
 
  len(frame_1_statusbar_fields)):
  self.frame_1_statusbar.SetStatusText(frame_1_statusbar_fields[i], i)
  #self.SetSize((self.GetSize()[0]+20,self.GetSize()[1]))
  # end wxGlade
   
  self):
  # begin wxGlade: MyFrame1.__do_layout
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  0)
  0)
  #sizer_4.Add(self.bitmap, 0, 0, 0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_1)
  self.Layout()
   
   
  # Segn que item de la barra de menus pulsen, se ejecuta una cosa u otra
   
  event):
  import system
  self.padre.Show()
  self.Destroy()
   
  event):
  not child.horarios :
  True
 
  win.Show()
   
  event):
  not child.contenidos :
  True
 
  win5.Show()
   
  event):
  not child.servicios :
  True
 
  True)
   
  event):
  not child.listas :
  True
 
  True)
   
  event):
  not child.expresiones :
  True
 
  True)
   
  event):
  not child.uso_web :
  True
 
  True)
   
  event):
  not child.uso_web :
  True
 
  True)
   
  event):
 
  self, msg,
  ICON_INFORMATION)
  #wxYES_NO | wxNO_DEFAULT | wxCANCEL | wxICON_INFORMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
   
  # end wxGlade
  # end of class MyFrame1
   
  # Todo lo que concierne a la configuracion de usuarios:
  # servicios permitidos, horarios y prorrogas
  Frame):
  kwds):
  # begin wxGlade: MyChild1.__init__
  TAB_TRAVERSAL
  **kwds)
  0)
  1)
  1)
  1)
  1)
  CB_READONLY)
 
 
 
 
  self.rellena_usuarios()
  BITMAP_TYPE_ANY))
 
 
 
  1)
 
 
 
  20))
 
  20))
 
  20))
 
  20))
 
 
 
  20))
 
  20))
 
  20))
 
  20))
 
 
 
  20))
 
  20))
 
  20))
 
  20))
 
 
 
  20))
 
  20))
 
  20))
 
  20))
 
 
 
  20))
 
  20))
 
  20))
 
  20))
 
 
 
  20))
 
  20))
 
  20))
 
  20))
 
 
 
  20))
 
  20))
 
  20))
 
  20))
 
 
 
  1))
  1))
  1))
  1])
  True
  self.__set_properties()
  self.SetFocus()
  self.__do_layout()
  self.combo_box_1.GetValue())
  #si usuario seleccionado rellena campos segun su configuracion
  ':
  self.rellena()
  self.acepta)
  self.cancela)
  self.limpia)
  self.refresca_lista)
  self.cancela)
  self.recarga)
  self.limit)
   
  self.estado)
  self.estado)
  self.estado)
  self.estado)
  self.estado)
  self.estado)
  self.estado)
   
  self.obten_cadena)
  # end wxGlade
   
   
  self):
  # begin wxGlade: MyChild1.__set_properties
  self.Hide()
 
   
  0)
   
  # Crea las tablas que se van a mostrar de manera din�ica
  5)
  4)
  5)
  =wx.grid.GridCellAttr()
  True)
  0,attr)
 
 
 
 
 
  self.grid_1.AutoSize()
   
  =wx.grid.GridCellAttr()
  True)
  0,attr2)
 
 
 
 
  self.grid_3.AutoSize()
   
  =wx.grid.GridCellAttr()
  True)
  0,attr3)
 
 
 
 
 
   
  0]
  len(lista_srv)
  self.grid_1.AppendRows(items)
  self.grid_3.AppendRows(items)
  self.grid_2.AppendRows(items)
  4:])
   
  range(items):
  0,lista_srv[i])
  4,wx.grid.GridCellBoolEditor())
  4,wx.grid.GridCellBoolRenderer())
  0,lista_srv[i])
  31))
  12))
  5))
  0,lista_srv[i])
   
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild1.__do_layout
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  0)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.notebook_1_pane_1.SetSizer(sizer_9)
  self.notebook_1_pane_1)
  self.notebook_1_pane_1)
  0)
  True)
  self.SetSizer(sizer_1)
  self)
  self)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.notebook_1_pane_2.SetSizer(sizer_13)
  self.notebook_1_pane_2)
  self.notebook_1_pane_2)
  0)
  True)
  self.notebook_1_pane_3.SetSizer(sizer_18)
  0)
  True)
  self.notebook_1_pane_4.SetSizer(sizer_66)
  self.notebook_1_pane_3)
  self.notebook_1_pane_3)
 
 
 
 
   
  # Esto es necesario para evitar un warning, a veces incluso un error mas grave
  # segun la version de la libreria que haya instalada en el sistema
  2]
  4:
  0)
  else:
  0)
   
  0)
  True)
  self.SetSizer(sizer_3)
  self)
  self)
  self.Layout()
  self.control()
  # end wxGlade
   
  # Borra el contenido de las tablas
  g):
   
  self.spin_ctrl_1.Enable(a)
  self.spin_ctrl_2.Enable(a)
  self.spin_ctrl_3.Enable(a)
  self.spin_ctrl_4.Enable(a)
  self.spin_ctrl_1_copy.Enable(b)
  self.spin_ctrl_2_copy.Enable(b)
  self.spin_ctrl_3_copy.Enable(b)
  self.spin_ctrl_4_copy.Enable(b)
  self.spin_ctrl_1_copy_1.Enable(c)
  self.spin_ctrl_2_copy_1.Enable(c)
  self.spin_ctrl_3_copy_1.Enable(c)
  self.spin_ctrl_4_copy_1.Enable(c)
  self.spin_ctrl_1_copy_2.Enable(d)
  self.spin_ctrl_2_copy_2.Enable(d)
  self.spin_ctrl_3_copy_2.Enable(d)
  self.spin_ctrl_4_copy_2.Enable(d)
  self.spin_ctrl_1_copy_3.Enable(e)
  self.spin_ctrl_2_copy_3.Enable(e)
  self.spin_ctrl_3_copy_3.Enable(e)
  self.spin_ctrl_4_copy_3.Enable(e)
  self.spin_ctrl_1_copy_4.Enable(f)
  self.spin_ctrl_2_copy_4.Enable(f)
  self.spin_ctrl_3_copy_4.Enable(f)
  self.spin_ctrl_4_copy_4.Enable(f)
  self.spin_ctrl_1_copy_5.Enable(g)
  self.spin_ctrl_2_copy_5.Enable(g)
  self.spin_ctrl_3_copy_5.Enable(g)
  self.spin_ctrl_4_copy_5.Enable(g)
   
  0:
  0)
  0)
  0)
  0)
  0:
  0)
  0)
  0)
  0)
  0:
  0)
  0)
  0)
  0)
  0:
  0)
  0)
  0)
  0)
  0:
  0)
  0)
  0)
  0)
  0:
  0)
  0)
  0)
  0)
  0:
  0)
  0)
  0)
  0)
   
  event):
  =event.GetId()
  self.checkbox_1.GetValue()
  self.checkbox_1_copy.GetValue()
  self.checkbox_1_copy_1.GetValue()
  self.checkbox_1_copy_2.GetValue()
  self.checkbox_1_copy_3.GetValue()
  self.checkbox_1_copy_4.GetValue()
  self.checkbox_1_copy_5.GetValue()
   
  self.checkbox_1.GetId():
  0)
  0)
  23)
  59)
  self.checkbox_1_copy.GetId():
  0)
  0)
  23)
  59)
  self.checkbox_1_copy_1.GetId():
  0)
  0)
  23)
  59)
  self.checkbox_1_copy_2.GetId():
  0)
  0)
  23)
  59)
  self.checkbox_1_copy_3.GetId():
  0)
  0)
  23)
  59)
  self.checkbox_1_copy_4.GetId():
  0)
  0)
  23)
  59)
  self.checkbox_1_copy_5.GetId():
  0)
  0)
  23)
  59)
   
  self.activar(rango,rango_copy,rango_copy_1,rango_copy_2,rango_copy_3,rango_copy_4,rango_copy_5)
   
   
  evt):
  self.grid_1.IsEnabled():
  self.grid_1.GetNumberRows()
  range(columnas):
  ')
  ')
  ')
  ')
   
  # Comprueba si es un usuario con limitaciones o no
  self):
  self.grid_1.GetNumberRows()
  True
  range(columnas):
 
  False
  if todos:
  1)
  self.deshabilita()
   
  # Si el usuario no tiene limites deshabilita la edicion de estos
  # en caso contrario permite que se editen y rellena los campos
  event):
  self.choice_1.GetSelection():
  True
  self.deshabilita()
   
  else:
  False
  self.habilita()
  ':
  self.rellena()
 
   
  # Deja las tablas a 0 e impide su edicion
  self):
  False)
  False)
  False)
  self.grid_1.GetNumberRows()):
 
 
 
 
 
 
 
 
 
 
   
  # Permite la edicion de las tablas
  self):
  True)
  True)
  True)
   
  # Funcion que llama a rellena ante un evento
  event):
  self.combo_box_1.GetValue())
  ':
  self.rellena()
   
  # Funcion que lee el archivo de configuracion y rellena los valores necesarios en la interfaz grafica
  self):
  False)
  False)
  False)
  False)
  False)
  False)
  False)
   
  self.combo_box_1.GetValue()
  self.all:
  1)
  self.deshabilita()
  else:
  0)
  self.habilita()
   
  =usr_srv(us)
  =uso_pc(us)
  0}
  len(dias)
  range(items):
  2]
  2:]
  2]
  2:]
  =dias[i]
   
  ':
  True)
  int(hora_inicio))
  int(minuto_inicio))
  int(hora_fin))
  int(minuto_fin))
  1
  ':
  True)
  int(hora_inicio))
  int(minuto_inicio))
  int(hora_fin))
  int(minuto_fin))
  1
  ':
  True)
  int(hora_inicio))
  int(minuto_inicio))
  int(hora_fin))
  int(minuto_fin))
  1
  ':
  True)
  int(hora_inicio))
  int(minuto_inicio))
  int(hora_fin))
  int(minuto_fin))
  1
  ':
  True)
  int(hora_inicio))
  int(minuto_inicio))
  int(hora_fin))
  int(minuto_fin))
  1
  ':
  True)
  int(hora_inicio))
  int(minuto_inicio))
  int(hora_fin))
  int(minuto_fin))
  1
  ':
  True)
  int(hora_inicio))
  int(minuto_inicio))
  int(hora_fin))
  int(minuto_fin))
  1
   
  6])
   
  =serv_user(us)
  self.grid_1.GetNumberRows()
   
  range(columnas):
  0))
  self.all:
  ']
  else:
  +ser)
   
  if tiempos:
  ':
 
 
 
 
 
 
 
 
 
 
 
  else:
  0])
  1])
  2])
 
  3])
  4])
  5])
  0]
 
  0]
  1]
  2]
  3:]
  3]
  0]):
  1,hora_pr)
  2,dia_pr)
  3,mes_pr)
  4,anno_pr)
  else:
 
 
 
  =={}:
 
  else:
 
 
 
 
 
 
 
 
   
   
  # Valida que la entrada en la casilla uid sea numerica
  self):
  9}
  0)
  in posicion :
  not numeros.get(i):
  False
  return posicion
   
  # Lee los usuarios del sistema en /etc/passwd y crea una lista con ellos para mostrarlos
  self):
  self.uid_min()
   
  self.combo_box_1.Clear()
   
  int(uid.min))
  in tmp_us:
  self.combo_box_1.Append(i)
   
   
  # funcion que llama a rellena_usuarios ante un evento
  event):
  self.rellena_usuarios()
  self.rellena()
   
  evt):
  self.grid_1.SaveEditControlValue()
  self.grid_2.SaveEditControlValue()
  self.grid_3.SaveEditControlValue()
  self.finaliza :
  self.aceptar(evt)
   
  # Graba los cambios que se han realizado en el archivo de configuracion
  evt):
  import control_web_user
  import lee_userblacklists, actualiza_userblacklists
  import inic_squid_user
   
  minutos):
  str(horas)
  str(minutos)
  1:
  +horas
  1:
  +minutos
  +minutos
   
  self.combo_box_1.GetValue()
  self.grid_1.GetNumberRows()
  =lee_userblacklists(usuario,archivo.configuracion)
 
  =[]
  self.checkbox_1.IsChecked():
  self.spin_ctrl_1.GetValue()
  self.spin_ctrl_2.GetValue()
  self.spin_ctrl_3.GetValue()
  self.spin_ctrl_4.GetValue()
  >=f2):
 
  else:
 
  self.spin_ctrl_2.GetValue())
  self.spin_ctrl_4.GetValue())
  +fin
  self.checkbox_1_copy.IsChecked():
  self.spin_ctrl_1_copy.GetValue()
  self.spin_ctrl_2_copy.GetValue()
  self.spin_ctrl_3_copy.GetValue()
  self.spin_ctrl_4_copy.GetValue()
  >=f2):
 
  else:
 
  self.spin_ctrl_2_copy.GetValue())
  self.spin_ctrl_4_copy.GetValue())
  +fin
  self.checkbox_1_copy_1.IsChecked():
  self.spin_ctrl_1_copy_1.GetValue()
  self.spin_ctrl_2_copy_1.GetValue()
  self.spin_ctrl_3_copy_1.GetValue()
  self.spin_ctrl_4_copy_1.GetValue()
  >=f2):
 
  else:
 
  self.spin_ctrl_2_copy_1.GetValue())
  self.spin_ctrl_4_copy_1.GetValue())
  +fin
  self.checkbox_1_copy_2.IsChecked():
  self.spin_ctrl_1_copy_2.GetValue()
  self.spin_ctrl_2_copy_2.GetValue()
  self.spin_ctrl_3_copy_2.GetValue()
  self.spin_ctrl_4_copy_2.GetValue()
  >=f2):
 
  else:
 
  self.spin_ctrl_2_copy_2.GetValue())
  self.spin_ctrl_4_copy_2.GetValue())
  +fin
  self.checkbox_1_copy_3.IsChecked():
  self.spin_ctrl_1_copy_3.GetValue()
  self.spin_ctrl_2_copy_3.GetValue()
  self.spin_ctrl_3_copy_3.GetValue()
  self.spin_ctrl_4_copy_3.GetValue()
  >=f2):
 
  else:
 
  self.spin_ctrl_2_copy_3.GetValue())
  self.spin_ctrl_4_copy_3.GetValue())
  +fin
  self.checkbox_1_copy_4.IsChecked():
  self.spin_ctrl_1_copy_4.GetValue()
  self.spin_ctrl_2_copy_4.GetValue()
  self.spin_ctrl_3_copy_4.GetValue()
  self.spin_ctrl_4_copy_4.GetValue()
  >=f2):
 
  else:
 
  self.spin_ctrl_2_copy_4.GetValue())
  self.spin_ctrl_4_copy_4.GetValue())
  +fin
  self.checkbox_1_copy_5.IsChecked():
  self.spin_ctrl_1_copy_5.GetValue()
  self.spin_ctrl_2_copy_5.GetValue()
  self.spin_ctrl_3_copy_5.GetValue()
  self.spin_ctrl_4_copy_5.GetValue()
  >=f2):
 
  else:
 
  self.spin_ctrl_2_copy_5.GetValue())
  self.spin_ctrl_4_copy_5.GetValue())
  +fin
   
  True
 
 
  self, msg,
  ICON_EXCLAMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
  False
  else:
  0:
  1:
  0]
 
  else:
 
  1):
 
  1]
 
 
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_NO:
  False
   
  dlg.Destroy()
   
  if guarda_config:
  =[]
  9):
  tabla.append([])
   
  range(num_filas):
   
  #nombre del servicio
  # servicio sin limites
  #limite diario
  #limite semanal
  #limite mensual
  #total consumo diario
  #total consumo semanal
  #total consumo mensual
   
 
 
 
 
 
 
 
 
 
 
 
 
  ':
  0].append(nom_serv)
  ')
  ')
  ')
  ')
  ')
  ')
  ')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   
  1)
  2))
  3))
  4))
   
  8:
 
 
 
 
 
 
 
  1:
  +dia_pr
  1:
  +mes_pr
  1:
  +anno_pr
   
  0].append(nom_serv)
  1].append(lim_d)
  2].append(lim_s)
  3].append(lim_m)
  4].append(tot_d)
  5].append(tot_s)
  6].append(tot_m)
  #prorroga
 
   
  self.grid_1.IsEnabled():
  False
  else:
  True
   
  avanz_usr(todos,usuario,tabla,listas_squid)
   
  =dias
  fija_horarios(usuario,time_conf)
   
  actualiza_userblacklists(usuario, listas_squid, archivo.configuracion)
  #se actualizan instancias de squid a modificaciones realizadas
  1):
  inic_squid_user(usuario,archivo.aceptlog)
   
 
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  dlg.Destroy()
  False
  self.Destroy()
  else:
  dlg.Destroy()
  self.rellena()
   
  # Comprueba que no se han introducido valores por encima de los maximos
  col):
  len(fecha)
  0:
  True
 
  True
  9:
  False
   
 
  2:
  False
  743]
  try:
  0]:
  False
  else:
  True
  except:
  False
   
  # Toma las horas que se introducen en las celdas pertinentes y las manda a una funcion
 
  # lanza un aviso
  evt):
   
  =evt.GetRow()
  =evt.GetCol()
  True
   
  ==evt.GetId():
  self.grid_1
 
  ==evt.GetId():
  self.grid_3
 
  else:
  self.grid_2
 
   
  1:
  True
  False
  4:
  True
  False
  else:
  self.valida_fecha(tabla.GetCellValue(fila,columna),columna)
   
  not valido:
 
  ICON_HAND)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
 
  False
  elif tiempo :
  =tabla.GetCellValue(fila,columna)
  8:
  0]
  1]
  2]
  1:
  +h
  1:
  +m
  1:
  +s
  +s)
   
  True
   
  evt):
   
  False
  self.Destroy()
  # end of class MyChild1
   
  # Esta ventana se encarga de la administracion de los servicios
  Frame):
  kwds):
  # begin wxGlade: MyChild2.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
  0)
  1)
  1)
 
 
 
 
 
 
 
  TE_READONLY)
  1)
 
  65535)
 
 
 
 
  65535)
 
  65535)
 
 
 
 
  65535)
 
 
  CB_READONLY)
  TE_READONLY)
  1)
 
  65535)
 
 
 
 
  65535)
 
  65535)
 
 
 
 
  65535)
 
 
  ']
  ']
   
  self.__set_properties()
  self.SetFocus()
  self.__do_layout()
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild2.__set_properties
 
  self.notebook_1_pane_2.Hide()
  False)
  False)
  False)
  False)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
  0]
  self.lista_srv.sort()
  ')
  self.lista_srv:
  self.combo_box_3.Append(i)
  # end wxGlade
   
  self):
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.notebook_1_pane_1.SetSizer(sizer_5)
  self.notebook_1_pane_1)
  self.notebook_1_pane_1)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.notebook_1_pane_2.SetSizer(sizer_15)
  self.notebook_1_pane_2)
  self.notebook_1_pane_2)
 
 
   
  # Segun la version de la libreria hace una cosa u otra
  2]
  4:
  0)
  else:
  0)
   
  0)
  True)
  self.SetSizer(sizer_1)
  self)
  self)
  self.Layout()
  # end wxGlade
  self.cambia_panel)
  self.cambia_panel)
  self.acepta)
  self.cancela)
  self.activa)
  self.activa)
  self.activa)
  self.activa)
  self.rango1)
  self.rango2)
  self.rango3)
  self.rango4)
  self.puertos)
  self.limpia)
  self.limpia)
  self.limpia)
  self.limpia)
  self.pon)
  self.pon)
  self.pon)
  self.pon)
  self.quita)
  self.quita)
  self.quita)
  self.quita)
  self.elimina_srv)
  self.valida_nombre)
  self.cancela)
   
  # Borra un servicio dado del archivo de configuracion
  evt):
  self.combo_box_3.GetValue()
  0:
 
  ICON_HAND)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
  else:
 
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  elimina_srv(srv)
   
  self.combo_box_3.Clear()
  ')
  self.text_ctrl_2_copy.Clear()
  0]
  self.lista_srv.sort()
  ')
  self.lista_srv:
  self.combo_box_3.Append(i)
  dlg.Destroy()
  else:
  dlg.Destroy()
   
  #Comprueba que el nombre de un nuevo servicio no coincida con el de uno antiguo
  evt):
  ']
  self.lista_srv:
  self.text_ctrl_1.GetValue():
 
  ICON_HAND)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
  self.text_ctrl_1.Clear()
  try:
  self.text_ctrl_1.GetValue())
  ValueError:
  pass
  else:
 
  ICON_HAND)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
  self.text_ctrl_1.Clear()
   
   
  # Quita un puerto, o un rango de ellos de la definicion de un servicio
  evt):
   
  =[]
  self.button_6_copy.GetId():
  self.spin_ctrl_2_copy.GetValue()
  self.checkbox_1_copy.IsChecked():
  1
  else:
  1
  self.tcp
  self.text_ctrl_2_copy
  self.button_9_copy.GetId():
  self.spin_ctrl_3_copy.GetValue()
  self.checkbox_2_copy.IsChecked():
  1
  else:
  1
  self.udp
  self.text_ctrl_2_copy
  self.button_6.GetId():
  self.spin_ctrl_1.GetValue()
   
  self.checkbox_1.IsChecked():
  1
  else:
  1
  self.tcp
  self.text_ctrl_2
  self.button_9.GetId():
  self.spin_ctrl_2.GetValue()
  self.checkbox_2.IsChecked():
  1
  else:
  1
  self.udp
  self.text_ctrl_2
   
  len(protocolo)
  range(items):
  ':
  del protocolo[i]
   
  range(num,lim):
  False
  in protocolo:
  == i :
  del protocolo[protocolo.index(j)]
   
  self.udp,pizarra)
   
   
  # Incorpora un puerto o un rango de ellos a la deficinicion de un servicio
  evt):
  =[]
   
  self.button_5_copy.GetId():
  self.spin_ctrl_2_copy.GetValue()
  self.checkbox_1_copy.IsChecked():
  1
  else:
  1
  self.tcp
  self.text_ctrl_2_copy
  self.button_8_copy.GetId():
  self.spin_ctrl_3_copy.GetValue()
  self.checkbox_2_copy.IsChecked():
  1
  else:
  1
  self.udp
  self.text_ctrl_2_copy
  self.button_5.GetId():
  self.spin_ctrl_1.GetValue()
   
  self.checkbox_1.IsChecked():
  1
  else:
  1
  self.tcp
  self.text_ctrl_2
  self.button_8.GetId():
  self.spin_ctrl_2.GetValue()
  self.checkbox_2.IsChecked():
  1
  else:
  1
  self.udp
  self.text_ctrl_2
   
  len(protocolo)
  range(items):
  ':
  del protocolo[i]
  range(num,lim):
  False
  in protocolo:
  == i :
  True
  not existe:
  numeros.append(i)
  in numeros:
  str(i))
  len(protocolo)
  range(items):
  int(protocolo[i])
  protocolo.sort()
  range(items):
  str(protocolo[i])
   
  self.udp,pizarra)
   
   
  # Borra todas los puertos de un servicio
  evt):
  self.button_7.GetId():
  ']
  self.text_ctrl_2
  self.button_10.GetId():
  ']
  self.text_ctrl_2
  self.button_7_copy.GetId():
  ']
  self.text_ctrl_2_copy
  self.button_10_copy.GetId():
  ']
  self.text_ctrl_2_copy
   
  self.udp,pizarra)
   
  # Lee los puertos de un servicio al seleccionarlo en la lista
  evt):
  self.combo_box_3.GetValue()
  0:
  =servicios()
  0].index(serv)
  1][indice]
  2][indice]
  self.tcp)
  iter):
  ':
  2:]
   
  self.udp)
  iter):
  ':
  2:]
  self.text_ctrl_2_copy)
   
  # Muestra en la interfaz grafica los puertos que componen un servicio
  pizarra):
  pizarra.Clear()
 
  ']:
  in tcp:
  1]:
 
  else:
  pizarra.AppendText(i)
   
 
  ']:
  in udp:
  1]:
 
  else:
  pizarra.AppendText(i)
   
 
  # colocan el minimo como el valor ya seleccionado+1
  evt):
  self.spin_ctrl_3.IsEnabled():
  65535)
   
  evt):
  self.spin_ctrl_4.IsEnabled():
  65535)
   
  evt):
  self.spin_ctrl_4_copy.IsEnabled():
  65535)
   
  evt):
  self.spin_ctrl_5_copy.IsEnabled():
  65535)
   
  evt):
  self.checkbox_1.IsChecked():
  True)
  65535)
  else:
  False)
   
  self.checkbox_2.IsChecked():
  True)
  65535)
  else:
  False)
   
  self.checkbox_1_copy.IsChecked():
  True)
  65535)
  else:
  False)
   
  self.checkbox_2_copy.IsChecked():
  True)
  65535)
  else:
  False)
   
  # Muestra un panel u otro, segun se seleccione en los botones laterales
  evt):
   
  self.button_1.GetId():
  self.notebook_1_pane_2.Hide()
  self.notebook_1_pane_1.Show()
  ']
  ']
  self.text_ctrl_2_copy.Clear()
  else :
  self.notebook_1_pane_2.Show()
  self.notebook_1_pane_1.Hide()
  self.combo_box_3.GetValue())
  self.text_ctrl_2.Clear()
   
  evt):
  False
  self.Destroy()
   
  # Graba los cambios realizados en el archivo de configuracion
  evt):
   
  0:
  self.text_ctrl_1.GetValue()
  else:
  self.combo_box_3.GetValue()
  False
  False
  ':
  elimina_srv(servicio)
  self.udp)
  2:
 
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  True
  dlg.Destroy()
  else:
  False
  dlg.Destroy()
  0:
  ')
  self.text_ctrl_2.Clear()
  else:
  self.text_ctrl_2_copy.Clear()
  self.combo_box_3.Clear()
  ')
  0]
  self.lista_srv.sort()
  ')
  self.lista_srv:
  self.combo_box_3.Append(i)
  self.combo_box_3.GetValue())
  else:
 
  True
  else:
 
  True
   
  if reintenta:
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  dlg.Destroy()
  self.combo_box_3.Clear()
  ')
  self.text_ctrl_2_copy.Clear()
  0]
  self.lista_srv.sort()
  ')
  self.lista_srv:
  self.combo_box_3.Append(i)
  self.combo_box_3.GetValue())
  else:
  dlg.Destroy()
  False
  self.Destroy()
  else:
  if sale:
  False
  self.Destroy()
   
  # end of class MyChild2
   
   
  # Esta ventana se encarga de configurar las listas negras y sus componentes, de squid
  Frame):
  kwds):
  # begin wxGlade: MyChild3.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
 
 
  =[])
 
 
 
  LI_VERTICAL)
  LB_SORT)
 
 
  365)
 
 
  1)
 
 
 
 
 
  True
  True
  self.__set_properties()
  self.SetFocus()
  self.__do_layout()
  self.rellena_grupos()
   
  self.crea_grupo)
  self.aviso)
  self.aviso)
  self.elimina_fuente)
  self.actualiza)
  self.inserta)
  self.acepta)
  self.cancela)
  self.lista_actual)
  self.cancela)
   
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild3.__set_properties
 
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild3.__do_layout
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_15)
  self)
  self)
  self.Layout()
  # end wxGlade
   
  # obtiene el nombre d ela lista negra seleccionada
  event):
  0])
   
  # Comprueba si se ha seleccionado una lista antes de realizar un cambio
  event):
  ':
 
  ICON_EXCLAMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
  self.button_3.GetId():
  self.elimina_lista_local()
  self.rellena_grupos()
  '
  self.button_2.GetId():
  self.modifica_gr()
   
  # borra una lista del archivo de configuracion
  self):
  import elimina_blacklist
  import apply_conf_squidguard
  import establece_permisos
   
 
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  elimina_blacklist(bl_lst.nombre,archivo.configuracion)
  apply_conf_squidguard(archivo.aceptlog)
  dlg.Destroy()
  else:
  dlg.Destroy()
   
  # Elimina las fuentes de la interfaz grafica
  event):
  0:
 
  ICON_INFORMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  else:
  =[]
  self.list_box_7.GetSelections():
  self.list_box_7.GetString(i))
   
  self.list_box_7.GetCount()
  range(items):
  in lista:
  ==j:
  self.list_box_7.Delete(i)
   
  # Incorpora a la interfaz grafica los grupos configurados
  self):
  import local_blacklists, lee_fuentes
  import consulta_campo
  =local_blacklists(archivo.configuracion)
  =lee_fuentes(archivo.configuracion)
  self.list_box_4_copy.Clear()
  self.list_box_7.Clear()
  in local_blacklists:
  self.list_box_4_copy.Append(i)
  in system_blacklists:
  self.list_box_7.Append(i)
  ',archivo.aceptlog)
  int(freq))
   
  # a�de una uri a la lista de uris que se usan para actualizar las listas negras
  event):
  self.text_ctrl_1_copy.GetValue()
  if fuente:
  self.list_box_7.Append(fuente)
  self.list_box_7.GetCount()
  1
  =items
  0:
  range(items):
  max:
  1):
  self.list_box_7.Delete(i)
  1
  max:
  break
  self.text_ctrl_1_copy.Clear()
  else:
 
  ICON_INFORMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
   
  # muestra la interfaz para crear listas negras locales
  event):
  self.crea:
  False
 
  win.Show()
   
  # Muestra la interfaz para modificar las listas negras locales
  self):
  self.modifica:
  False
 
  win.Show()
   
  # Hace que se descarguen las listas negras de las uris pertinentes las configura
  event):
  import ublacklists,establece_permisos
  import actualiza_fuentes
  import revisa_blacklists
   
  self.GetParent()
  self.Hide()
  self.Update()
  padre.Hide()
  padre.Update()
   
  =[]
  self.spin_ctrl_45.GetValue()
  self.list_box_7.GetCount()
  range(items):
  self.list_box_7.GetString(i))
   
  actualiza_fuentes(fuentes,freq,archivo.configuracion)
  ####barra
  import system, kill
  import sleep
 
  f.close()
  ')
  5)
  =ublacklists(archivo.configuracion)
  revisa_blacklists(archivo.configuracion)
  establece_permisos(archivo.configuracion)
  0])
  0:
 
 
  len(msg1)
  len(msg2)
  range(nproblems):
  0:
  0][i]
  1:
  0][i]
   
 
  >nmsg1:
  +msg1
  >nmsg2:
  0:
  '
  +msg2
   
  ICON_INFORMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
   
  try:
 
  =f.read()
  9)
 
  except:
  pass
 
  ICON_INFORMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  padre.Show()
  self.Show()
   
  # Aplica los cambios a los archivos de configuracion
  event):
  import actualiza_fuentes
  import apply_conf_squidguard
   
  =[]
  self.spin_ctrl_45.GetValue()
  self.list_box_7.GetCount()
  range(items):
  self.list_box_7.GetString(i))
   
  actualiza_fuentes(fuentes,freq,archivo.configuracion)
   
  apply_conf_squidguard(archivo.aceptlog)
   
 
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  dlg.Destroy()
  self)
  else:
  dlg.Destroy()
   
   
  event):
  False
  self.Destroy()
   
  # end of class MyChild3
   
   
  Frame):
  kwds):
  import isfile
  # begin wxGlade: MyFrame.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
 
 
 
 
 
  LI_VERTICAL)
  ALIGN_CENTRE)
  30))
  LB_SINGLE)
 
  1)
 
 
   
  # Lee el archivo /etc/acept/watcherCat/expresiones y rellena list_box_1
 
 
  =f.read()
 
  '):
  0:
  self.list_box_1.Append(i)
  else:
  import isdir
 
  import mkdir
 
   
  self.__set_properties()
  self.__do_layout()
   
  self.incluir)
  self.elimina)
  self.limpia_todo)
  self.aceptar)
  self.cancela)
  self.cancela)
  # end wxGlade
   
  event):
  self.list_box_1.GetSelection()
  self.list_box_1.Delete(fuente)
   
  event):
  import isdir
  import parse_file
  import existe_grupo, append_grupo, revisa_grupo, revisa_blacklists, renuevadir
  import compila_libreria, establece_permisos
  import apply_conf_squidguard
  import system, listdir, mkdir,kill
   
  self.GetParent()
  self.Hide()
  self.Update()
  padre.Hide()
  padre.Update()
   
  self.list_box_1.GetCount()
  0:
 
 
 
  ')
  range(items):
  self.list_box_1.GetString(i))
  1:
  ')
  ')
  f.close()
   
 
  =parse_file(archivo.configuracion)
  ')
  1:
 
  else:
 
   
 
  revisa_blacklists(archivo.configuracion)
 
  apply_conf_squidguard(archivo.aceptlog)
  establece_permisos(archivo.configuracion)
   
 
  self, _(mensaje),
  ICON_INFORMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  padre.Show()
  False
  self.Destroy()
   
   
  event):
  self.text_ctrl_2.GetValue()
  if fuente:
  self.list_box_1.GetCount()
  =items
  =[]
  False
  range(items):
  self.list_box_1.GetString(i))
  in lista:
  ==fuente:
  True
  break
  not existe:
  lista.append(fuente)
  lista.sort()
  self.list_box_1.Clear()
  in lista:
  self.list_box_1.Append(i)
   
  self.text_ctrl_2.Clear()
  else:
 
  ICON_INFORMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
   
   
  event):
  self.list_box_1.Clear()
   
  self):
  import system
  import isfile
  self.Hide()
  self.GetParent()
  padre.Hide()
   
  event):
  False
  self.Destroy()
   
  self):
  # begin wxGlade: MyFrame.__set_properties
 
  30))
  120))
  # end wxGlade
   
  self):
  # begin wxGlade: MyFrame.__do_layout
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  #sizer_6_copy.Add(self.text_ctrl_1, 1, wx.ADJUST_MINSIZE, 0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_1)
  self)
  self)
  self.Layout()
  # end wxGlade
   
   
  # Esta ventana se encarga de asignar listas negras o blancas a usuarios determinados
  Frame):
  kwds):
  # begin wxGlade: MyChild5.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
 
  LB_SINGLE)
 
 
  LI_VERTICAL)
 
 
  LB_SORT)
 
 
 
 
  LB_SORT)
  1)
 
 
 
 
 
 
  LB_SORT)
  self.rellena_usuarios()
  self.listas_negras()
  self.SetFocus()
  self.__set_properties()
  self.__do_layout()
   
  1)
  False
  1
   
  self.cancela)
  self.in_todo)
  self.inserta_blacklist)
  self.elimina_listanegra)
  self.del_todo)
  self.inserta_whitelist)
  self.elimina_whitelist)
  self.del_todo_bl)
  self.acepta)
  self.cancela)
  self.datos_user)
  self.l12)
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild5.__set_properties
 
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild5.__do_layout
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_73)
  self)
  self)
  self.Layout()
  # end wxGlade
   
   
  event):
  try:
  self.list_box_12.GetSelections()
  1
  1
  1):
  1
  self.vieja_sel)
  range(items):
  !=nueva_sel[i]:
  =i
  break
  self.viejo_last:
  == nueva_sel[last]:
  self.viejo_last])
   
  0:
  1
  self.list_box_12.GetSelections()
  except:
  self.list_box_12.GetSelections()
   
  # quita una lista negra al usuario seleccionado
  event):
  =[]
  self.list_box_13.GetSelections():
  self.list_box_13.GetString(i))
   
  self.list_box_13.GetCount()
  range(items):
  in lista:
  ==j:
  self.list_box_13.Delete(i)
   
  # quita una lista blanca al usuario seleccionado
  event):
  =[]
  self.list_box_15.GetSelections():
  self.list_box_15.GetString(i))
   
  self.list_box_15.GetCount()
  range(items):
  in lista:
  ==j:
  self.list_box_15.Delete(i)
   
  # a�de una lista blanca al usuario seleccionado
  event):
  self.text_ctrl_8.GetValue())
  self.text_ctrl_8.Clear()
  self.list_box_15.GetCount()
  1
  =items
  0:
  range(items):
  max:
  1):
  self.list_box_15.Delete(i)
  1
  max:
  break
   
  # a�de una lista negra al usuario seleccionado
  event):
  self.list_box_12.GetSelections():
  self.list_box_12.GetString(i))
   
  self.list_box_13.GetCount()
  1
  =items
  0:
  range(items):
  max:
  1):
  self.list_box_13.Delete(i)
  1
  max:
  break
  # borra todas las listas negras del usuario
  event):
  self.list_box_13.Clear()
   
  # borra todas las listas blancas del usuario
  event):
  self.list_box_15.Clear()
   
  # inserta todas las listas negras a un usuario
  event):
  self.list_box_13.Clear()
  self.list_box_12.GetCount()
  range(items):
  self.list_box_12.GetString(i))
   
  # Lee las listas negras del sistema
  self):
  import listado_blacklists
  =listado_blacklists(archivo.configuracion)
  in listas:
  self.list_box_12.Append(i)
   
  # Toma los datos de la configuracion del usuario seleccionado
  event):
  import lee_userblacklists, lee_whitelist
  0])
  0:
  self.list_box_12.GetCount()):
  False)
  self.list_box_13.Clear()
  self.list_box_15.Clear()
  self.text_ctrl_8.Clear()
  =lee_userblacklists(usr,archivo.configuracion)
  =lee_whitelist(usr,archivo.configuracion)
  in lis_ngr:
  self.list_box_13.Append(i)
  in lis_bl:
  self.list_box_15.Append(i)
   
  # lee los usuarios del sistema
  self):
  self.list_box_14.Clear()
  int(uid.min))
  in tmp_us:
  self.list_box_14.Append(i)
  # Graba cambios de filtrado de contenido para usuario en el archivo de configuracion
  event):
  import actualiza_userblacklists, actualiza_whitelist
   
  user):
  import control_web_user
  import inic_squid_user, inic_sarg_user, apply_conf_squidguard_user, inic_direct_user
   
  #Se vierten cambios realizados para usuario
  1:
  inic_squid_user(user,archivo.aceptlog)
  inic_sarg_user(user,archivo.aceptlog)
  apply_conf_squidguard_user(user,archivo.aceptlog)
  inic_direct_user(user,archivo.aceptlog)
   
  self.list_box_14.GetSelections():
  0])
 
  =[]
  =[]
  self.list_box_13.GetCount()
  range(items_ng):
  self.list_box_13.GetString(i))
  self.list_box_15.GetCount()
  range(items_bl):
  self.list_box_15.GetString(i))
   
  0:
  self.list_box_12.GetCount()):
  False)
   
  nodo_usuario(usr)
  actualiza_userblacklists(usr,listas_negras,archivo.configuracion)
  actualiza_whitelist(usr,lista_blanca,archivo.configuracion)
  guarda(usr)
   
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  dlg.Destroy()
  self)
  else:
  dlg.Destroy()
  else:
 
   
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  ID_YES:
  dlg.Destroy()
  else:
  dlg.Destroy()
  self)
   
   
  event):
  False
  self.Destroy()
   
  # end of class MyChild5
   
   
  # Interfaz para la creacion de una lista local
  Frame):
  kwds):
  # begin wxGlade: Mychild6.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
 
 
 
 
 
 
 
 
  LB_SORT)
 
 
  self.GetParent()
  self.__set_properties()
  self.__do_layout()
  self.cancela)
  self.inserta)
  self.borra)
  self.borra_todo)
  self.acepta)
  self.cancela)
  # end wxGlade
   
  self):
  # begin wxGlade: Mychild6.__set_properties
 
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
  # end wxGlade
   
  self):
  # begin wxGlade: Mychild6.__do_layout
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_1)
  self)
  self)
  self.Layout()
  # end wxGlade
   
  # inserta una uri a la lista
  event):
  self.text_ctrl_4.GetValue()
  if uri:
  self.list_box_3.Append(uri)
  self.text_ctrl_4.Clear()
  self.list_box_3.GetCount()
  1
  =items
  0:
  range(items):
  max:
  1):
  self.list_box_3.Delete(i)
  1
  max:
  break
   
  # borra una uri de la lista
  event):
  =[]
  self.list_box_3.GetSelections():
  self.list_box_3.GetString(i))
   
  self.list_box_3.GetCount()
  range(items):
  in lista:
  ==j:
  self.list_box_3.Delete(i)
   
  # borra todas las uris de la lista
  event):
  self.list_box_3.Clear()
   
  # Aplica los cambios
  event):
  import inserta_blacklist
  import apply_conf_squidguard
  import compila_libreria, establece_permisos
   
  self.text_ctrl_2.GetValue()
  if nombre:
 
  =[]
  self.list_box_3.GetCount()):
  self.list_box_3.GetString(i))
  if lst_dom:
  inserta_blacklist(nombre,lst_dom,archivo.configuracion)
  compila_libreria(nombre,archivo.aceptlog)
  apply_conf_squidguard(archivo.aceptlog)
  establece_permisos(archivo.configuracion)
  ICON_INFORMATION
  else:
 
  ICON_EXCLAMATION
  else:
 
  ICON_EXCLAMATION
   
  self, msg,
  | icon)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
  self)
   
  event):
  True
  self.padre.rellena_grupos()
  self.Destroy()
   
  # end of class Mychild6
   
  # Interfaz para la modificacion de una lista local
  Frame):
  kwds):
  # begin wxGlade: Mychild7.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
 
  TE_READONLY)
 
 
 
 
 
 
  LB_SORT)
 
 
  self.GetParent()
  self.__set_properties()
  self.__do_layout()
  self.rellena()
  self.cancela)
  self.inserta)
  self.borra)
  self.borra_todo)
  self.acepta)
  self.cancela)
  # end wxGlade
   
  self):
  # begin wxGlade: Mychild7.__set_properties
 
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
  # end wxGlade
   
  self):
  # begin wxGlade: Mychild7.__do_layout
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_1)
  self)
  self)
  self.Layout()
  # end wxGlade
   
  # Lee las caracteristicas de la lista a modificar y las muestra
  #
  import lee_blacklist
  self.text_ctrl_2.SetValue(bl_lst.nombre)
  =lee_blacklist(bl_lst.nombre,archivo.configuracion)
  #
  self.list_box_3.Append(i)
  #
  #
   
  # a�de una uri a la lista
  event):
  self.text_ctrl_4.GetValue()
  if uri:
  self.list_box_3.Append(uri)
  self.text_ctrl_4.Clear()
  self.list_box_3.GetCount()
  1
  =items
  0:
  range(items):
  max:
  1):
  self.list_box_3.Delete(i)
  1
  max:
  break
   
  # Borra una uri a la lista
  event):
  =[]
  self.list_box_3.GetSelections():
  self.list_box_3.GetString(i))
   
  self.list_box_3.GetCount()
  range(items):
  in lista:
  ==j:
  self.list_box_3.Delete(i)
   
  # borra todas las uris d ela lista
  event):
  self.list_box_3.Clear()
   
  # Aplica los cambios
  event):
  import inserta_blacklist
  import apply_conf_squidguard
  import compila_libreria, establece_permisos
   
  self.text_ctrl_2.GetValue()
  if nombre:
 
  =[]
  self.list_box_3.GetCount()):
  self.list_box_3.GetString(i))
  if lst_dom:
  inserta_blacklist(nombre,lst_dom,archivo.configuracion)
  compila_libreria(nombre,archivo.aceptlog)
  apply_conf_squidguard(archivo.aceptlog)
  establece_permisos(archivo.configuracion)
  ICON_INFORMATION
  else:
 
  ICON_EXCLAMATION
  else:
 
  ICON_EXCLAMATION
   
  self, msg,
  | icon)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  dlg.Destroy()
  self)
   
  event):
  True
  self.Destroy()
   
  # end of class Mychild7
   
  # estadisticas
  Frame):
  kwds):
  # begin wxGlade: MyChild8.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
 
 
  100)
 
 
  1)
  ALIGN_CENTRE)
 
 
 
 
  CB_DROPDOWN)
  CB_DROPDOWN)
  CB_DROPDOWN)
 
  LI_VERTICAL)
  ALIGN_CENTRE)
  TE_READONLY)
 
 
 
   
  self.__set_properties()
  self.__do_layout()
  self.guarda_intervalo)
  self.consulta)
  self.guarda)
  self.recarga)
  self.user_period)
  self.cierra)
  self.cierra)
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild8.__set_properties
 
 
 
 
 
 
 
 
 
 
  0)
  1)
  1)
  False)
  False)
  False)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
  self.intervalo_dias()
   
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild8.__do_layout
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_1)
  self)
  self)
  self.Layout()
  # end wxGlade
   
  event):
  import mostrar_reg_nav
 
  self.combo_box_2.GetSelection())
  self.combo_box_3.GetValue()
  self.combo_box_4.GetValue()
  self.text_ctrl_2.GetValue()
 
  =mostrar_reg_nav(seleccion,usuario,periodo,archivo.configuracion,clave)
  self.text_ctrl_1.Clear()
  in salida:
  self.text_ctrl_1.AppendText(i)
 
   
  event):
  import exists
   
  contenido):
 
  f.write(contenido)
  f.close()
   
 
  SAVE)
  2)
  ID_OK:
  =dlg.GetPath()
  if exists(path):
 
  ICON_QUESTION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg2.SetIcon(_icon)
  ID_YES:
  self.text_ctrl_1.GetValue())
  dlg2.Destroy()
  else:
  self.text_ctrl_1.GetValue())
   
  dlg.Destroy()
   
  event):
  import extrae_periodos
  import users_control_web
 
  self.combo_box_2.GetSelection())
   
 
  self.combo_box_4.Clear()
  True)
  self.combo_box_3.Clear()
  False)
  self.text_ctrl_2.Clear()
  False)
  =extrae_periodos(archivo.configuracion)
  in entradas:
  self.combo_box_4.Append(i)
 
  self.combo_box_3.Clear()
  self.combo_box_4.Clear()
  self.text_ctrl_2.Clear()
  False)
  False)
  False)
 
  self.combo_box_3.Clear()
  self.combo_box_4.Clear()
  True)
  True)
  True)
  =users_control_web(archivo.aceptlog)
 
  in users:
  self.combo_box_3.Append(i)
  =extrae_periodos(archivo.configuracion)
  in entradas:
  self.combo_box_4.Append(i)
   
  else:
  self.combo_box_3.Clear()
  self.combo_box_4.Clear()
  True)
  True)
  True)
  self.text_ctrl_2.Clear()
  False)
  =users_control_web(archivo.aceptlog)
 
  in users:
  self.combo_box_3.Append(i)
  =extrae_periodos(archivo.configuracion)
  in entradas:
  self.combo_box_4.Append(i)
  #rellena combo_box 3 y 4
   
  event):
  import extrae_periodos,extrae_periodos_user
  self.combo_box_3.GetValue()
  self.combo_box_4.Clear()
 
  =extrae_periodos_user(user,archivo.configuracion)
  in entradas:
  self.combo_box_4.Append(i)
  else:
  =extrae_periodos(archivo.configuracion)
  in entradas:
  self.combo_box_4.Append(i)
   
  event):
  import actualiza_campo
  self.spin_ctrl_1.GetValue()),archivo.aceptlog)
   
  self):
  import consulta_campo
  ',archivo.aceptlog)))
   
   
  event):
  import os,os.path
  '):
  ',item)
  file)
  False
  self.Destroy()
   
  # end of class MyChild8
   
  # estadisticas
  Frame):
  kwds):
  # begin wxGlade: MyChild9.__init__
  DEFAULT_FRAME_STYLE
  **kwds)
 
  1)
 
 
 
  CB_DROPDOWN)
  CB_DROPDOWN)
  CB_DROPDOWN)
  LI_VERTICAL)
  ALIGN_CENTRE)
  TE_READONLY)
 
 
   
  self.__set_properties()
  self.__do_layout()
  self.rellena()
  self.consulta)
  self.recarga)
  self.cierra)
  self.cierra)
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild9.__set_properties
 
 
 
 
 
 
  0)
  0)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  self.SetIcon(_icon)
  self.Centre
   
  # end wxGlade
   
  self):
  # begin wxGlade: MyChild9.__do_layout
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  VERTICAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  HORIZONTAL)
  HORIZONTAL)
  VERTICAL)
  HORIZONTAL)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  0)
  True)
  self.SetSizer(sizer_1)
  self)
  self)
  self.Layout()
  # end wxGlade
   
  event):
  import mostrar_uso_aplicaciones
 
 
  self.combo_box_2.GetSelection())
  self.combo_box_3.GetSelection())
  0:
  ICON_EXCLAMATION)
  = wx.EmptyIcon()
  BITMAP_TYPE_ANY))
  dlg.SetIcon(_icon)
  dlg.ShowModal()
  else:
  self.combo_box_4.GetValue()
  ',tipo,periodo,archivo.configuracion)
  self.text_ctrl_1.Clear()
  in salida:
  ':
  len(salida[i])):
  self.text_ctrl_1.AppendText(i)
  ')
  self.text_ctrl_1.AppendText(salida[i][j])
 
  else:
  self.text_ctrl_1.AppendText(i)
  ')
  ':
  len(salida[i])):
  self.text_ctrl_1.AppendText(salida[i][j])
  ')
  else:
  self.text_ctrl_1.AppendText(salida[i])
   
 
   
  event):
  self.rellena()
   
  self):
  import extrae_periodos_uso_aplic
 
  self.combo_box_3.GetSelection())
  =extrae_periodos_uso_aplic(seleccion)
  self.combo_box_4.Clear()
  in periodos:
  self.combo_box_4.Append(i)
   
   
  event):
  False
  self.Destroy()

相关文章:

  • 2022-02-03
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
猜你喜欢
  • 2021-07-01
  • 2022-12-23
  • 2021-05-31
  • 2021-11-16
  • 2022-01-11
  • 2021-11-26
相关资源
相似解决方案