ConfigTreeNode.py
changeset 1737 a39c2918c015
parent 1736 7e61baa047f0
child 1738 d2e979738700
--- a/ConfigTreeNode.py	Mon Aug 14 23:27:15 2017 +0300
+++ b/ConfigTreeNode.py	Mon Aug 14 23:34:22 2017 +0300
@@ -450,14 +450,14 @@
 
         # Now, try to guess the nearest available channel
         res = DesiredChannel
-        while res in AllChannels: # While channel not free
-            if res < CurrentChannel: # Want to go down ?
-                res -=  1 # Test for n-1
+        while res in AllChannels:  # While channel not free
+            if res < CurrentChannel:  # Want to go down ?
+                res -=  1  # Test for n-1
                 if res < 0 :
                     self.GetCTRoot().logger.write_warning(_("Cannot find lower free IEC channel than %d\n") % CurrentChannel)
-                    return CurrentChannel # Can't go bellow 0, do nothing
-            else : # Want to go up ?
-                res +=  1 # Test for n-1
+                    return CurrentChannel  # Can't go bellow 0, do nothing
+            else :  # Want to go up ?
+                res +=  1  # Test for n-1
         # Finally set IEC Channel
         self.BaseParams.setIEC_Channel(res)
         return res
@@ -561,7 +561,7 @@
                 # check name is unique
                 NewCTNName = _self.FindNewName(CTNName)
                 # If dir have already be made, and file exist
-                if os.path.isdir(_self.CTNPath(NewCTNName)): #and os.path.isfile(_self.ConfNodeXmlFilePath(CTNName)):
+                if os.path.isdir(_self.CTNPath(NewCTNName)):  #and os.path.isfile(_self.ConfNodeXmlFilePath(CTNName)):
                     # Load the confnode.xml file into parameters members
                     _self.LoadXMLParams(NewCTNName)
                     # Basic check. Better to fail immediately.