def retrieveChildren(self): data = SugarSync.getFolderContents(self.link) # we have to split all elements and check whether its a folder or a file childs = data.getChildren() if childs is not None: for c in childs: if c.getName() == "collection" and c.getAttribute("type") == "folder": elm = SugarSyncDirectory(c.ref) else: elm = SugarSyncFile(c.ref) elm.setName(str(c.displayName)) elm.setParent(self) self.addChild(elm)
def retrieveChildren(self): data = SugarSync.getFolderContents(self.link) # we have to split all elements and check whether its a folder or a file childs = data.getChildren() if childs is not None: for c in childs: if c.getName() == 'collection' and c.getAttribute( 'type') == 'folder': elm = SugarSyncDirectory(c.ref) else: elm = SugarSyncFile(c.ref) elm.setName(str(c.displayName)) elm.setParent(self) self.addChild(elm)