def yunpan(upload_dir, build_count): pattren = '(.*-{}.apk|.*-signed.apk)'.format(build_count) bp = ByPy(configdir='C:\\Users\\Administrator\\.bypy', processes=5, incregex=pattren) #显示网盘使用信息 bp.info() #显示上传日志信息 bp.verbose = True #同步上传 bp.syncup(localdir=upload_dir, remotedir=build_count) #打印云盘目录 bp.ls(build_count)
from io import StringIO from bypy import ByPy import sys import logging if len(sys.argv) <= 1: logging.error("No filename specified") exit() fn = sys.argv[1] folder = "/" if len(sys.argv) > 2: folder = sys.argv[2] + folder bp = ByPy(verbose=1, debug=True) bp.upload(fn, folder + fn) sys.stdout = mystdout = StringIO() bp.debug = False bp.verbose = 0 bp.meta(folder + fn, '$i') sys.stdout = sys.__stdout__ mystdout.seek(0) mystdout.readline() fid = mystdout.readline() print("fid:\"" + str(fid).strip() + "\"")