예제 #1
0
	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"
예제 #2
0
    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)
예제 #3
0
파일: gui1.py 프로젝트: pecavi/bespin
	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)
예제 #4
0
	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()
예제 #5
0
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)