def descargarOdrive(self): file= self.lbOdri.curselection() value = str(self.lbOdri.get(file[0])) print os.getcwd()+"/"+value client.item(drive="me", id="root").children[value].download(os.getcwd()+"/"+value) self.lbl1["text"]= value+" descargado con exito"
def cargarArchivosOne(self): self.lbOdri.delete(0, END) items = client.item(id="root").children.get() item = onedrivesdk.Item() for item in items: self.lbOdri.insert('end', item.name)
def cargarArchivosOne(self): self.lbOdri.delete(0, END) items = client.item(id="root").children.get() item=onedrivesdk.Item() for item in items: self.lbOdri.insert('end',item.name)
def subirOdrive(self,name,path,size): espacio=5242880-espOne if size>espacio: self.lbl1["text"]="No hay suficiente espacio en tu OneDrive" else: returned_item = client.item(drive="me", id="root").children[name].upload(path) self.lbl1["text"]= name+" subido con exito" self.refresh()
redirect_uri = "http://localhost:8080/" client_secret = "tLwyKkPS74siASB9DnEKt0C" client = onedrivesdk.get_default_client(client_id='4490f18b-5c69-4aa4-8694-b84f6e8d9a15', scopes=['wl.signin', 'wl.offline_access', 'onedrive.readwrite']) #print client.name auth_url = client.auth_provider.get_auth_url(redirect_uri) #this will block until we have the code code = GetAuthCodeServer.get_auth_code(auth_url, redirect_uri) client.auth_provider.authenticate(code, redirect_uri, client_secret) items = client.item(id="root").children.get() item=onedrivesdk.Item() espOne=0 for item in items: espOne+=int(item.size) #-------------------------------------------------------------------- class Application(Frame): def __init__(self,master): Frame.__init__(self,master)