Index: drone/module131.py
===================================================================
--- drone/module131.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module131.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module131', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module131', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module132.py
===================================================================
--- drone/module132.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module132.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module132', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module132', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module133.py
===================================================================
--- drone/module133.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module133.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module133', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module133', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module231.py
===================================================================
--- drone/module231.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module231.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module231', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module231', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module232.py
===================================================================
--- drone/module232.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module232.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module232', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module232', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module233.py
===================================================================
--- drone/module233.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module233.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module233', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module233', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module322.py
===================================================================
--- drone/module322.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module322.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module322', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module322', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module331.py
===================================================================
--- drone/module331.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module331.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module331', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module331', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module332.py
===================================================================
--- drone/module332.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module332.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module332', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module332', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module333.py
===================================================================
--- drone/module333.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module333.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module333', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module333', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module341.py
===================================================================
--- drone/module341.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module341.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module341', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module341', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module342.py
===================================================================
--- drone/module342.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module342.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module342', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module342', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module343.py
===================================================================
--- drone/module343.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module343.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module343', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module343', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module422.py
===================================================================
--- drone/module422.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module422.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module422', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module422', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module431.py
===================================================================
--- drone/module431.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module431.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module431', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module431', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module432.py
===================================================================
--- drone/module432.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module432.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module432', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module432', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module433.py
===================================================================
--- drone/module433.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module433.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module433', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module433', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module441.py
===================================================================
--- drone/module441.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module441.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module441', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module441', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module442.py
===================================================================
--- drone/module442.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module442.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module442', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module442', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module443.py
===================================================================
--- drone/module443.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module443.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module443', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module443', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module521.py
===================================================================
--- drone/module521.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module521.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module521', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module521', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module522.py
===================================================================
--- drone/module522.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module522.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module522', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module522', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module523.py
===================================================================
--- drone/module523.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module523.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module523', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module523', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module531.py
===================================================================
--- drone/module531.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module531.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module531', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module531', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module532.py
===================================================================
--- drone/module532.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module532.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module532', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module532', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module533.py
===================================================================
--- drone/module533.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module533.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module533', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module533', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module541.py
===================================================================
--- drone/module541.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module541.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module541', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module541', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module542.py
===================================================================
--- drone/module542.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module542.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module542', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module542', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module543.py
===================================================================
--- drone/module543.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module543.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module543', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module543', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module621.py
===================================================================
--- drone/module621.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module621.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module621', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module621', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module622.py
===================================================================
--- drone/module622.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module622.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module622', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module622', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module623.py
===================================================================
--- drone/module623.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module623.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module623', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module623', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module631.py
===================================================================
--- drone/module631.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module631.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module631', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module631', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module632.py
===================================================================
--- drone/module632.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module632.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module632', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module632', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module633.py
===================================================================
--- drone/module633.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module633.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module633', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module633', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module641.py
===================================================================
--- drone/module641.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module641.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module641', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module641', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module642.py
===================================================================
--- drone/module642.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module642.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module642', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module642', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/module643.py
===================================================================
--- drone/module643.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/module643.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='module643', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='module643', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/monitor1.py
===================================================================
--- drone/monitor1.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/monitor1.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,12 +1,14 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import NEON
@@ -16,22 +18,27 @@
 import os
 
-pid={}
-pid['monitor1']={}
-pid['monitor2']={}
-pid['monitor3']={}
-pid['monitor1']['idstart']=7110001
-pid['monitor1']['idsize']=1024
-pid['monitor2']['idstart']=8110001
-pid['monitor2']['idsize']=1024
-pid['monitor3']['idstart']=9110001
-pid['monitor3']['idsize']=1024
+pid = {}
+pid['monitor1'] = {}
+pid['monitor2'] = {}
+pid['monitor3'] = {}
+pid['monitor1']['idstart'] = 7110001
+pid['monitor1']['idsize'] = 1024
+pid['monitor2']['idstart'] = 8110001
+pid['monitor2']['idsize'] = 1024
+pid['monitor3']['idstart'] = 9110001
+pid['monitor3']['idsize'] = 1024
+
 
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -47,80 +54,100 @@
         self.data = self.server.get(self.path)
 
+
 def App(in_module='', in_redisip='', in_cron=1):
 
     m_modulename = in_module
-    m_redisip    = in_redisip
-    m_cron       = in_cron#15
+    m_redisip = in_redisip
+    m_cron = in_cron  # 15
 
     factor = 1  # 1us to 1us
-    m_tofstart= 0*factor
-    m_tofstep = 16*factor
+    m_tofstart = 0 * factor
+    m_tofstep = 16 * factor
     m_tofbins = 2500
 
-    path  = '/GPPD/workspace/'+m_modulename
+    path = '/GPPD/workspace/' + m_modulename
 
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
-    #r.set(path+"/tof", json.dumps(toflist))
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, \
-                    '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', \
-                                    hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    # r.set(path+"/tof", json.dumps(toflist))
+
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = pid['m_modulename']['idstart']
-    idsize  = pid['m_modulename']['idsize']
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = pid['m_modulename']['idsize']
+    pidlist = [i + idstart for i in xrange(idsize)]
 
