コード例 #1
0
    def __init__(self, mq, conn):
        self.mq = mq
        self.cpuPool = Pool(ncpu)
        self.conn = conn
        self.resultMap = {}

        infolog.info('WordAnalyzing Initialized')
コード例 #2
0
    def __init__(self, mq, conn):
        self.mq = mq
        self.cpuPool = Pool(ncpu)
        self.conn = conn
        self.resultMap = {}

        infolog.info('WordAnalyzing Initialized')
コード例 #3
0
ファイル: wordstat_threading.py プロジェクト: shuqin/pystudy
 def __init__(self, dirpath, qOut, threadID, fileFilterFunc=None):
     threading.Thread.__init__(self)
     self.dirpath = dirpath
     self.fileFilterFunc = fileFilterFunc
     self.qOut = qOut
     self.threadID = threadID
     infolog.info('FileObtainer Initialized')
コード例 #4
0
 def __init__(self, qIn, qOut, threadID):
     threading.Thread.__init__(self)
     self.qIn = qIn
     self.qOut = qOut
     self.threadID = threadID
     self.threads = []
     infolog.info('WordReading Initialized')
コード例 #5
0
 def __init__(self, qIn, threadID):
     threading.Thread.__init__(self)
     self.qIn = qIn
     self.threadID = threadID
     self.resultMap = {}
     self.pool = Pool(cpu_count())
     infolog.info('WordAnalyzing Initialized')
コード例 #6
0
 def __init__(self, qIn, qOut, threadID):
     threading.Thread.__init__(self)
     self.qIn = qIn
     self.qOut = qOut
     self.threadID = threadID
     self.threads = []
     infolog.info('WordReading Initialized')
コード例 #7
0
 def __init__(self, qIn, threadID):
     threading.Thread.__init__(self)
     self.qIn = qIn
     self.threadID = threadID
     self.resultMap = {}
     self.pool = Pool(cpu_count())
     infolog.info('WordAnalyzing Initialized')
コード例 #8
0
def readFile(filename, qOut):
    try:
        f = open(filename, 'r')
        lines = f.readlines()
        infolog.info('[successful read file %s]\n' % filename)
        f.close()
    except IOError, err:
        errorInfo = 'file %s Not found \n' % filename
        errlog.error(errorInfo)
コード例 #9
0
def readFile(filename, qOut):
    try:
        f = open(filename, 'r')
        lines = f.readlines()
        infolog.info('[successful read file %s]\n' % filename)
        f.close()
    except IOError, err:
        errorInfo = 'file %s Not found \n' % filename
        errlog.error(errorInfo)
コード例 #10
0
ファイル: wordstat_threading.py プロジェクト: shuqin/pystudy
class WordReading(threading.Thread):

    def __init__(self, qIn, qOut, threadID):
        threading.Thread.__init__(self)
        self.qIn = qIn
        self.qOut = qOut
        self.threadID = threadID
        infolog.info('WordReading Initialized')

    def readFileInternal(self):
        lines = []
        try:
            filename = self.qIn.get(True, timeoutInSecs)
            #print filename
        except Queue.Empty, emp:
            errlog.error('In WordReading:' + str(emp))
            return None

        try:
            f = open(filename, 'r')
            lines = f.readlines()
            infolog.info('[successful read file %s]\n' % filename)
            f.close()
        except IOError, err:
            errorInfo = 'file %s Not found \n' % filename
            errlog.error(errorInfo)
コード例 #11
0
 def __init__(self, allFiles, mq):
     self.allFiles = allFiles
     self.mq = mq
     self.ioPool = Pool(ncpu*3)
     infolog.info('WordReading Initialized')
コード例 #12
0
ファイル: wordstat_threading.py プロジェクト: shuqin/pystudy
 def __init__(self, qIn, threadID):
     threading.Thread.__init__(self)
     self.qIn = qIn
     self.threadID = threadID
     self.result = {}
     infolog.info('WordAnalyzing Initialized')
コード例 #13
0
 def __init__(self, allFiles, mq):
     self.allFiles = allFiles
     self.mq = mq
     self.ioPool = Pool(ncpu*3)
     infolog.info('WordReading Initialized')