Exemplo n.º 1
0
 def parse(self, days):
     self._findOffsets(days)
     self._iterateLines("Scanning Progress", self._scanGUID)
     normalMessage("GUID's found", len(self.guidMap.keys()))
     self._iterateLines("Writing Progress",self._writeProgress)
     normalMessage("Lines written", self.linesWritten)
     normalMessage("Characters fixed", (self.sourceFixed + self.targetFixed))
     normalMessage("Unfixable characters", (self.sourceUnfixable + self.targetUnfixable))
Exemplo n.º 2
0
 def __init__(self, targetFilename=TARGETLOG_FILENAME, combatlogFilename=COMBATLOG_FILENAME, bufferSize=DEFAULT_BUFFER_SIZE):
     self.targetLog = open(targetFilename, "w")
     self.combatlogFilename = combatlogFilename
     self.logsize = os.path.getsize(self.combatlogFilename)
     self.bufferSize = bufferSize
     normalMessage("Fetching from file", self.combatlogFilename)
     normalMessage("Log-Size", str(self.logsize/1024/1024) + " MB")
     normalMessage("Streaming into file", targetFilename)
Exemplo n.º 3
0
 def _findOffsets(self, days):
     uniqueOffsets = sorted(uniq(days))
     logDates=[]
     progress, finish = loadingMessage("Finding Offsets")
     binSearch = BinarySearch(self.combatlogFilename)
     lastPos = 0
     for pos in range(len(uniqueOffsets)):
         offset = uniqueOffsets[pos]
         targetDate = datetime.date.today() + datetime.timedelta(days=offset)
         logDate = "%d/%d " % (targetDate.month,targetDate.day)
         logStartPos = binSearch.findOffset(logDate, lastPos, progress)
         logEndPos = binSearch.findLastOffset("\n"+logDate,logStartPos, progress)
         lastPos = logStartPos
         self.logOffsets.append((logStartPos,logDate, logEndPos))
         logDates.append(logDate[:-1])
     for startOffset, logDate, endOffset in self.logOffsets:
         if self.firstOffset < 0:
             if startOffset > 0:
                 self.firstOffset = startOffset
         if endOffset > 0:
             self.lastOffset = endOffset
     finish()
     normalMessage("Date(s)", logDates)