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,
|
defender_install_folder=defender_install_folder,
|
||||||
venv_folder=venv_folder,
|
venv_folder=venv_folder,
|
||||||
venv_cmd_installation=['python3', '-m', 'venv', 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_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'
|
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 os import sep
|
||||||
from typing import Union
|
from typing import Union
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
@@ -72,7 +72,7 @@ class Config:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def __load_json_service_configuration(self):
|
def __load_json_service_configuration(self):
|
||||||
|
try:
|
||||||
conf_filename = f'core{sep}configuration.json'
|
conf_filename = f'core{sep}configuration.json'
|
||||||
with open(conf_filename, 'r') as configuration_data:
|
with open(conf_filename, 'r') as configuration_data:
|
||||||
configuration:dict[str, Union[str, int, list, dict]] = json.load(configuration_data)
|
configuration:dict[str, Union[str, int, list, dict]] = json.load(configuration_data)
|
||||||
@@ -82,6 +82,11 @@ class Config:
|
|||||||
|
|
||||||
return configuration
|
return configuration
|
||||||
|
|
||||||
|
except FileNotFoundError as fe:
|
||||||
|
print(f'FileNotFound: {fe}')
|
||||||
|
print('Configuration file not found please create core/configuration.json')
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
def __load_service_configuration(self) -> ConfigDataModel:
|
def __load_service_configuration(self) -> ConfigDataModel:
|
||||||
import_config = self.__load_json_service_configuration()
|
import_config = self.__load_json_service_configuration()
|
||||||
|
|
||||||
|
|||||||
@@ -208,10 +208,12 @@ class Clone():
|
|||||||
if clone_name.lower() == 'all':
|
if clone_name.lower() == 'all':
|
||||||
for clone in self.ModConfig.clone_nicknames:
|
for clone in self.ModConfig.clone_nicknames:
|
||||||
self.Irc.send2socket(f':{dnickname} PRIVMSG {clone} :KILL')
|
self.Irc.send2socket(f':{dnickname} PRIVMSG {clone} :KILL')
|
||||||
|
self.ModConfig.clone_nicknames.remove(clone)
|
||||||
else:
|
else:
|
||||||
for clone in self.ModConfig.clone_nicknames:
|
for clone in self.ModConfig.clone_nicknames:
|
||||||
if clone_name == clone:
|
if clone_name == clone:
|
||||||
self.Irc.send2socket(f':{dnickname} PRIVMSG {clone} :KILL')
|
self.Irc.send2socket(f':{dnickname} PRIVMSG {clone} :KILL')
|
||||||
|
self.ModConfig.clone_nicknames.remove(clone)
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.Logs.error(f'{err}')
|
self.Logs.error(f'{err}')
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from typing import Union
|
|||||||
import re, socket, psutil, requests, json, time
|
import re, socket, psutil, requests, json, time
|
||||||
from sys import exit
|
from sys import exit
|
||||||
from core.irc import Irc
|
from core.irc import Irc
|
||||||
from test import Test
|
|
||||||
|
|
||||||
# Le module crée devra réspecter quelques conditions
|
# 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
|
# 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