canfestival/canfestival.py
changeset 2437 105c20fdeb19
parent 2418 5587c490a070
child 2442 b13f021c68a5
equal deleted inserted replaced
2436:82bfc75bcd9d 2437:105c20fdeb19
    22 # You should have received a copy of the GNU General Public License
    22 # You should have received a copy of the GNU General Public License
    23 # along with this program; if not, write to the Free Software
    23 # along with this program; if not, write to the Free Software
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    25 
    25 
    26 from __future__ import absolute_import
    26 from __future__ import absolute_import
       
    27 from __future__ import division
    27 import os
    28 import os
    28 import sys
    29 import sys
    29 import shutil
    30 import shutil
    30 import wx
    31 import wx
    31 from gnosis.xml.pickle import *  # pylint: disable=import-error
    32 from gnosis.xml.pickle import *  # pylint: disable=import-error
   325     def SetParamsAttribute(self, path, value):
   326     def SetParamsAttribute(self, path, value):
   326         if path == "CanFestivalNode.NodeId":
   327         if path == "CanFestivalNode.NodeId":
   327             nodeid = self.CanFestivalNode.getNodeId()
   328             nodeid = self.CanFestivalNode.getNodeId()
   328             if value != nodeid:
   329             if value != nodeid:
   329                 slaves = self.GetSlaveIDs()
   330                 slaves = self.GetSlaveIDs()
   330                 dir = (value - nodeid) / abs(value - nodeid)
   331                 dir = (value - nodeid) // abs(value - nodeid)
   331                 while value in slaves and value >= 0:
   332                 while value in slaves and value >= 0:
   332                     value += dir
   333                     value += dir
   333                 if value < 0:
   334                 if value < 0:
   334                     value = nodeid
   335                     value = nodeid
   335 
   336