This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ThreadQueue { | |
private: | |
ThreadQueue& operator=(ThreadQueue&); | |
list<int> data; | |
pthread_mutex lock; | |
pthread_mutex empty_lock; | |
public: | |
ThreadQueue() { | |
pthread_mutex_init(&lock,NULL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOWNLOAD_HANDLERS = { | |
'http': 'myspider.socks5_http.Socks5DownloadHandler', | |
'https': 'myspider.socks5_http.Socks5DownloadHandler' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import requests | |
from xhtml2pdf import pisa | |
from bs4 import BeautifulSoup | |
def convertHtmlToPdf(sourceHtml, outputFilename): | |
print "generate pdf to " + outputFilename | |
resultFile = open(outputFilename, "w+b") | |
pisaStatus = pisa.CreatePDF( |