-    #print pidlist
+    # print pidlist
+
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
 
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("SANSDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("EpicsInputSvc/DataInputSvc")
-    iSvc = task.find("DataInputSvc")
-    iSvc.property("Channel").set("gppd:"+m_modulename)
+    task.property('svcs').append('SANSDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('EpicsInputSvc/DataInputSvc')
+    iSvc = task.find('DataInputSvc')
+    iSvc.property('Channel').set('gppd:' + m_modulename)
 
     import Algorithms
-    task.property("algs").append("RunningInfAlg")
-    task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
+    task.property('algs').append('RunningInfAlg')
+    task.property('algs').append('DumpAlg')
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
 
     iSvc.show()
@@ -131,4 +158,5 @@
 
 
-if __name__ == "__main__":
-    App(in_module='monitor1', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+if __name__ == '__main__':
+    App(in_module='monitor1', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/monitor2.py
===================================================================
--- drone/monitor2.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/monitor2.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,12 +1,14 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import NEON
@@ -16,22 +18,27 @@
 import os
 
-pid={}
-pid['monitor1']={}
-pid['monitor2']={}
-pid['monitor3']={}
-pid['monitor1']['idstart']=7110001
-pid['monitor1']['idsize']=1024
-pid['monitor2']['idstart']=8110001
-pid['monitor2']['idsize']=1024
-pid['monitor3']['idstart']=9110001
-pid['monitor3']['idsize']=1024
+pid = {}
+pid['monitor1'] = {}
+pid['monitor2'] = {}
+pid['monitor3'] = {}
+pid['monitor1']['idstart'] = 7110001
+pid['monitor1']['idsize'] = 1024
+pid['monitor2']['idstart'] = 8110001
+pid['monitor2']['idsize'] = 1024
+pid['monitor3']['idstart'] = 9110001
+pid['monitor3']['idsize'] = 1024
+
 
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -47,80 +54,100 @@
         self.data = self.server.get(self.path)
 
+
 def App(in_module='', in_redisip='', in_cron=1):
 
     m_modulename = in_module
-    m_redisip    = in_redisip
-    m_cron       = in_cron#15
+    m_redisip = in_redisip
+    m_cron = in_cron  # 15
 
     factor = 1  # 1us to 1us
-    m_tofstart= 0*factor
-    m_tofstep = 16*factor
+    m_tofstart = 0 * factor
+    m_tofstep = 16 * factor
     m_tofbins = 2500
 
-    path  = '/GPPD/workspace/'+m_modulename
+    path = '/GPPD/workspace/' + m_modulename
 
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
-    #r.set(path+"/tof", json.dumps(toflist))
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, \
-                    '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', \
-                                    hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    # r.set(path+"/tof", json.dumps(toflist))
+
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = pid['m_modulename']['idstart']
-    idsize  = pid['m_modulename']['idsize']
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = pid['m_modulename']['idsize']
+    pidlist = [i + idstart for i in xrange(idsize)]
 
-    #print pidlist
+    # print pidlist
+
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
 
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("SANSDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("EpicsInputSvc/DataInputSvc")
-    iSvc = task.find("DataInputSvc")
-    iSvc.property("Channel").set("gppd:"+m_modulename)
+    task.property('svcs').append('SANSDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('EpicsInputSvc/DataInputSvc')
+    iSvc = task.find('DataInputSvc')
+    iSvc.property('Channel').set('gppd:' + m_modulename)
 
     import Algorithms
-    task.property("algs").append("RunningInfAlg")
-    task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
+    task.property('algs').append('RunningInfAlg')
+    task.property('algs').append('DumpAlg')
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
 
     iSvc.show()
@@ -131,4 +158,5 @@
 
 
-if __name__ == "__main__":
-    App(in_module='template', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+if __name__ == '__main__':
+    App(in_module='template', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/monitor3.py
===================================================================
--- drone/monitor3.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/monitor3.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,12 +1,14 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import NEON
@@ -16,22 +18,27 @@
 import os
 
-pid={}
-pid['monitor1']={}
-pid['monitor2']={}
-pid['monitor3']={}
-pid['monitor1']['idstart']=7110001
-pid['monitor1']['idsize']=1024
-pid['monitor2']['idstart']=8110001
-pid['monitor2']['idsize']=1024
-pid['monitor3']['idstart']=9110001
-pid['monitor3']['idsize']=1024
+pid = {}
+pid['monitor1'] = {}
+pid['monitor2'] = {}
+pid['monitor3'] = {}
+pid['monitor1']['idstart'] = 7110001
+pid['monitor1']['idsize'] = 1024
+pid['monitor2']['idstart'] = 8110001
+pid['monitor2']['idsize'] = 1024
+pid['monitor3']['idstart'] = 9110001
+pid['monitor3']['idsize'] = 1024
+
 
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -47,80 +54,100 @@
         self.data = self.server.get(self.path)
 
+
 def App(in_module='', in_redisip='', in_cron=1):
 
     m_modulename = in_module
-    m_redisip    = in_redisip
-    m_cron       = in_cron#15
+    m_redisip = in_redisip
+    m_cron = in_cron  # 15
 
     factor = 1  # 1us to 1us
-    m_tofstart= 0*factor
-    m_tofstep = 16*factor
+    m_tofstart = 0 * factor
+    m_tofstep = 16 * factor
     m_tofbins = 2500
 
-    path  = '/GPPD/workspace/'+m_modulename
+    path = '/GPPD/workspace/' + m_modulename
 
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
-    #r.set(path+"/tof", json.dumps(toflist))
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, \
-                    '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', \
-                                    hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    # r.set(path+"/tof", json.dumps(toflist))
+
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = pid['m_modulename']['idstart']
-    idsize  = pid['m_modulename']['idsize']
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = pid['m_modulename']['idsize']
+    pidlist = [i + idstart for i in xrange(idsize)]
 
-    #print pidlist
+    # print pidlist
+
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
 
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("SANSDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("EpicsInputSvc/DataInputSvc")
-    iSvc = task.find("DataInputSvc")
-    iSvc.property("Channel").set("gppd:"+m_modulename)
+    task.property('svcs').append('SANSDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('EpicsInputSvc/DataInputSvc')
+    iSvc = task.find('DataInputSvc')
+    iSvc.property('Channel').set('gppd:' + m_modulename)
 
     import Algorithms
-    task.property("algs").append("RunningInfAlg")
-    task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
+    task.property('algs').append('RunningInfAlg')
+    task.property('algs').append('DumpAlg')
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
 
     iSvc.show()
@@ -131,4 +158,5 @@
 
 
-if __name__ == "__main__":
-    App(in_module='monitor3', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+if __name__ == '__main__':
+    App(in_module='monitor3', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/script.py
===================================================================
--- drone/script.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/script.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,3 +1,5 @@
-GPPDgroup=[]
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+GPPDgroup = []
 GPPDgroup.append('module521')
 GPPDgroup.append('module522')
@@ -9,5 +11,4 @@
 GPPDgroup.append('module542')
 GPPDgroup.append('module543')
-
 
 GPPDgroup.append('module621')
@@ -42,5 +43,5 @@
 GPPDgroup.append('module443')
 
-GPPDgroup4=[]
+GPPDgroup4 = []
 GPPDgroup4.append('monitor1')
 GPPDgroup4.append('monitor2')
@@ -50,37 +51,38 @@
 
 for i in range(len(GPPDgroup)):
-    _cmd="cp template_module.py "+GPPDgroup[i]+".py"
+    _cmd = 'cp template_module.py ' + GPPDgroup[i] + '.py'
     subprocess.Popen(_cmd, shell=True)
-    _cmd="sed -i 's/template/"+GPPDgroup[i]+"/' "+GPPDgroup[i]+".py"
+    _cmd = "sed -i 's/template/" + GPPDgroup[i] + "/' " + GPPDgroup[i] \
+        + '.py'
     subprocess.Popen(_cmd, shell=True)
     print _cmd
-    _cmd="chmod +x "+GPPDgroup[i]+".py"
+    _cmd = 'chmod +x ' + GPPDgroup[i] + '.py'
     subprocess.Popen(_cmd, shell=True)
 
 for i in range(len(GPPDgroup)):
-    _cmd="cp template_exec "+GPPDgroup[i]
+    _cmd = 'cp template_exec ' + GPPDgroup[i]
     subprocess.Popen(_cmd, shell=True)
-    _cmd="sed -i 's/template/"+GPPDgroup[i]+"/' "+GPPDgroup[i]
+    _cmd = "sed -i 's/template/" + GPPDgroup[i] + "/' " + GPPDgroup[i]
     subprocess.Popen(_cmd, shell=True)
     print _cmd
-    _cmd="chmod +x "+GPPDgroup[i]
-    subprocess.Popen(_cmd, shell=True)
-
-
-for i in range(len(GPPDgroup4)):
-    _cmd="cp template_monitor.py "+GPPDgroup4[i]+".py"
-    subprocess.Popen(_cmd, shell=True)
-    _cmd="sed -i 's/template/"+GPPDgroup4[i]+"/' "+GPPDgroup4[i]+".py"
-    subprocess.Popen(_cmd, shell=True)
-    print _cmd
-    _cmd="chmod +x "+GPPDgroup4[i]+".py"
+    _cmd = 'chmod +x ' + GPPDgroup[i]
     subprocess.Popen(_cmd, shell=True)
 
 for i in range(len(GPPDgroup4)):
-    _cmd="cp template_exec "+GPPDgroup4[i]
+    _cmd = 'cp template_monitor.py ' + GPPDgroup4[i] + '.py'
     subprocess.Popen(_cmd, shell=True)
-    _cmd="sed -i 's/template/"+GPPDgroup4[i]+"/' "+GPPDgroup4[i]
+    _cmd = "sed -i 's/template/" + GPPDgroup4[i] + "/' " \
+        + GPPDgroup4[i] + '.py'
     subprocess.Popen(_cmd, shell=True)
     print _cmd
-    _cmd="chmod +x "+GPPDgroup4[i]
+    _cmd = 'chmod +x ' + GPPDgroup4[i] + '.py'
     subprocess.Popen(_cmd, shell=True)
+
+for i in range(len(GPPDgroup4)):
+    _cmd = 'cp template_exec ' + GPPDgroup4[i]
+    subprocess.Popen(_cmd, shell=True)
+    _cmd = "sed -i 's/template/" + GPPDgroup4[i] + "/' " + GPPDgroup4[i]
+    subprocess.Popen(_cmd, shell=True)
+    print _cmd
+    _cmd = 'chmod +x ' + GPPDgroup4[i]
+    subprocess.Popen(_cmd, shell=True)
Index: drone/template_module.py
===================================================================
--- drone/template_module.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/template_module.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,14 +1,16 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
 
-#import Sniper
+# import Sniper
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import redis
@@ -17,11 +19,16 @@
 import NEON
 
+
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -40,79 +47,101 @@
 def App(in_module='', in_redisip='', in_cron=1):
 
-    m_modulename = in_module#'module131'
-    m_redisip   = in_redisip#'10.1.33.141'
-    m_cron       = in_cron#15
+    m_modulename = in_module  # 'module131'
+    m_redisip = in_redisip  # '10.1.33.141'
+    m_cron = in_cron  # 15
 
     from xml.etree import ElementTree as ET
     root = ET.parse('configure.xml')
-    tof  = root.find('tofInformation')
+    tof = root.find('tofInformation')
     factor = 40  # 25ns to 1us
-    m_tofstart= int(tof.attrib['tofstart'])*factor
-    m_tofstep = int(tof.attrib['tofstep'])*factor 
+    m_tofstart = int(tof.attrib['tofstart']) * factor
+    m_tofstep = int(tof.attrib['tofstep']) * factor
     m_tofbins = int(tof.attrib['tofbin'])
 
     for item in root.findall('type/component'):
-      if m_modulename== item.attrib['name']:
-        m_moduleinfo = item.attrib
-        
-    path  = '/GPPD/workspace/detector/'+m_modulename
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+        if m_modulename == item.attrib['name']:
+            m_moduleinfo = item.attrib
+
+    path = '/GPPD/workspace/detector/' + m_modulename
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = int(m_moduleinfo['idstart'])
-    idsize  = int(m_moduleinfo['pixels'])
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = int(m_moduleinfo['pixels'])
+    pidlist = [i + idstart for i in xrange(idsize)]
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
-    
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("GPPDDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("RawDataInputSvc/DataInputSvc")
-    #task.property("svcs").append("FileInputSvc/DataProvideSvc")
-    task.property("svcs").append("DimRecvSvc/DataProvideSvc")
-    iDat = task.find("DataSvc")
-    iSvc = task.find("DataInputSvc")
-    iPvd = task.find("DataProvideSvc")
+    task.property('svcs').append('GPPDDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('RawDataInputSvc/DataInputSvc')
 
-    iPvd.property("DataSize").set(1000000)
-    dimsrvname = "dimserver"+m_moduleinfo['server']+"/TEST_SWAP_"+m_moduleinfo['num']
-    iPvd.property("DimServerName").set(dimsrvname)
-    iSvc.property("BuffSize").set(1000000)
+    # task.property("svcs").append("FileInputSvc/DataProvideSvc")
+
+    task.property('svcs').append('DimRecvSvc/DataProvideSvc')
+    iDat = task.find('DataSvc')
+    iSvc = task.find('DataInputSvc')
+    iPvd = task.find('DataProvideSvc')
+
+    iPvd.property('DataSize').set(1000000)
+    dimsrvname = 'dimserver' + m_moduleinfo['server'] + '/TEST_SWAP_' \
+        + m_moduleinfo['num']
+    iPvd.property('DimServerName').set(dimsrvname)
+    iSvc.property('BuffSize').set(1000000)
 
     iSvc.show()
@@ -120,19 +149,24 @@
 
     import Algorithms
-    task.property("algs").append("GPPDSNDRecAlg")
-    task.property("algs").append("GPPDSNDMapAlg")
-    task.property("algs").append("RunningInfAlg")
-    #task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
-    iMap = task.find("GPPDSNDMapAlg")
-    iMap.property("ConfigFileName").set("configure.xml")
+    task.property('algs').append('GPPDSNDRecAlg')
+    task.property('algs').append('GPPDSNDMapAlg')
+    task.property('algs').append('RunningInfAlg')
 
-    #    
+    # task.property("algs").append("DumpAlg")
+
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
+    iMap = task.find('GPPDSNDMapAlg')
+    iMap.property('ConfigFileName').set('configure.xml')
+
+    #
+
     task.setEvtMax(-1)
     task.run()
 
-if __name__ == "__main__":
-    App(in_module='template', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+
+if __name__ == '__main__':
+    App(in_module='template', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: drone/template_monitor.py
===================================================================
--- drone/template_monitor.py	(revision 344828aa42a05b00d5e8bc6324599ed5745527b7)
+++ drone/template_monitor.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,12 +1,14 @@
-#!/usr/bin/env python
-# -*- coding:utf-8 -*-
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
 # author: H.L. TIAN 2017
+
 import DroNECore
-import DroNECore.PyIncident       as PI
+import DroNECore.PyIncident as PI
 import CtrlSvc.PushMatrixIncident as PMI
-import CtrlSvc.PushHistIncident   as PHI
-import CtrlSvc.HeartBeatIncident  as HBI
-import CtrlSvc.NeonRPCIncident    as NRI
-import CtrlSvc.NeonRPCTask        as NRT
+import CtrlSvc.PushHistIncident as PHI
+import CtrlSvc.HeartBeatIncident as HBI
+import CtrlSvc.NeonRPCIncident as NRI
+import CtrlSvc.NeonRPCTask as NRT
 import CtrlSvc.NeonUpdateDataTask as NUT
 import NEON
@@ -16,22 +18,27 @@
 import os
 
-pid={}
-pid['monitor1']={}
-pid['monitor2']={}
-pid['monitor3']={}
-pid['monitor1']['idstart']=7110001
-pid['monitor1']['idsize']=1024
-pid['monitor2']['idstart']=8110001
-pid['monitor2']['idsize']=1024
-pid['monitor3']['idstart']=9110001
-pid['monitor3']['idsize']=1024
+pid = {}
+pid['monitor1'] = {}
+pid['monitor2'] = {}
+pid['monitor3'] = {}
+pid['monitor1']['idstart'] = 7110001
+pid['monitor1']['idsize'] = 1024
+pid['monitor2']['idstart'] = 8110001
+pid['monitor2']['idsize'] = 1024
+pid['monitor3']['idstart'] = 9110001
+pid['monitor3']['idsize'] = 1024
+
 
 class RedisRemoteData:
+
     def __init__(self, ip, path):
-        #import redis
+
+        # import redis
+
         from redis.sentinel import Sentinel
-        sentinel=Sentinel(ip, socket_timeout=0.1)
-        self.server = sentinel.master_for('neonmaster', socket_timeout=200, password='sanlie;123', db=0)
-        self.path   = path
+        sentinel = Sentinel(ip, socket_timeout=0.1)
+        self.server = sentinel.master_for('neonmaster',
+                socket_timeout=200, password='sanlie;123', db=0)
+        self.path = path
 
     def setData(self, data):
@@ -47,80 +54,100 @@
         self.data = self.server.get(self.path)
 
+
 def App(in_module='', in_redisip='', in_cron=1):
 
     m_modulename = in_module
-    m_redisip    = in_redisip
-    m_cron       = in_cron#15
+    m_redisip = in_redisip
+    m_cron = in_cron  # 15
 
     factor = 1  # 1us to 1us
-    m_tofstart= 0*factor
-    m_tofstep = 16*factor
+    m_tofstart = 0 * factor
+    m_tofstep = 16 * factor
     m_tofbins = 2500
 
-    path  = '/GPPD/workspace/'+m_modulename
+    path = '/GPPD/workspace/' + m_modulename
 
-    m_taskMatrix = RedisRemoteData(m_redisip, path+"/value")
-    m_taskTOF    = RedisRemoteData(m_redisip, path+"/tof")
-    m_taskPID    = RedisRemoteData(m_redisip, path+"/pid")
-    toflist = [m_tofstep+i*m_tofstep for i in xrange(m_tofbins+1)]
+    m_taskMatrix = RedisRemoteData(m_redisip, path + '/value')
+    m_taskTOF = RedisRemoteData(m_redisip, path + '/tof')
+    m_taskPID = RedisRemoteData(m_redisip, path + '/pid')
+    toflist = [m_tofstep + i * m_tofstep for i in xrange(m_tofbins + 1)]
     m_taskTOF.setData(json.dumps(toflist))
     m_taskTOF.dump()
-    #r.set(path+"/tof", json.dumps(toflist))
 
-    m_taskheartbeat = RedisRemoteData(m_redisip, \
-                    '/GPPD/heartbeat/detector/'+m_modulename)
-    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring', \
-                                    hit = 0, event = 0, pulse = 0, idx = os.getpid()))
+    # r.set(path+"/tof", json.dumps(toflist))
+
+    m_taskheartbeat = RedisRemoteData(m_redisip,
+            '/GPPD/heartbeat/detector/' + m_modulename)
+    m_taskheartbeat.setData(HBI.HeartBeatCronIncident.encodeHeartBeat(status='configuring'
+                            , hit=0, event=0, pulse=0, idx=os.getpid()))
     m_taskheartbeat.dump()
 
     idstart = pid['m_modulename']['idstart']
-    idsize  = pid['m_modulename']['idsize']
-    pidlist = [i+idstart for i in xrange(idsize)]
+    idsize = pid['m_modulename']['idsize']
+    pidlist = [i + idstart for i in xrange(idsize)]
 
-    #print pidlist
+    # print pidlist
+
     m_taskPID.setData(json.dumps(pidlist))
     m_taskPID.dump()
 
-    m_configure = {"pidstart":idstart,"pidsize":idsize}
-    task = DroNECore.DroNEOnline("task")
+    m_configure = {'pidstart': idstart, 'pidsize': idsize}
+    task = DroNECore.DroNEOnline('task')
     task.asTop()
     task.setLogLevel(2)
 
-    #===============
-    m_neonRedis = NEON.Neon.NeonRedisSentinel(m_redisip, i_socket_timeout=0.1, \
-                                           master_name='neonmaster', master_timeout = 200, master_password='sanlie;123', \
-                                           idb = 0, isWritable = True) # server mode, set msgs to Redis
-    servpob = NEON.Neon.NeonService.POBox(m_neonRedis, '/GPPD/process/detector', 'server:'+m_modulename)
-    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = servpob, recvPOBox = servpob, isServer=True)
-    nr = NRT.NeonRPCTask("NeonRPC", servrpc, remotedata = m_taskheartbeat)
+    # ===============
+
+    m_neonRedis = NEON.Neon.NeonRedisSentinel(  # server mode, set msgs to Redis
+        m_redisip,
+        i_socket_timeout=0.1,
+        master_name='neonmaster',
+        master_timeout=200,
+        master_password='sanlie;123',
+        idb=0,
+        isWritable=True,
+        )
+    servpob = NEON.Neon.NeonService.POBox(m_neonRedis,
+            '/GPPD/process/detector', 'server:' + m_modulename)
+    servrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=servpob,
+            recvPOBox=servpob, isServer=True)
+    nr = NRT.NeonRPCTask('NeonRPC', servrpc, remotedata=m_taskheartbeat)
 
     import CtrlSvc
-    ct = DroNECore.CtrlTask("ctrl")
-    pi = PMI.PushMatrixCronIncident("PushMatrix", cron = m_cron, \
-                                    repeatable = True, remotedata = m_taskMatrix,\
-                                    configure = m_configure)
-    hi = HBI.HeartBeatCronIncident("HeartBeat", cron = 2, repeatable = True, remotedata = m_taskheartbeat)
-    ni = NRI.NeonRPCCronIncident("NeonRPC", cron = 1, repeatable = True)
+    ct = DroNECore.CtrlTask('ctrl')
+    pi = PMI.PushMatrixCronIncident('PushMatrix', cron=m_cron,
+                                    repeatable=True,
+                                    remotedata=m_taskMatrix,
+                                    configure=m_configure)
+    hi = HBI.HeartBeatCronIncident('HeartBeat', cron=2,
+                                   repeatable=True,
+                                   remotedata=m_taskheartbeat)
+    ni = NRI.NeonRPCCronIncident('NeonRPC', cron=1, repeatable=True)
     ct.add(hi)
     ct.add(ni)
     ct.add(pi)
-    ## ===========================
-    nu = NUT.NeonUpdateDataTask("UpdateRemoteData", remotedata = m_taskMatrix, configure=m_configure)
-    ## ===========================
+
+    # # ===========================
+
+    nu = NUT.NeonUpdateDataTask('UpdateRemoteData',
+                                remotedata=m_taskMatrix,
+                                configure=m_configure)
+
+    # # ===========================
 
     import DataSvc
-    task.property("svcs").append("SANSDataSvc/DataSvc")
-    task.property("svcs").append("CtrlSvc")
-    task.property("svcs").append("EpicsInputSvc/DataInputSvc")
-    iSvc = task.find("DataInputSvc")
-    iSvc.property("Channel").set("gppd:"+m_modulename)
+    task.property('svcs').append('SANSDataSvc/DataSvc')
+    task.property('svcs').append('CtrlSvc')
+    task.property('svcs').append('EpicsInputSvc/DataInputSvc')
+    iSvc = task.find('DataInputSvc')
+    iSvc.property('Channel').set('gppd:' + m_modulename)
 
     import Algorithms
-    task.property("algs").append("RunningInfAlg")
-    task.property("algs").append("DumpAlg")
-    iRun = task.find("RunningInfAlg")
-    iRun.property("TofStart").set(m_tofstart)
-    iRun.property("TofBins").set(m_tofbins)
-    iRun.property("TofStep").set(m_tofstep)
+    task.property('algs').append('RunningInfAlg')
+    task.property('algs').append('DumpAlg')
+    iRun = task.find('RunningInfAlg')
+    iRun.property('TofStart').set(m_tofstart)
+    iRun.property('TofBins').set(m_tofbins)
+    iRun.property('TofStep').set(m_tofstep)
 
     iSvc.show()
@@ -131,4 +158,5 @@
 
 
-if __name__ == "__main__":
-    App(in_module='template', in_redisip=[('10.1.33.141', 9001)], in_cron=10)
+if __name__ == '__main__':
+    App(in_module='template', in_redisip=[('10.1.33.141', 9001)],
+        in_cron=10)
Index: main.py
===================================================================
--- main.py	(revision 01445ecc4506e14ea22389344bc7a26f9f4b8ab3)
+++ main.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,3 +1,4 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 import sys
@@ -18,6 +19,6 @@
 from logging.handlers import RotatingFileHandler
 logger = logging.getLogger('GPPDcockpit')
-hdlr = RotatingFileHandler(os.getcwd() + '/GPPDcockpit.log', maxBytes=100
-                           * 1024 * 1024, backupCount=1)
+hdlr = RotatingFileHandler(os.getcwd() + '/GPPDcockpit.log',
+                           maxBytes=100 * 1024 * 1024, backupCount=1)
 formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
 hdlr.setFormatter(formatter)
@@ -25,5 +26,5 @@
 logger.setLevel(logging.DEBUG)
 
-GPPDgroup1=[]
+GPPDgroup1 = []
 GPPDgroup1.append('module521')
 GPPDgroup1.append('module522')
@@ -36,5 +37,5 @@
 GPPDgroup1.append('module543')
 
-GPPDgroup2=[]
+GPPDgroup2 = []
 GPPDgroup2.append('module621')
 GPPDgroup2.append('module622')
@@ -47,5 +48,5 @@
 GPPDgroup2.append('module643')
 
-GPPDgroup3=[]
+GPPDgroup3 = []
 GPPDgroup3.append('module131')
 GPPDgroup3.append('module132')
@@ -69,14 +70,18 @@
 GPPDgroup3.append('module443')
 
-GPPDgroup4=[]
+GPPDgroup4 = []
 GPPDgroup4.append('monitor1')
 GPPDgroup4.append('monitor2')
 GPPDgroup4.append('monitor3')
 
-GPPDdrone=[]
-for _g in GPPDgroup1: GPPDdrone.append(_g)
-for _g in GPPDgroup2: GPPDdrone.append(_g)
-for _g in GPPDgroup3: GPPDdrone.append(_g)
-for _g in GPPDgroup4: GPPDdrone.append(_g)
+GPPDdrone = []
+for _g in GPPDgroup1:
+    GPPDdrone.append(_g)
+for _g in GPPDgroup2:
+    GPPDdrone.append(_g)
+for _g in GPPDgroup3:
+    GPPDdrone.append(_g)
+for _g in GPPDgroup4:
+    GPPDdrone.append(_g)
 webInfo = {}
 _group = ['pilot', 'mantid']
@@ -107,58 +112,66 @@
     webInfo[_g]['level'] = '---'
 
-droneInfo=[]
-_n=-1
+droneInfo = []
+_n = -1
 
 # left backward
+
 for i in range(len(GPPDgroup1)):
-    _n+=1
+    _n += 1
     droneInfo.append({})
-    droneInfo[_n]['host']='10.1.33.144'
-    droneInfo[_n]['module']=GPPDgroup1[i]
-    droneInfo[_n]['pid']='---'
-    droneInfo[_n]['pobox']='---'
-    droneInfo[_n]['rpc']='---'
+    droneInfo[_n]['host'] = '10.1.33.144'
+    droneInfo[_n]['module'] = GPPDgroup1[i]
+    droneInfo[_n]['pid'] = '---'
+    droneInfo[_n]['pobox'] = '---'
+    droneInfo[_n]['rpc'] = '---'
     droneInfo[_n]['state'] = 'waiting'
     droneInfo[_n]['timestamp'] = '---'
-    droneInfo[_n]['heartbeat']='/GPPD/heartbeat/detector/'+GPPDgroup1[i]
+    droneInfo[_n]['heartbeat'] = '/GPPD/heartbeat/detector/' \
+        + GPPDgroup1[i]
 
 # right backward
+
 for i in range(len(GPPDgroup2)):
-    _n+=1
+    _n += 1
     droneInfo.append({})
-    droneInfo[_n]['host']='10.1.33.144'
-    droneInfo[_n]['module']=GPPDgroup2[i]
-    droneInfo[_n]['pid']='---'
-    droneInfo[_n]['pobox']='---'
-    droneInfo[_n]['rpc']='---'
-    droneInfo[_n]['state'] = 'waiting'
-    droneInfo[_n]['timestamp'] = '---'    
-    droneInfo[_n]['heartbeat']='/GPPD/heartbeat/detector/'+GPPDgroup2[i]
-
-#small angle
-for i in range(len(GPPDgroup3)):
-    _n+=1
-    droneInfo.append({})
-    droneInfo[_n]['host']='10.1.33.144'
-    droneInfo[_n]['module']=GPPDgroup3[i]
-    droneInfo[_n]['pid']='---'
-    droneInfo[_n]['pobox']='---'
-    droneInfo[_n]['rpc']='---'
+    droneInfo[_n]['host'] = '10.1.33.144'
+    droneInfo[_n]['module'] = GPPDgroup2[i]
+    droneInfo[_n]['pid'] = '---'
+    droneInfo[_n]['pobox'] = '---'
+    droneInfo[_n]['rpc'] = '---'
     droneInfo[_n]['state'] = 'waiting'
     droneInfo[_n]['timestamp'] = '---'
-    droneInfo[_n]['heartbeat']='/GPPD/heartbeat/detector/'+GPPDgroup3[i]
-
-#monitor
-for i in range(len(GPPDgroup4)):
-    _n+=1
+    droneInfo[_n]['heartbeat'] = '/GPPD/heartbeat/detector/' \
+        + GPPDgroup2[i]
+
+# small angle
+
+for i in range(len(GPPDgroup3)):
+    _n += 1
     droneInfo.append({})
-    droneInfo[_n]['host']='10.1.33.144'
-    droneInfo[_n]['module']=GPPDgroup4[i]
-    droneInfo[_n]['pid']='---'
-    droneInfo[_n]['pobox']='---'
-    droneInfo[_n]['rpc']='---'
+    droneInfo[_n]['host'] = '10.1.33.144'
+    droneInfo[_n]['module'] = GPPDgroup3[i]
+    droneInfo[_n]['pid'] = '---'
+    droneInfo[_n]['pobox'] = '---'
+    droneInfo[_n]['rpc'] = '---'
     droneInfo[_n]['state'] = 'waiting'
     droneInfo[_n]['timestamp'] = '---'
-    droneInfo[_n]['heartbeat']='/GPPD/heartbeat/detector/'+GPPDgroup4[i]
+    droneInfo[_n]['heartbeat'] = '/GPPD/heartbeat/detector/' \
+        + GPPDgroup3[i]
+
+# monitor
+
+for i in range(len(GPPDgroup4)):
+    _n += 1
+    droneInfo.append({})
+    droneInfo[_n]['host'] = '10.1.33.144'
+    droneInfo[_n]['module'] = GPPDgroup4[i]
+    droneInfo[_n]['pid'] = '---'
+    droneInfo[_n]['pobox'] = '---'
+    droneInfo[_n]['rpc'] = '---'
+    droneInfo[_n]['state'] = 'waiting'
+    droneInfo[_n]['timestamp'] = '---'
+    droneInfo[_n]['heartbeat'] = '/GPPD/heartbeat/detector/' \
+        + GPPDgroup4[i]
 
 for i in range(len(droneInfo)):
@@ -173,5 +186,4 @@
     webInfo[_g]['level'] = '---'
 
-
 fh = 0
 
@@ -193,29 +205,31 @@
     # _cmd="ps -ef | grep "+myname+" | grep -v grep | awk '{print $2}'"
 
-    pid1=[]
-    pid2=[]
-
-    _s=False
+    pid1 = []
+    pid2 = []
+
+    _s = False
     try:
         _cmd = 'ps -C ' + myname + ' -o pid='
         pid1 = subprocess.check_output(_cmd, shell=True)
         pid1 = shlex.split(pid1)
-        _s=True
+        _s = True
     except:
-        pid1=[]
+        pid1 = []
 
     if not _s:
         try:
-            _tmp="\"python "+myname+"\""
-            _cmd = "ps -C " + _tmp + " -o pid="
+            _tmp = '"python ' + myname + '"'
+            _cmd = 'ps -C ' + _tmp + ' -o pid='
             pid2 = subprocess.check_output(_cmd, shell=True)
             pid2 = shlex.split(pid2)
         except:
-            pid2=[]
-    
-    pid=[]
-    for p in pid1:pid.append(p)
-    for p in pid2:pid.append(p)
-    
+            pid2 = []
+
+    pid = []
+    for p in pid1:
+        pid.append(p)
+    for p in pid2:
+        pid.append(p)
+
     for p in pid:
         if p != mypid:
@@ -266,4 +280,5 @@
     return time.strftime('%Y-%m-%d %H:%M:%S')
 
+
 class startRedisServer:
 
@@ -298,7 +313,8 @@
         return PID
 
-class getRedisServer():
-
-   def __init__(
+
+class getRedisServer:
+
+    def __init__(
         self,
         ip,
@@ -309,36 +325,42 @@
         from redis.sentinel import Sentinel
 
-        self.status=False
-        self.redisWrite=None
-        self.redisRead=None
-        begin=time.time()
+        self.status = False
+        self.redisWrite = None
+        self.redisRead = None
+        begin = time.time()
         while True:
             if self.redisWrite is None:
-                #self.server = redis.Redis(host=ip, port=port, password=passwd, db=0, socket_connect_timeout=1.0)
+
+                # self.server = redis.Redis(host=ip, port=port, password=passwd, db=0, socket_connect_timeout=1.0)
+
                 sentinel = Sentinel(ip, socket_timeout=0.1)
                 try:
-                    self.redisWrite=sentinel.master_for('neonmaster', socket_timeout=30, password=passwd)
-                    self.redisRead=sentinel.slave_for('neonmaster', socket_timeout=30, password=passwd)
-                except (redis.exceptions.ConnectionError):
-                    logger.error("Redis exception")
+                    self.redisWrite = sentinel.master_for('neonmaster',
+                            socket_timeout=30, password=passwd)
+                    self.redisRead = sentinel.slave_for('neonmaster',
+                            socket_timeout=30, password=passwd)
+                except redis.exceptions.ConnectionError:
+                    logger.error('Redis exception')
                 if self.redisWrite is not None:
-                    if self.redisRead is None: self.redisRead=self.redisWrite
+                    if self.redisRead is None:
+                        self.redisRead = self.redisWrite
                     self.status = True
-                    logger.info("Redis connected")
+                    logger.info('Redis connected')
                     break
                 else:
-                    logger.error("Redis falied")
-                if time.time()-begin>timeout:
-                    logger.warning("Reids timeout")
+                    logger.error('Redis falied')
+                if time.time() - begin > timeout:
+                    logger.warning('Reids timeout')
                     break
 
-   def getStatus(self):
+    def getStatus(self):
         return self.status
 
-   def getRedisWrite(self):
+    def getRedisWrite(self):
         return self.redisWrite
 
-   def getRedisRead(self):
+    def getRedisRead(self):
         return self.redisRead
+
 
 class getEpicsServer:
@@ -363,33 +385,47 @@
         return self.status
 
-class getDroneServer():
+
+class getDroneServer:
+
     def __init__(self):
-        ip=[('10.1.33.141', 9001)]
+        ip = [('10.1.33.141', 9001)]
 
         self.nModule = len(droneInfo)
 
-        self.m_neonRedis = NEON.Neon.NeonRedisSentinel(ip, i_socket_timeout=0.5, master_name='neonmaster', master_timeout = 60, master_password='sanlie;123', isWritable = True)
-       
+        self.m_neonRedis = NEON.Neon.NeonRedisSentinel(
+            ip,
+            i_socket_timeout=0.5,
+            master_name='neonmaster',
+            master_timeout=60,
+            master_password='sanlie;123',
+            isWritable=True,
+            )
+
         self.createAll()
 
     def create(self, n):
-        clitpob= NEON.Neon.NeonService.POBox(self.m_neonRedis, '/GPPD/process/detector', 'client:'+droneInfo[n]['module'])
-        clitrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox = clitpob, recvPOBox = clitpob)
-        droneInfo[n]['pobox']=clitrpc
-        droneInfo[n]['rpc']='server:'+droneInfo[n]['module']
-        _pid=self.getPid(n)
+        clitpob = NEON.Neon.NeonService.POBox(self.m_neonRedis,
+                '/GPPD/process/detector', 'client:'
+                + droneInfo[n]['module'])
+        clitrpc = NEON.Neon.NeonService.NeonRPC(sendPOBox=clitpob,
+                recvPOBox=clitpob)
+        droneInfo[n]['pobox'] = clitrpc
+        droneInfo[n]['rpc'] = 'server:' + droneInfo[n]['module']
+        _pid = self.getPid(n)
 
         if _pid == -1:
             for i in range(5):
-                _cmd="ssh drone@"+droneInfo[n]['host']+" cd /home/drone/workspace/drone/ && ./"+droneInfo[n]['module']
+                _cmd = 'ssh drone@' + droneInfo[n]['host'] \
+                    + ' cd /home/drone/workspace/drone/ && ./' \
+                    + droneInfo[n]['module']
                 _cmd = shlex.split(_cmd)
                 subprocess.Popen(_cmd, shell=False)
                 time.sleep(1.0)
-                _pid=self.getPid(n)
-                if _pid !=-1:
-                    droneInfo[n]['pid']=str(_pid)
+                _pid = self.getPid(n)
+                if _pid != -1:
+                    droneInfo[n]['pid'] = str(_pid)
                     break
         else:
-            droneInfo[n]['pid']=str(_pid)
+            droneInfo[n]['pid'] = str(_pid)
 
         webInfo[droneInfo[n]['module']]['pid'] = str(droneInfo[n]['pid'
@@ -422,9 +458,11 @@
 
     def getPid(self, n):
-        _cmd="ssh drone@"+droneInfo[n]['host']+" ps -ef | grep "+droneInfo[n]['module']+".py | awk '{print $2}' | head -1"
+        _cmd = 'ssh drone@' + droneInfo[n]['host'] + ' ps -ef | grep ' \
+            + droneInfo[n]['module'] \
+            + ".py | awk '{print $2}' | head -1"
         print _cmd
-        pid=subprocess.check_output(_cmd, shell=True)
-        if pid!='':
-            pid=int(pid)
+        pid = subprocess.check_output(_cmd, shell=True)
+        if pid != '':
+            pid = int(pid)
         else:
             pid = -1
@@ -514,8 +552,10 @@
         self.killAll()
 
+
 class RPCMethods(NEON.Neon.NeonService.NeonRPC.MethodCall):
 
     def setDroneStatus(self, params):
         return True
+
 
 class setGlassfish(threading.Thread):
@@ -623,21 +663,20 @@
                 self.getDroneStatus(i)
 
-            self.redisServer.set('/GPPD/cockpit/web', json.dumps(webInfo))
+            self.redisServer.set('/GPPD/cockpit/web',
+                                 json.dumps(webInfo))
             time.sleep(self.refreshtime)
 
+
 class setHeartbeat(threading.Thread):
 
-    def __init__(
-        self,
-        refreshtime,
-        ):
+    def __init__(self, refreshtime):
+
         threading.Thread.__init__(self)
-        pvHeart = "EXP_IB1_RM:soft:analyse_hb"
-        self.pvname=epics.PV(pvHeart)
-        self.refreshtime=refreshtime
-
+        pvHeart = 'EXP_IB1_RM:soft:analyse_hb'
+        self.pvname = epics.PV(pvHeart)
+        self.refreshtime = refreshtime
 
     def setStatus(self, _status):
-        self.status=_status
+        self.status = _status
 
     def getStatus(self):
@@ -655,18 +694,17 @@
             time.sleep(self.refreshtime)
 
+
 class setStatus(threading.Thread):
 
-    def __init__(
-        self,
-        refreshtime,
-        ):
+    def __init__(self, refreshtime):
+
         threading.Thread.__init__(self)
 
-        self.status='WAITING'
+        self.status = 'WAITING'
         self.pvname = epics.PV('EXP_IB1_RM:soft:analyse_hb')
-        self.refreshtime=refreshtime
+        self.refreshtime = refreshtime
 
     def setStatus(self, _status):
-        self.status=_status
+        self.status = _status
 
     def getStatus(self):
@@ -681,5 +719,7 @@
             time.sleep(self.refreshtime)
 
+
 class main(threading.Thread):
+
     def __init__(self, redisServer, droneServer):
         threading.Thread.__init__(self)
@@ -690,5 +730,5 @@
         self.droneServer = droneServer
 
-        self.pvCommand=epics.PV('EXP_IB1_GP:soft:cmd')
+        self.pvCommand = epics.PV('EXP_IB1_GP:soft:cmd')
         self.pvStatus = epics.PV('EXP_IB1_GP:soft:online_stat')
 
@@ -696,18 +736,35 @@
         self.pvUserId = epics.PV('EXP_IB1_GP:soft:user_id')
         self.pvProposalId = epics.PV('EXP_IB1_GP:soft:proposal_id')
-        
-        self.GPPDstatusList=['INITIALIZED', 'READY', 'RUNNING']
-        self.GPPDcommandList=["CONF", "START", "STOP", "EXIT", "CANCEL"]
-        self.MYstatusList=["waiting", "unconfigured", "configuring", "ready", "running", "paused", "error"]
-        self.MYcommandList=["configure", "unconfigure", "start", "pause", "resume", "stop", "abort"]
-
-        self.mantidHeartBeat='/GPPD/heartbeat/mantid'
-        self.pilotHeartBeat='/GPPD/heartbeat/pilot'
+
+        self.GPPDstatusList = ['INITIALIZED', 'READY', 'RUNNING']
+        self.GPPDcommandList = ['CONF', 'START', 'STOP', 'EXIT',
+                                'CANCEL']
+        self.MYstatusList = [
+            'waiting',
+            'unconfigured',
+            'configuring',
+            'ready',
+            'running',
+            'paused',
+            'error',
+            ]
+        self.MYcommandList = [
+            'configure',
+            'unconfigure',
+            'start',
+            'pause',
+            'resume',
+            'stop',
+            'abort',
+            ]
+
+        self.mantidHeartBeat = '/GPPD/heartbeat/mantid'
+        self.pilotHeartBeat = '/GPPD/heartbeat/pilot'
 
         self.iRetry = 20
         self.lastTimeStamp = '---'
         self.lastCmd = -1
-        self.endType="time"
-        self.myState="unconfigured"
+        self.endType = 'time'
+        self.myState = 'unconfigured'
 
         self.setInitial()
@@ -716,5 +773,5 @@
         self.resetProtonChargeList()
         self.resetMonitorCountList()
-        self.resetDetectorCountList()    
+        self.resetDetectorCountList()
 
         try:
@@ -730,5 +787,5 @@
                     logger.error('mantid abort failed')
                     self.setEpicsState('ERROR')
-                    self.myState="error"
+                    self.myState = 'error'
                     self.stop.set()
             if int(self.getPilotStatus()[0]) != 1:
@@ -737,9 +794,9 @@
                     logger.error('pilot abort failed')
                     self.setEpicsState('ERROR')
-                    self.myState="error"
+                    self.myState = 'error'
                     self.stop.set()
 
             self.setEpicsState('INITIALIZED')
-            self.myState="unconfigured"
+            self.myState = 'unconfigured'
         elif _pvState == 'READY':
 
@@ -755,5 +812,5 @@
                         logger.error('mantid configure failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
                 else:
@@ -764,5 +821,5 @@
                         logger.error('mantid abort failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -774,5 +831,5 @@
                         logger.error('mantid configure failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -789,5 +846,5 @@
                         logger.error('pilot configure failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
                 else:
@@ -798,5 +855,5 @@
                         logger.error('pilot abort failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -808,9 +865,9 @@
                         logger.error('pilot configure failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
             self.setEpicsState('READY')
-            self.myState="ready"
+            self.myState = 'ready'
         elif _pvState == 'RUNNING':
             _r = self.getMantidStatus()
@@ -823,5 +880,5 @@
                         logger.error('mantid start failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
                 else:
@@ -831,5 +888,5 @@
                         logger.error('mantid abort failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -841,5 +898,5 @@
                         logger.error('mantid configure failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -849,5 +906,5 @@
                         logger.error('mantid start failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -861,5 +918,5 @@
                         logger.error('pilot start failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
                 else:
@@ -869,5 +926,5 @@
                         logger.error('pilot abort failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -879,5 +936,5 @@
                         logger.error('pilot configure failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -887,5 +944,5 @@
                         logger.error('pilot start failed')
                         self.setEpicsState('ERROR')
-                        self.myState="error"
+                        self.myState = 'error'
                         self.stop.set()
 
@@ -894,5 +951,5 @@
             self.getDetectorCount()
             self.setEpicsState('RUNNING')
-            self.myState="running"
+            self.myState = 'running'
         else:
 
@@ -903,5 +960,5 @@
 
             self.setEpicsState('INITIALIZED')
-            self.myState="unconfigured"
+            self.myState = 'unconfigured'
 
     def setEpicsState(self, _status):
@@ -982,5 +1039,5 @@
                              json.dumps(self.detectorCountList))
 
-        if _tmp !=0:
+        if _tmp != 0:
             try:
                 self.pvNeutron.put(_tmp)
@@ -1075,9 +1132,8 @@
                                  json.dumps(_tmp))
         else:
-            self.redisServer.set('/GPPD/drone/startTime', json.dumps('---'
-                                 ))
+            self.redisServer.set('/GPPD/drone/startTime',
+                                 json.dumps('---'))
             self.redisServer.set('/GPPD/drone/startTimeFloat',
                                  json.dumps(0))
-
 
     def setEndTime(self, now=True):
@@ -1086,9 +1142,11 @@
             _str = time.strftime('%Y-%m-%d %H:%M:%S',
                                  time.localtime(_tmp))
-            self.redisServer.set('/GPPD/drone/endTime', json.dumps(_str))
+            self.redisServer.set('/GPPD/drone/endTime',
+                                 json.dumps(_str))
             self.redisServer.set('/GPPD/drone/endTimeFloat',
                                  json.dumps(_tmp))
         else:
-            self.redisServer.set('/GPPD/drone/endTime', json.dumps('---'))
+            self.redisServer.set('/GPPD/drone/endTime', json.dumps('---'
+                                 ))
             self.redisServer.set('/GPPD/drone/endTimeFloat',
                                  json.dumps(0))
@@ -1101,4 +1159,5 @@
         retry,
         ):
+
         com = str(com)
         cmd = int(cmd)
@@ -1157,5 +1216,5 @@
         except:
             droneInfo[n]['state'] = 'error'
-    
+
     def getMantidStatus(self):
         try:
@@ -1204,6 +1263,6 @@
             proposalID = '---'
 
-        self.endType="time"
-        self.endValue=600.0
+        self.endType = 'time'
+        self.endValue = 600.0
 
         _configure = {}
@@ -1215,12 +1274,12 @@
         _configure['progressMax'] = 20.0
 
-        _configure=json.dumps(_configure, ensure_ascii=False)
-        self.redisServer.set("/GPPD/control/configure", _configure)
-        logger.info("Set configure, %d" % run_no)
+        _configure = json.dumps(_configure, ensure_ascii=False)
+        self.redisServer.set('/GPPD/control/configure', _configure)
+        logger.info('Set configure, %d' % run_no)
 
     def seekCommand(self, module, toState):
-        if module=="mantid":
+        if module == 'mantid':
             _r = self.getMantidStatus()
-        elif module=="pilot":
+        elif module == 'pilot':
             _r = self.getPilotStatus()
         else:
@@ -1234,12 +1293,12 @@
         if fromState == toState:
             pass
-        elif toState == "error":
+        elif toState == 'error':
             pass
         else:
-            if fromState == "unconfigured":
-                if toState == "ready":
+            if fromState == 'unconfigured':
+                if toState == 'ready':
                     _success = self.setCommand(module, 0, 3,
                             self.iRetry)
-                elif toState == "running":
+                elif toState == 'running':
                     _success = self.setCommand(module, 0, 3,
                             self.iRetry)
@@ -1248,20 +1307,20 @@
                 else:
                     pass
-            elif fromState == "ready":
-                if toState == "unconfigured":
+            elif fromState == 'ready':
+                if toState == 'unconfigured':
                     _success = self.setCommand(module, 1, 3,
                             self.iRetry)
-                elif toState == "running":
+                elif toState == 'running':
                     _success = self.setCommand(module, 2, 4,
                             self.iRetry)
                 else:
                     pass
-            elif fromState == "running":
-                if toState == "unconfigured":
+            elif fromState == 'running':
+                if toState == 'unconfigured':
                     _success = self.setCommand(module, 5, 3,
                             self.iRetry)
                     _success = self.setCommand(module, 1, 1,
                             self.iRetry)
-                elif toState == "ready":
+                elif toState == 'ready':
                     _success = self.setCommand(module, 5, 3,
                             self.iRetry)
@@ -1273,6 +1332,6 @@
     def run(self):
         while True:
-            self.seekCommand("mantid", self.myState)
-            self.seekCommand("pilot", self.myState)
+            self.seekCommand('mantid', self.myState)
+            self.seekCommand('pilot', self.myState)
 
             try:
@@ -1285,5 +1344,6 @@
                         pass
 
-                if _time == self.lastTimeStamp and _value==self.lastCmd:
+                if _time == self.lastTimeStamp and _value \
+                    == self.lastCmd:
                     continue
                 else:
@@ -1295,15 +1355,15 @@
                 logger.debug('Receive epics command failed')
                 continue
-            
+
             if newCmd == 'CONF':
                 self.getEpicsConfigure()
 
-                self.seekCommand("mantid", "ready")
-                self.seekCommand("pilot", "ready")
+                self.seekCommand('mantid', 'ready')
+                self.seekCommand('pilot', 'ready')
 
                 if int(self.getMantidStatus()[0]) == 3 \
                     and int(self.getPilotStatus()[0]) == 3:
                     self.setEpicsState('READY')
-                    self.myState="ready"
+                    self.myState = 'ready'
                 else:
                     if int(self.getMantidStatus()[0]) != 3:
@@ -1315,9 +1375,9 @@
 
                     self.setEpicsState('ERROR')
-                    self.myState="error"
-                    logger.error('%s failed' % (newCmd))                    
+                    self.myState = 'error'
+                    logger.error('%s failed' % newCmd)
                     break
-
             elif newCmd == 'START':
+
                 # clear drone
 
@@ -1331,16 +1391,16 @@
                 self.resetMonitorCountList()
 
-                self.seekCommand("mantid", "running")
+                self.seekCommand('mantid', 'running')
 
                 self.setStartTime(True)
                 self.setEndTime(False)
 
-                self.seekCommand("pilot", "running")
-                
+                self.seekCommand('pilot', 'running')
+
                 if int(self.getMantidStatus()[0]) == 4 \
                     and int(self.getPilotStatus()[0]) == 4:
                     self.setProtonNeutron()
                     self.setEpicsState('RUNNING')
-                    self.myState="running"
+                    self.myState = 'running'
                 else:
                     if int(self.getMantidStatus()[0]) != 4:
@@ -1351,11 +1411,11 @@
                         pass
                     self.pvStatus.put('ERROR')
-                    self.myState="error"
-                    logger.error('%s failed' % (newCmd))                    
+                    self.myState = 'error'
+                    logger.error('%s failed' % newCmd)
                     break
-
             elif newCmd == 'STOP':
-                self.seekCommand("mantid", "unconfigured")
-                self.seekCommand("pilot", "unconfigured")
+
+                self.seekCommand('mantid', 'unconfigured')
+                self.seekCommand('pilot', 'unconfigured')
 
                 if int(self.getMantidStatus()[0]) == 1 \
@@ -1363,5 +1423,5 @@
                     self.setEndTime(True)
                     self.setEpicsState('INITIALIZED')
-                    self.myState="unconfigured"
+                    self.myState = 'unconfigured'
                 else:
                     if int(self.getMantidStatus()[0]) != 1:
@@ -1373,15 +1433,15 @@
 
                     self.pvStatus.put('ERROR')
-                    logger.error('%s failed' % (newCmd))        
+                    logger.error('%s failed' % newCmd)
                     break
-
             elif newCmd == 'EXIT' or newCmd == 'CANCEL':
-                self.seekCommand("mantid", "unconfigured")
-                self.seekCommand("pilot", "unconfigured")
+
+                self.seekCommand('mantid', 'unconfigured')
+                self.seekCommand('pilot', 'unconfigured')
 
                 if int(self.getMantidStatus()[0]) == 1 \
                     and int(self.getPilotStatus()[0]) == 1:
                     self.setEpicsState('INITIALIZED')
-                    self.myState="unconfigured"
+                    self.myState = 'unconfigured'
                 else:
                     if int(self.getMantidStatus()[0]) != 1:
@@ -1393,8 +1453,8 @@
 
                     self.pvStatus.put('ERROR')
-                    logger.error('%s failed' % (newCmd))    
+                    logger.error('%s failed' % newCmd)
                     break
             else:
-                logger.warning('Invalid command %s' % newCmd)             
+                logger.warning('Invalid command %s' % newCmd)
 
             time.sleep(0.5)
@@ -1402,5 +1462,6 @@
         self.stop.set()
 
-if __name__=="__main__":
+
+if __name__ == '__main__':
     try:
         if sys.argv[1] == 'stop':
@@ -1409,8 +1470,9 @@
         run_this()
 
-    logger.info("===================")
-    logger.info("Welcome to CockPit!")
-    logger.info("        GPPD       ")
-    logger.info("===================")
+    logger.info('===================')
+    logger.info('Welcome to CockPit!')
+    logger.info('        GPPD       ')
+    logger.info('===================')
+
     # "==================="
     # start Redis
@@ -1423,18 +1485,24 @@
         sys.exit()
 
-    #"==================="
+    # "==================="
     # connect Redis
+
     try:
-        #myredis=getRedisServer("10.1.33.141", 9000, 10)
-        myredis=getRedisServer([('10.1.33.141', 9001)], "sanlie;123", 10)
+
+        # myredis=getRedisServer("10.1.33.141", 9000, 10)
+
+        myredis = getRedisServer([('10.1.33.141', 9001)], 'sanlie;123',
+                                 10)
         if myredis.getStatus():
-            redisServer=myredis.getRedisWrite()
-            logger.debug("Redis Connected")
+            redisServer = myredis.getRedisWrite()
+            logger.debug('Redis Connected')
     except:
-        redisServer=None
-        logger.error("Redis not available")
+        redisServer = None
+        logger.error('Redis not available')
         sys.exit()
-    #"==================="
+
+    # "==================="
     # connect Epics
+
     try:
         myepics = getEpicsServer(5)
@@ -1444,35 +1512,39 @@
             logger.error('Epics Failed')
     except:
-        logger.error("Epics Failed")
-    
-    #"==================="
+        logger.error('Epics Failed')
+
+    # "==================="
     # connect Drone
+
     try:
-        droneServer=getDroneServer()
-        logger.info("Drone Created")
+        droneServer = getDroneServer()
+        logger.info('Drone Created')
     except:
-        logger.error("Drone Failed")
-
-    #"==================="
+        logger.error('Drone Failed')
+
+    # "==================="
     # receive epics command
+
     try:
         threadGetEpics = main(redisServer, droneServer)
         threadGetEpics.setDaemon(True)
         threadGetEpics.start()
-        logger.info("Mainthread created")
+        logger.info('Mainthread created')
         time.sleep(0.1)
     except:
-        logger.error("Mainthread Failed")
-
-    #"==================="
+        logger.error('Mainthread Failed')
+
+    # "==================="
     # refresh Glassfish
+
     try:
         threadSetWeb = setGlassfish(redisServer, 1)
         threadSetWeb.setDaemon(True)
         threadSetWeb.start()
-        logger.info("Glassfish started")
+        logger.info('Glassfish started')
         time.sleep(0.1)
     except:
-        logger.error("Glassfish Failed")
+        logger.error('Glassfish Failed')
+
     # "==================="
 
@@ -1489,5 +1561,7 @@
 
     try:
-        #epicsStatus.put('ERROR')
+
+        # epicsStatus.put('ERROR')
+
         logger.info('===================')
         logger.info('   Cockpit bye!    ')
Index: redis/redis-master.py
===================================================================
--- redis/redis-master.py	(revision 8a71e802e3e36061980cba24b876e46158fe3da6)
+++ redis/redis-master.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,7 +1,9 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 import subprocess
 import os
 import sys
+
 
 # sudo fuser -k 9000/tcp
@@ -10,8 +12,11 @@
 
 def get_pid(name):
-    PID=[]
+    PID = []
     try:
-        #PID=map(int,subprocess.check_output(["pidof", name]).split())
-        PID=map(int,subprocess.check_output(["pgrep", "-f", name]).split())
+
+        # PID=map(int,subprocess.check_output(["pidof", name]).split())
+
+        PID = map(int, subprocess.check_output(['pgrep', '-f',
+                  name]).split())
     except:
         pass
@@ -19,7 +24,8 @@
     return PID
 
+
 def kill_PID(name):
     p = subprocess.Popen(['ps', '-A'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
+    (out, err) = p.communicate()
 
     for line in out.splitlines():
@@ -27,41 +33,44 @@
             pid = int(line.split(None, 1)[0])
             print pid
-            subprocess.Popen(['kill',  '-9',  str(pid)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-            #os.kill(pid, subprocess.signal.SIGKILL)
+            subprocess.Popen(['kill', '-9', str(pid)],
+                             stdout=subprocess.PIPE,
+                             stderr=subprocess.PIPE)
+
+
+            # os.kill(pid, subprocess.signal.SIGKILL)
 
 def kill_process(name):
-    p="pkill -9 "+name
+    p = 'pkill -9 ' + name
     process = subprocess.call(p, shell=True)
-    #process.communicate()
+
+
+    # process.communicate()
 
 def redis_stop():
-    name="redis-server"
+    name = 'redis-server'
     kill_process(name)
-    name="redis-sentinel"
+    name = 'redis-sentinel'
     kill_process(name)
-  
-    print "INFO: Redis stopped!" 
-    ''' 
-    r=[]
-    r.append('ps -ef | grep redis-server')
-    r.append('ps -ef | grep redis-sentinel')
-    for p in r:
-        process = subprocess.call(p, shell=True)
-    '''
+
+    print 'INFO: Redis stopped!'
+
 
 def redis_start():
-    r=[]
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/workspace/redis/master/redis_9000.conf')
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/workspace/redis/master/sentinel_9001.conf')
+    r = []
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/workspace/redis/master/redis_9000.conf'
+             )
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/workspace/redis/master/sentinel_9001.conf'
+             )
     for p in r:
         subprocess.call(p, shell=True)
 
-    r=[]
+    r = []
     r.append('/opt/shared/library/redis-4.0.1/bin/redis-server')
     r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel')
     for p in r:
         print get_pid(p)
-    
-    print "INFO: Redis started!" 
+
+    print 'INFO: Redis started!'
+
 
 def redis_restart():
@@ -69,25 +78,14 @@
     redis_start()
 
+
 if __name__ == '__main__':
-    cmd=sys.argv[1]
-    if cmd=="start":
+    cmd = sys.argv[1]
+    if cmd == 'start':
         redis_start()
-    elif cmd=="stop":
+    elif cmd == 'stop':
         redis_stop()
-    elif cmd=="restart":
+    elif cmd == 'restart':
         redis_restart()
     else:
-        print "start/stop/restart?"
+        print 'start/stop/restart?'
 
-
-'''
-name="redis-server"
-print name, ":", get_pid(name)
-kill_PID(name)
-print name, ":", get_pid(name)
-
-name="redis-sentinel"
-print name, ":", get_pid(name)
-kill_PID(name)
-print name, ":", get_pid(name)
-'''
Index: redis/redis-multiple.py
===================================================================
--- redis/redis-multiple.py	(revision 8a71e802e3e36061980cba24b876e46158fe3da6)
+++ redis/redis-multiple.py	(revision 2fd1c0a0864f2e7a78c00398672c3eaff10e2c6c)
@@ -1,7 +1,9 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 import subprocess
 import os
 import sys
+
 
 # sudo fuser -k 9000/tcp
@@ -10,8 +12,11 @@
 
 def get_pid(name):
-    PID=[]
+    PID = []
     try:
-        #PID=map(int,subprocess.check_output(["pidof", name]).split())
-        PID=map(int,subprocess.check_output(["pgrep", "-f", name]).split())
+
+        # PID=map(int,subprocess.check_output(["pidof", name]).split())
+
+        PID = map(int, subprocess.check_output(['pgrep', '-f',
+                  name]).split())
     except:
         pass
@@ -19,7 +24,8 @@
     return PID
 
+
 def kill_PID(name):
     p = subprocess.Popen(['ps', '-A'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
+    (out, err) = p.communicate()
 
     for line in out.splitlines():
@@ -27,45 +33,52 @@
             pid = int(line.split(None, 1)[0])
             print pid
-            subprocess.Popen(['kill',  '-9',  str(pid)], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-            #os.kill(pid, subprocess.signal.SIGKILL)
+            subprocess.Popen(['kill', '-9', str(pid)],
+                             stdout=subprocess.PIPE,
+                             stderr=subprocess.PIPE)
+
+
+            # os.kill(pid, subprocess.signal.SIGKILL)
 
 def kill_process(name):
-    p="pkill -9 "+name
+    p = 'pkill -9 ' + name
     process = subprocess.call(p, shell=True)
-    #process.communicate()
+
+
+    # process.communicate()
 
 def redis_stop():
-    name="redis-server"
+    name = 'redis-server'
     kill_process(name)
-    name="redis-sentinel"
+    name = 'redis-sentinel'
     kill_process(name)
-  
-    print "INFO: Redis stopped!" 
-    ''' 
-    r=[]
-    r.append('ps -ef | grep redis-server')
-    r.append('ps -ef | grep redis-sentinel')
-    for p in r:
-        process = subprocess.call(p, shell=True)
-    '''
+
+    print 'INFO: Redis stopped!'
+
 
 def redis_start():
-    r=[]
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/Workspace/redis/node0/redis_9000.conf')
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/Workspace/redis/node1/redis_9010.conf')
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/Workspace/redis/node2/redis_9020.conf')
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/Workspace/redis/node0/sentinel_9000.conf')
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/Workspace/redis/node1/sentinel_9010.conf')
-    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/Workspace/redis/node2/sentinel_9020.conf')
+    r = []
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/Workspace/redis/node0/redis_9000.conf'
+             )
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/Workspace/redis/node1/redis_9010.conf'
+             )
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-server /home/neon/Workspace/redis/node2/redis_9020.conf'
+             )
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/Workspace/redis/node0/sentinel_9000.conf'
+             )
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/Workspace/redis/node1/sentinel_9010.conf'
+             )
+    r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel /home/neon/Workspace/redis/node2/sentinel_9020.conf'
+             )
     for p in r:
         subprocess.call(p, shell=True)
 
-    r=[]
+    r = []
     r.append('/opt/shared/library/redis-4.0.1/bin/redis-server')
     r.append('/opt/shared/library/redis-4.0.1/bin/redis-sentinel')
     for p in r:
         print get_pid(p)
-    
-    print "INFO: Redis started!" 
+
+    print 'INFO: Redis started!'
+
 
 def redis_restart():
@@ -73,25 +86,14 @@
     redis_start()
 
+
 if __name__ == '__main__':
-    cmd=sys.argv[1]
-    if cmd=="start":
+    cmd = sys.argv[1]
+    if cmd == 'start':
         redis_start()
-    elif cmd=="stop":
+    elif cmd == 'stop':
         redis_stop()
-    elif cmd=="restart":
+    elif cmd == 'restart':
         redis_restart()
     else:
-        print "start/stop/restart?"
+        print 'start/stop/restart?'
 
-
-'''
-name="redis-server"
-print name, ":", get_pid(name)
-kill_PID(name)
-print name, ":", get_pid(name)
-
-name="redis-sentinel"
-print name, ":", get_pid(name)
-kill_PID(name)
-print name, ":", get_pid(name)
-'''
