Roll up all changes from #962 as the base has been massively changed by code cleanups. Rename our logging to a universal pyfalog to avoid shadowing either Logging or Logbook loggers
This commit is contained in:
@@ -25,6 +25,9 @@ from wx.lib.intctrl import IntCtrl
|
||||
from gui.utils.clipboard import toClipboard, fromClipboard
|
||||
from gui.builtinViews.entityEditor import EntityEditor, BaseValidator
|
||||
from service.damagePattern import DamagePattern, ImportError
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class DmgPatternTextValidor(BaseValidator):
|
||||
@@ -47,6 +50,7 @@ class DmgPatternTextValidor(BaseValidator):
|
||||
|
||||
return True
|
||||
except ValueError as e:
|
||||
pyfalog.error(e)
|
||||
wx.MessageBox(u"{}".format(e), "Error")
|
||||
textCtrl.SetFocus()
|
||||
return False
|
||||
@@ -256,9 +260,13 @@ class DmgPatternEditorDlg(wx.Dialog):
|
||||
sDP.importPatterns(text)
|
||||
self.stNotice.SetLabel("Patterns successfully imported from clipboard")
|
||||
except ImportError as e:
|
||||
pyfalog.error(e)
|
||||
self.stNotice.SetLabel(str(e))
|
||||
except Exception:
|
||||
self.stNotice.SetLabel("Could not import from clipboard: unknown errors")
|
||||
except Exception as e:
|
||||
msg = "Could not import from clipboard: unknown errors"
|
||||
pyfalog.warning(msg)
|
||||
pyfalog.error(e)
|
||||
self.stNotice.SetLabel(msg)
|
||||
finally:
|
||||
self.entityEditor.refreshEntityList()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user