mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Model, View: Some switch to logging.
This commit is contained in:
1 parent
bc78542d2c
commit
e925a95987
5 files changed
+20
-7
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user