Commit e925a959 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Model, View: Some switch to logging.

Showing with 20 additions and 7 deletions
+20 -7
# -*- 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(
......
# -*- 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
......
......@@ -2,6 +2,7 @@
import os
import csv
import logging
from io import StringIO
from datetime import datetime
......@@ -26,6 +27,8 @@ from PyQt5.uic import loadUi
from Model.Except import ClipboardFormatError
logger = logging.getLogger()
class WindowToolKit(object):
def __init__(self, parent=None):
super(WindowToolKit, self).__init__()
......@@ -140,7 +143,7 @@ class ASubWindowFeatures(object):
try:
self.find(QLineEdit, name).setText(text)
except AttributeError as e:
print(e)
logger.error(e)
def get_line_edit_text(self, name:str):
"""Get text of line edit component
......
......@@ -169,7 +169,6 @@ class CheckListWindow(ASubMainWindow, ListedSubWindow):
self.close()
def reject(self):
print("cancel")
self.end()
def accept(self):
......
# -*- coding: utf-8 -*-
import logging
from tools import trace, timer
from View.ASubWindow import ASubMainWindow
......@@ -23,6 +25,8 @@ from PyQt5.QtWidgets import (
QProgressBar, QLabel, QTextEdit,
)
logger = logging.getLogger()
_translate = QCoreApplication.translate
class ReplWindow(ASubMainWindow, ListedSubWindow):
......@@ -71,7 +75,7 @@ class ReplWindow(ASubMainWindow, ListedSubWindow):
self._history_ind = 0
rich_code = "self.__debug_exec_result__ = " + code
print(f"[DEBUG] ! {code}")
logger.debug(f"{code}")
try:
value = exec(rich_code)
value = self.__debug_exec_result__
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment