a01-flask.py 文件源码

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

项目:a01 作者: joemcmanus 项目源码 文件源码
def clearImages():
    getPage(air, 'switch_cameramode.cgi?mode=standalone', headers)
    getPage(air, 'switch_cameramode.cgi?mode=play', headers)
    getPage(air, 'switch_cameramode.cgi?mode=playmaintenance', headers)
    bodyText=("Clearing Images on A01 <br> \n")
    response= getPage(air , 'get_imglist.cgi?DIR=/DCIM/100OLYMP', headers)
    results=re.findall("P.\d*.JPG", response)
    for result in results:
        link='exec_erase.cgi?DIR=/DCIM/100OLYMP/' + result
        print(getPage(air, link, headers))
        bodyText=bodyText + "Erasing : " + link + " <br> \n"

        #Delete local files
        if os.path.isfile('static/thumbs/'+ result):
            os.remove('static/thumbs/'+ result)
        if os.path.isfile('static/images/'+ result):
            os.remove('static/images/'+ result)

    bodyText=Markup(bodyText)
    getPage(air, 'switch_cameramode.cgi?mode=standalone', headers)
    getPage(air, 'switch_cameramode.cgi?mode=rec', headers)
    getPage(air, 'exec_takemisc.cgi?com=startliveview&port=5555', headers)
    return render_template('templatecss.html', bodyText=bodyText)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号