def resumable_upload(insert_request, filename): response = None error = None retry = 0 while response is None: try: #print "Uploading file..." status, response = insert_request.next_chunk() if 'id' in response: #print "Video id '%s' was successfully uploaded." % response['id'] print response['id'] f = FileController() f.process_json() f.write_link(filename, response['id']) return response['id'] else: exit("The upload failed with an unexpected response: %s" % response) except HttpError, e: if e.resp.status in RETRIABLE_STATUS_CODES: error = "A retriable HTTP error %d occurred:\n%s" % ( e.resp.status, e.content) else: raise except RETRIABLE_EXCEPTIONS, e: error = "A retriable error occurred: %s" % e
def main(): print 'Hello, world!' def outputMenu(): print("Welcome to the AlmostUnlimitedStorage Cloud\n") print("Type UP to upload a new video\n") print( "Type DOWN to download a video that has already been uploaded to our cloud\n" ) print("Type QUIT to quit\n") print 'Type CLEAR to clear saved videos\n' if __name__ == '__main__': #db = Backend() #db.init #sys.exit(app.exec_()) app = QtGui.QApplication(sys.argv) app.setStyleSheet(qdarkstyle.load_stylesheet()) unlimited_ui = UnlimitedUi() sys.exit(app.exec_()) # File Controller with Dict from JSON file file_controller = FileController() file_controller.process_json()