def __init__(self, sessionBus, objectPath, cfg): dbus.service.Object.__init__(self, sessionBus, objectPath) self.freqUpdatedList = {} self.objDb = objectDatabase.objectDatabase() self.taskMan = taskManagerProxy() self.registeredCallback = {} self.monitoring = {} self.cfg = cfg self.addedItemCnt = 0
def __init__(self, rootFolder, receiver, targetCollectionId = None): threading.Thread.__init__(self) self.rootFolder = transform.transformDirToInternal(rootFolder) self.objDb = objectDatabase.objectDatabase() self.receiver = receiver if targetCollectionId is None: self.targetCollectionId = u'folderRecursiveEnum://'+self.rootFolder else: self.targetCollectionId = targetCollectionId self.addedItemCnt = 0
def __init__(self, taskId, appUuid): self.db = objectDatabase.objectDatabase() self.taskId = taskId self.appUuid = appUuid self.appConfigObj = self.db.findObj({"taskId": taskId, "appUuid":appUuid}) if self.appConfigObj is None: #Task not exist, create it self.appConfigObj = self.getInitialCfg() self.appConfigObj["uuid"] = self.db.addVirtualObj(self.appConfigObj) if self.checkParam(): raise incorrectTaskAndAppId()
def main(): import sys #print sys.argv[1] taskName = sys.argv[2] passwd = sys.argv[1] db = objectDatabase.objectDatabase(dbPrefix = "test") folderRoot = transform.transformDirToInternal("D:\\proj") workingDir = 'd:/tmp/fileman/working' targetBackupDir = transform.transformDirToInternal(os.path.join(workingDir, "backup")) syncFolderCollectionId = unicode(str(uuid.uuid4())) encZipRoot = transform.transformDirToInternal("D:\\working\\test\\encZip") folderCol = syncFolderCollection.syncFolderCollection(folderRoot, targetBackupDir, syncFolderCollectionId, db) logCollectionId = unicode(str(uuid.uuid4())) encZipCol = encZipInfoCollection.encZipInfoCollection(encZipRoot, logCollectionId, workingDir, passwd, db) s = collectionSync(taskName, folderCol, encZipCol, ) s.process()
def __init__(self, collectionId): ''' collectionId is the local state for all objects in the folder storage ''' self.db = objectDatabase.objectDatabase() self.collection = self.db.getCollection(collectionId)
def __init__(self, rootDir, backupDir, collectionId): self.rootDir = rootDir self.backupDir = backupDir self.lastState = folderStorageStateOnDb(collectionId) self.db = objectDatabase.objectDatabase()