# HG changeset patch
# User Edouard Tisserant
# Date 1590479900 -7200
# Node ID f0a822ef9fa06f88b99735dd4d19321714850ce3
# Parent  4a9b0df0602a614d2b9cd4cc3b5aca2989d808ca
Solve import order problem when POULibrary imports ConfigTreeNode because of UserAddressedException. Now UserAddressedException is declared in POULibrary.py, as a quick and dirty fix, but some independant module should be created for beremiz exceptions in general.

diff -r 4a9b0df0602a -r f0a822ef9fa0 ConfigTreeNode.py
--- a/ConfigTreeNode.py	Thu May 21 11:29:45 2020 +0200
+++ b/ConfigTreeNode.py	Tue May 26 09:58:20 2020 +0200
@@ -46,6 +46,7 @@
 from xmlclass import GenerateParserFromXSDstring
 from PLCControler import LOCATION_CONFNODE
 from editors.ConfTreeNodeEditor import ConfTreeNodeEditor
+from POULibrary import UserAddressedException
 
 _BaseParamsParser = GenerateParserFromXSDstring("""<?xml version="1.0" encoding="ISO-8859-1" ?>
         <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
@@ -678,7 +679,3 @@
 
         raise UserAddressedException(message)
 
-# Exception type for problems that user has to take action in order to fix
-class UserAddressedException(Exception):
-    pass
-
diff -r 4a9b0df0602a -r f0a822ef9fa0 POULibrary.py
--- a/POULibrary.py	Thu May 21 11:29:45 2020 +0200
+++ b/POULibrary.py	Tue May 26 09:58:20 2020 +0200
@@ -26,7 +26,10 @@
 from __future__ import absolute_import
 from weakref import ref
 
-from ConfigTreeNode import UserAddressedException
+# Exception type for problems that user has to take action in order to fix
+class UserAddressedException(Exception):
+    pass
+
 
 class POULibrary(object):
     def __init__(self, CTR, LibName, TypeStack):
diff -r 4a9b0df0602a -r f0a822ef9fa0 ProjectController.py
--- a/ProjectController.py	Thu May 21 11:29:45 2020 +0200
+++ b/ProjectController.py	Tue May 26 09:58:20 2020 +0200
@@ -63,7 +63,8 @@
 import targets
 from runtime.typemapping import DebugTypesSize, UnpackDebugBuffer
 from runtime import PlcStatus
-from ConfigTreeNode import ConfigTreeNode, XSDSchemaErrorMessage, UserAddressedException
+from ConfigTreeNode import ConfigTreeNode, XSDSchemaErrorMessage
+from POULibrary import UserAddressedException
 
 base_folder = paths.AbsParentDir(__file__)