def refreshWindow(self): buttonReply = QtWidgets.QMessageBox.question(self, 'JaSONx', "Refresh application?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No) if buttonReply == QtWidgets.QMessageBox.Yes: dialog = MainInterface(self) self.hide() utility.refreshTemplateConfiguration() dialog.show()
def addJsonTemplate(path): file_path = os.path.basename(path) if (os.path.isfile(path) and utility.getSubstring(file_path, start=".") == "json"): path_name, file_name = os.path.splitext(file_path) shutil.copy(path, os.path.join(json_templates_path)) utility.refreshTemplateConfiguration() return True elif (os.path.isdir(path)): list_files = utility.createFileList(path, ".json") for file in list_files: shutil.copy(os.path.join(path, file), os.path.join(json_templates_path)) utility.add_measures_template(list_files) return True else: return False
def refreshTemplateConfiguration(self): buttonReply = QtWidgets.QMessageBox.question(self, 'JaSONx', "Refresh template configuration?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No) if buttonReply == QtWidgets.QMessageBox.Yes: utility.refreshTemplateConfiguration()
''' JaSONx GUI Version @author = "Jury Francia, Simone Olivieri, Vic Zagranowski" @version = "3.1.2.0" @email = "[email protected], [email protected], [email protected]" ''' from xml.dom import minidom import os import utility import configuration utility.refreshTemplateConfiguration() configuration.control_paths() class Jasonx(): def __init__(self, username, password, hierarchy, gateway_id, environment_prefix): '''Configuration path''' dict_configuration_path = utility.getConfigurationPath() self.json_templates_path = dict_configuration_path[ "json_templates_path"] self.excel_templates_path = dict_configuration_path[ "excel_templates_path"] self.json_files_path = dict_configuration_path["json_files_path"] self.excel_files_path = dict_configuration_path["excel_files_path"] self.hierarchy_file_path = dict_configuration_path["hierarchy_path"] '''Data''' self.dict_configuration_path = utility.getConfigurationPath self.username = username self.password = password