Model, View: Some switch to logging.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-07-05 16:49:26 +02:00
1 parent bc78542d2c
commit e925a95987
5 files changed
+20 -7

No files matched your search

+5 -1
View File
@@ -1,10 +1,14 @@
# -*- coding: utf-8 -*-
import logging
from tools import timer
from Model.Geometry.Point import Point
from Model.Except import NotImplementedMethodeError
logger = logging.getLogger()
class Profile(object):
_id_cnt = 0
@@ -241,7 +245,7 @@ class Profile(object):
@timer
def sort_with_indexes(self, indexes: list):
if len(self._points) != len(indexes):
print("TODO: CRITICAL ERROR!")
logger.critical("Indexes list do not correspond to point list")
self._points = list(
map(
+6 -3
View File
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import logging
import numpy as np
from time import time
@@ -17,6 +18,8 @@ from Model.Geometry.ProfileXYZ import ProfileXYZ
from Model.Except import FileFormatError, exception_message_box
logger = logging.getLogger()
class Reach(SQLSubModel):
_sub_classes = [
ProfileXYZ,
@@ -377,7 +380,7 @@ class Reach(SQLSubModel):
@timer
def sort_with_indexes(self, indexes: list):
if len(self._profiles) != len(indexes):
print("TODO: CRITICAL ERROR!")
logger.critical("Indexes list do not correspond to profile list")
self._profiles = list(
map(
@@ -424,10 +427,10 @@ class Reach(SQLSubModel):
self._status.modified()
except FileNotFoundError as e:
print(e)
logger.error(e)
exception_message_box(e)
except FileFormatError as e:
print(e)
logger.error(e)
e.alert()
@timer