Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
“Erick committed Oct 28, 2021
1 parent 8da1b75 commit 64bb48c
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions Snap-Tool/modules/FormClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ class FormDialog:
"""
telegram = None

"""
Property that stores the path of the configuration file.
"""
path_conf_file = None
configuration = None

"""
Constructor for the FormDialog class.
Expand All @@ -56,8 +53,8 @@ def __init__(self):
self.utils = Utils(self)
self.elastic = Elastic(self)
self.telegram = Telegram(self)
self.configuration = Configuration(self)
self.d.set_background_title("SNAP-TOOL")
self.path_conf_file = self.utils.getPathSnapTool("conf") + "/snap_tool_conf.yaml"

"""
Method that generates the menu interface.
Expand Down Expand Up @@ -355,13 +352,11 @@ def getScrollBox(self, text, title):
self -- An instantiated object of the FormDialog class.
"""
def defineConfiguration(self):
configuration = Configuration(self)

options_conf_false = [("Create", "Create the configuration file", 0)]

options_conf_true = [("Modify", "Modify the configuration file", 0)]

if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
opt_conf_false = self.getDataRadioList("Select a option:", options_conf_false, "Configuration Options")
if opt_conf_false == "Create":
configuration.createConfiguration()
Expand All @@ -381,7 +376,7 @@ def defineConfiguration(self):
"""
def createRepository(self):
try:
if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
self.d.msgbox(text = "\nConfiguration file not found.", height = 7, width = 50, title = "Error Message")
else:
repository_name = self.getDataInputText("Enter the name to be assigned to the repository:", "repository_name")
Expand Down Expand Up @@ -416,7 +411,7 @@ def createRepository(self):
"""
def deleteRepository(self):
try:
if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
self.d.msgbox(text = "\nConfiguration file not found.", height = 7, width = 50, title = "Error Message")
else:
conn_es = self.elastic.getConnectionElastic()
Expand Down Expand Up @@ -455,7 +450,7 @@ def deleteRepository(self):
"""
def createSnapshot(self):
try:
if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
self.d.msgbox(text = "\nConfiguration file not found.", height = 7, width = 50, title = "Error Message")
else:
conn_es = self.elastic.getConnectionElastic()
Expand Down Expand Up @@ -520,7 +515,7 @@ def createSnapshot(self):
"""
def deleteSnapshot(self):
try:
if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
self.d.msgbox(text = "\nConfiguration file not found.", height = 7, width = 50, title = "Error Message")
else:
conn_es = self.elastic.getConnectionElastic()
Expand Down Expand Up @@ -564,7 +559,7 @@ def deleteSnapshot(self):
"""
def restoreSnapshot(self):
try:
if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
self.d.msgbox(text = "\nConfiguration file not found.", height = 7, width = 50, title = "Error Message")
else:
conn_es = self.elastic.getConnectionElastic()
Expand Down Expand Up @@ -604,7 +599,7 @@ def restoreSnapshot(self):
"""
def mountSearchableSnapshot(self):
try:
if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
self.d.msgbox(text = "\nConfiguration file not found.", height = 7, width = 50, title = "Error Message")
else:
conn_es = self.elastic.getConnectionElastic()
Expand Down Expand Up @@ -644,7 +639,7 @@ def mountSearchableSnapshot(self):
"""
def deleteIndices(self):
try:
if not path.exists(self.path_conf_file):
if not path.exists(self.configuration.conf_file):
self.d.msgbox(text = "\nConfiguration file not found.", height = 7, width = 50, title = "Error Message")
else:
conn_es = self.elastic.getConnectionElastic()
Expand Down

0 comments on commit 64bb48c

Please sign in to comment.