示例#1
0
def comprobar_rutas(data_file, out_dir, log_file):

    if not os.path.exists(data_file):
        print('\n ¡¡¡no existe el fichero de datos!!! \n')
        exit(0)

    if not os.path.exists(out_dir):
        os.mkdir(out_dir)

    # si no existe el fichero de logs, lo creamos
    if not os.path.exists(log_file):
        logs_aux = open_io(log_file, "x")
        logger_aux = csvwriter(logs_aux, delimiter=',')
        logger_aux.writerow(
            ["Tipo", "Texto", "Clave_Imagen", "URL", "Nombre_Fichero"])
        logs_aux.close()
示例#2
0
    def getStatusTelkAlertService(self):
        """
		Method that obtains the status of the Telk-Alert service.
		"""
        if path.exists('/tmp/telk_alert.status'):
            remove('/tmp/telk_alert.status')
        system(
            '(systemctl is-active --quiet telk-alert.service && echo "Telk-Alert service is running!" || echo "Telk-Alert service is not running!") >> /tmp/telk_alert.status'
        )
        system('echo "Detailed service status:" >> /tmp/telk_alert.status')
        system(
            'systemctl -l status telk-alert.service >> /tmp/telk_alert.status')
        with open_io('/tmp/telk_alert.status', 'r',
                     encoding='utf-8') as file_status:
            self.__dialog.createScrollBoxDialog(file_status.read(), 18, 70,
                                                "Telk-Alert Service")
        self.__action_to_cancel()
示例#3
0
def definition(log_file):
    global logs
    logs = open_io(log_file, "a")
    global logger
    logger = csvwriter(logs, delimiter=',')