Exemplo n.º 1
0
 def register(self, dir2Monitor, callbackAppAndParam):
     dir2Monitor = transform.transformDirToInternal(dir2Monitor)
     if self.monitoring.has_key(dir2Monitor):
         return "Already registered"
     self.registeredCallback[dir2Monitor] = callbackAppAndParam
     pa = fileTools.findFileInProduct('dirMonitorV2.py')
     ru = [pa, '-p', "%s"%dir2Monitor]
     print ru
     appStarterForDbusTest.startAppFromDbus(ru)
     return "OK"
Exemplo n.º 2
0
 def register(self, dir2Monitor, callbackAppAndParam):
     if (self.configDictInst["monitoring"].has_key(dir2Monitor)):
         if (self.configDictInst["monitoring"][dir2Monitor] == callbackAppAndParam):
             return "Already registered"
         else:
             #Already registered but not the same application
             self.configDictInst["monitoring"][dir2Monitor].append(callbackAppAndParam)
     else:
         self.configDictInst["monitoring"][dir2Monitor] = [callbackAppAndParam]
     
     if self.notifyThreads.has_key(dir2Monitor):
         return "OK"
     #newThread = changeNotifyOnDbusThread(dir2Monitor)
     #newThread.start()
     #self.notifyThreads[dir2Monitor] = newThread
     pa = fileTools.findFileInProduct('dirMonitor.py')
     import appStarterForDbusTest
     ru = [pa, '-p', "%s"%dir2Monitor]
     print ru
     appStarterForDbusTest.startAppFromDbus(ru)
     return "OK"