return False class syncXmlRpcServer(xmlRpcServerWithWorkerThreadBase.xmlRpcServerWithWorkerThreadBase): ''' classdocs ''' def __init__(self): ''' Constructor ''' xmlRpcServerWithWorkerThreadBase.xmlRpcServerWithWorkerThreadBase.__init__(self) #self.uuidDict = {} def addSync(self, taskUuid, folderPath, encZipPath, passwd, workingPath): threadInst = syncThread(taskUuid, folderPath, encZipPath, passwd, workingPath) self.register(taskUuid, threadInst) threadInst.start() #print self.encZipPath #print self.folderPath #print syncRpcServerUrl addSync.exposed = True def notify(self, notifyParam): for i in self.itemList: if self.itemList[i].checkMonitorUrl(notifyParam): self.itemList[i].notify(notifyParam) notify.exposed = True if __name__ == '__main__': # Set up site-wide config first so we get a log if errors occur. xmlRpcServerWithWorkerThreadBase.startMainServer(syncXmlRpcServer(), 8807)
currently monitorUrl is not a real URL but a full path. ''' cl(monitorUrl) #Create scanner task item = monitoringItem(monitorUrl, xmlRpcServerUrl) #Format the monitor url monitorUrl = item.getMonitorUrl() #monitorUrl = transform.transformDirToInternal(monitorUrl) if self.monitoring.has_key(monitorUrl): for i in self.monitoring[monitorUrl]: if xmlRpcServerUrl == i.getNotifyUrl(): cl("Already registered") return monitorUrl else: cl(xmlRpcServerUrl, i.getNotifyUrl()) self.monitoring[monitorUrl].append(item) cl("New listener") item.startScan() return monitorUrl else: self.monitoring[monitorUrl] = [item] cl("New folder") item.startScan() return monitorUrl register.exposed = True if __name__ == '__main__': # Set up site-wide config first so we get a log if errors occur. xmlRpcServerWithWorkerThreadBase.startMainServer(collectionMonitorNonRealtimeNotifierService(), 8806)