Пример #1
0
 def dropEvent(self, e):
     if e.mimeData().hasText:
         #self.addItem(e.mimeData().text()) #this line is not needed really
         e.setDropAction(QtCore.Qt.CopyAction)
         drive_down.upload_file(e.mimeData().text()[7::], drive_service)#call upload function with e.mimeData().text()
         #self.populateDriveList()
         self.clear()
         drivList = drive_down.list_in_root(drive_service)
         for k in drivList:
             it = QtGui.QListWidgetItem(k[0])
             if k[2]:
                 it.setIcon(QtGui.QIcon(r"drv.ico"))
             else:
                 it.setIcon(QtGui.QIcon(r"file.ico"))
             self.addItem(it)
         e.accept()
Пример #2
0
            def dropEvent(self, e):
                if e.mimeData().hasText:
                    e.setDropAction(QtCore.Qt.CopyAction)
                    sysPath = e.mimeData().text()[7::]
                    self.addItem(QtGui.QListWidgetItem(QtGui.QIcon(r'file.ico'), sysPath.split('/')[-1]))
                    size = os.path.getsize(sysPath)
                    
                    dbxUsed, dbxTot = dropbox_down.get_space()
                    drvUsed, drvTot = drive_down.get_space(drive_service)
                    freeDbx = dbxTot - dbxUsed
                    freeDrv = drvTot - drvUsed
                    
                    if size < freeDbx:
                        dropbox_down.upload_file(sysPath, sysPath.split('/')[-1])
                       # l_dbx.popu()
                    elif size < freeDrv:
                        drive_down.upload_file(sysPath, drive_service)
                       # l_drive.popu()
                    else:
                        pass
                    
#this line is not needed really
                    #call upload function with e.mimeData().text()
                    e.accept()
Пример #3
0
 def x2r(self):
     temp = self.downloadDbxItem()
     drive_down.upload_file(temp, drive_service)
     self.populateDriveList()
     os.remove(temp)
Пример #4
0
 def btnUDrive_clicked(self):
     print "aaaaaaaaaaaa"
     print(self.lineEdit.text())
     drive_down.upload_file(self.lineEdit.text()[7::], drive_service)       
     self.populateDriveList()
     print "Done!"