コード例 #1
0
ファイル: main.py プロジェクト: alexeicolin/boxlinux
def deletefile(fileid):
	try:
		sha1sum = get_sha1sum_remote(fileid)
		varprint("Sha1sum of file to be deleted: "+sha1sum)
		url = build_url("file", fileid, None)
		headers_ = {'Authorization' : 'BoxAuth api_key='+apikey+'&auth_token='+auth_token, 'If-Match': sha1sum}
		r = requests.delete(url=url, headers=headers_, proxies=proxies)
		print(r.content)
	except:
		infoprint('Something bad happened when deleting file...')
コード例 #2
0
ファイル: main.py プロジェクト: alexeicolin/boxlinux
def sync():
	global rootdom
	folderlist = get_item_name_list("folder")
	for i in folderlist:
		rootdom = parseString(get_folder_list(uni_get_name(folderlist[i], "id", "folder")))
		k=0
		for j in rootdom.getElementsByTagName("file"):
			fileid = rootdom.getElementsByTagName("file")[k].getElementsByTagName("id")[0].toxml().replace('<id>','').replace('</id>','')
			varprint(fileid)
			download_fileid(fileid)
			k+=1
コード例 #3
0
def sync():
    global rootdom
    folderlist = get_item_name_list("folder")
    for i in folderlist:
        rootdom = parseString(
            get_folder_list(uni_get_name(folderlist[i], "id", "folder")))
        k = 0
        for j in rootdom.getElementsByTagName("file"):
            fileid = rootdom.getElementsByTagName(
                "file")[k].getElementsByTagName("id")[0].toxml().replace(
                    '<id>', '').replace('</id>', '')
            varprint(fileid)
            download_fileid(fileid)
            k += 1
コード例 #4
0
def deletefile(fileid):
    try:
        sha1sum = get_sha1sum_remote(fileid)
        varprint("Sha1sum of file to be deleted: " + sha1sum)
        url = build_url("file", fileid, None)
        headers_ = {
            'Authorization':
            'BoxAuth api_key=' + apikey + '&auth_token=' + auth_token,
            'If-Match': sha1sum
        }
        r = requests.delete(url=url, headers=headers_, proxies=proxies)
        print(r.content)
    except:
        infoprint('Something bad happened when deleting file...')