Beispiel #1
0
def wxPdf(**kwargs):
    # print(kwargs)
    # print(kwargs['url'])
    # return
    if len(kwargs) > 0:
        print("******")
        url = kwargs['url']
        print(url)
        if url == "weixin":
            getPdf()
        else:
            folder = "面试精选"
            if len(kwargs) == 2:
                folder = kwargs['folder']
            # 传值生成pdf
            pdf = GenPdf()
            title = pdf.oldDeal(url, "", folder)
            store = StoreData()
            store.addUrl({
                'link': url,
                'folder': folder,
                'title': title,
                'msgid': '0',
                'turn': 0
            })
            store.updateUrlStateByMsg()
    else:
        getPdf()
Beispiel #2
0
            break
    # print(data)
    return


def genpdf(data):
    mystore = StoreData()
    # 传值生成pdf
    mypdf = GenPdf()
    mypdf.dealHtml(data['url'], str(data['turn']) + '-' + data['title'], data['folder'])
    mystore.updateUrlState(data['id'])
    return


if len(sys.argv) > 1:
    print("******")
    url = sys.argv[1]
    print(url)
    folder = "面试精选"
    if len(sys.argv) == 3:
        folder = sys.argv[2]
    # 传值生成pdf
    pdf = GenPdf()
    title = pdf.dealHtml(url, "", folder)
    store = StoreData()
    store.addUrl({'link': url, 'folder': folder, 'title': title, 'msgid': '0', 'turn': 0})
    store.updateUrlStateByMsg()
else:
    getPdf()
    # print(sys.argv[0])