Commit 33853fa80168e7a6f8b5696f766090f68c39951a

Authored by Thiago Franco de Moraes
1 parent 19d7313c
Exists in master

Error in loading invesalius config file

Showing 1 changed file with 2 additions and 12 deletions   Show diff stats
invesalius/session.py
... ... @@ -271,8 +271,7 @@ class Session(metaclass=Singleton):
271 271 def _read_cfg_from_json(self, json_filename):
272 272 with open(json_filename, 'r') as cfg_file:
273 273 cfg_dict = json.load(cfg_file)
274   - self._value = deep_merge_dict(self._values, cfg_dict)
275   - print(self._values)
  274 + self._values = deep_merge_dict(self._values.copy(), cfg_dict)
276 275  
277 276 # Do not reading project status from the config file, since there
278 277 # isn't a recover session tool in InVesalius yet.
... ... @@ -306,15 +305,6 @@ class Session(metaclass=Singleton):
306 305 self.random_id = config.getint('session','random_id')
307 306  
308 307 def ReadSession(self):
309   - try:
310   - self._read_cfg_from_json(USER_INV_CFG_PATH)
311   - except Exception as e1:
312   - debug(e1)
313   - try:
314   - self._read_cfg_from_ini(OLD_USER_INV_CFG_PATH)
315   - except Exception as e2:
316   - debug(e2)
317   - return False
318   -
  308 + self._read_cfg_from_json(USER_INV_CFG_PATH)
319 309 self.WriteSessionFile()
320 310 return True
... ...