mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 19:24:23 +00:00
Fix some issues
This commit is contained in:
@@ -62,7 +62,7 @@ class Install:
|
||||
defender_install_folder=defender_install_folder,
|
||||
venv_folder=venv_folder,
|
||||
venv_cmd_installation=['python3', '-m', 'venv', venv_folder],
|
||||
venv_cmd_requirements=['sqlalchemy','psutil','requests'],
|
||||
venv_cmd_requirements=['sqlalchemy','psutil','requests','faker'],
|
||||
venv_pip_executable=f'{os.path.join(defender_install_folder, venv_folder, "bin")}{os.sep}pip',
|
||||
venv_python_executable=f'{os.path.join(defender_install_folder, venv_folder, "bin")}{os.sep}python'
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import json
|
||||
import json, sys
|
||||
from os import sep
|
||||
from typing import Union
|
||||
from dataclasses import dataclass, field
|
||||
@@ -72,16 +72,21 @@ class Config:
|
||||
return None
|
||||
|
||||
def __load_json_service_configuration(self):
|
||||
try:
|
||||
conf_filename = f'core{sep}configuration.json'
|
||||
with open(conf_filename, 'r') as configuration_data:
|
||||
configuration:dict[str, Union[str, int, list, dict]] = json.load(configuration_data)
|
||||
|
||||
conf_filename = f'core{sep}configuration.json'
|
||||
with open(conf_filename, 'r') as configuration_data:
|
||||
configuration:dict[str, Union[str, int, list, dict]] = json.load(configuration_data)
|
||||
for key, value in configuration['CONFIG_COLOR'].items():
|
||||
configuration['CONFIG_COLOR'][key] = str(value).encode('utf-8').decode('unicode_escape')
|
||||
|
||||
return configuration
|
||||
|
||||
except FileNotFoundError as fe:
|
||||
print(f'FileNotFound: {fe}')
|
||||
print('Configuration file not found please create core/configuration.json')
|
||||
sys.exit(0)
|
||||
|
||||
for key, value in configuration['CONFIG_COLOR'].items():
|
||||
configuration['CONFIG_COLOR'][key] = str(value).encode('utf-8').decode('unicode_escape')
|
||||
|
||||
return configuration
|
||||
|
||||
def __load_service_configuration(self) -> ConfigDataModel:
|
||||
import_config = self.__load_json_service_configuration()
|
||||
|
||||
|
||||
@@ -208,10 +208,12 @@ class Clone():
|
||||
if clone_name.lower() == 'all':
|
||||
for clone in self.ModConfig.clone_nicknames:
|
||||
self.Irc.send2socket(f':{dnickname} PRIVMSG {clone} :KILL')
|
||||
self.ModConfig.clone_nicknames.remove(clone)
|
||||
else:
|
||||
for clone in self.ModConfig.clone_nicknames:
|
||||
if clone_name == clone:
|
||||
self.Irc.send2socket(f':{dnickname} PRIVMSG {clone} :KILL')
|
||||
self.ModConfig.clone_nicknames.remove(clone)
|
||||
|
||||
except Exception as err:
|
||||
self.Logs.error(f'{err}')
|
||||
|
||||
@@ -4,7 +4,6 @@ from typing import Union
|
||||
import re, socket, psutil, requests, json, time
|
||||
from sys import exit
|
||||
from core.irc import Irc
|
||||
from test import Test
|
||||
|
||||
# Le module crée devra réspecter quelques conditions
|
||||
# 1. Le nom de la classe devra toujours s'appeler comme le module. Exemple => nom de class Defender | nom du module mod_defender
|
||||
|
||||
Reference in New Issue
Block a user