user_data.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:spc 作者: whbrewer 项目源码 文件源码
def delete_f():
    user = root.authorized()
    app = request.forms.app
    cid = request.forms.cid
    selected_files = request.forms.selected_files
    files = selected_files.rstrip(':').split(':')
    for file in files:
        path = os.path.join(user_dir, user, app, cid, file)
        if cid is not None:
            if os.path.isfile(path):
                print "removing file:", path
                os.remove(path)
            elif os.path.isdir(path):
                print "removing path:", path
                shutil.rmtree(path)
        else:
            print "ERROR: not removing path:", path, "because cid missing"
    redirect("/files?cid="+cid+"&app="+app)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号