(filename:str)
| 111 | |
| 112 | @staticmethod |
| 113 | def load_settings(filename:str)->None: |
| 114 | |
| 115 | try: |
| 116 | filename = os.path.expanduser(filename) |
| 117 | if not Util.check_file(filename): |
| 118 | raise MapXploreException(message=locale.get("errors.file_not_exists").format(file=filename)) |
| 119 | else: |
| 120 | with open(filename, "r") as jfile: |
| 121 | json_data = json.load(jfile) |
| 122 | for section in Settings.setting: |
| 123 | for subsection in Settings.setting[section]: |
| 124 | if section in json_data: |
| 125 | if subsection in json_data[section]: |
| 126 | Settings.set_value(section, subsection, json_data[section][subsection]) |
| 127 | |
| 128 | #Settings.setting.update(json_data) |
| 129 | except Exception as e: |
| 130 | raise MapXploreException(message=str(e)) |
| 131 | |
| 132 | @staticmethod |
| 133 | def get_principal_db(dbms)->str: |
no test coverage detected