Skip to content
Snippets Groups Projects
Commit 70c639b4 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Fill debug section

parent 773b2371
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,13 @@ web_url = http://localhost:5000
# Max size of uploaded files (also for files from URL):
max_upload_size = 3G # Please set the unit: M for Megabyte or G for Gigabyte (-1 without unit to don't set a limit)
# Debug (enable only for tests):
debug = False
[debug]
# Debug (enable only for tests)
enable = False
log_dir = ###PROGRAM###/logs
# List of allowed IPs for tests, comma separated:
allowed_ip_tests =
[cluster]
......
......@@ -83,19 +83,6 @@ class AppConfigReader:
except NoOptionError:
return -1
def get_debug(self):
try:
return self.reader.get("global", "debug").lower() == "true"
except NoOptionError:
return False
def get_log_dir(self):
try:
return self.replace_vars(self.reader.get("global", "log_dir"))
except NoOptionError:
if self.get_debug():
raise Exception("No log dir defined and debug=True")
def get_minimap2_exec(self):
try:
entry = self.reader.get("softwares", "minimap2")
......@@ -229,3 +216,26 @@ class AppConfigReader:
return min_size
except (NoOptionError, NoSectionError):
return 0
def get_debug(self):
try:
return self.reader.get("debug", "enable").lower() == "true"
except (NoOptionError, NoSectionError):
return False
def get_log_dir(self):
try:
return self.replace_vars(self.reader.get("debug", "log_dir"))
except (NoOptionError, NoSectionError):
if self.get_debug():
raise Exception("No log dir defined and debug=True")
def get_allowed_ip_tests(self):
allowed_ip = {"127.0.0.1"}
try:
allowed_ip_txt = self.reader.get("debug", "allowed_ip_tests")
for ip in re.split(r",(\s+)?", allowed_ip_txt):
allowed_ip.add(ip)
except (NoOptionError, NoSectionError):
pass
return allowed_ip
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment