Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def shred_to_lines(lines):
    global pageNumber
    logLines = []
    tapeNumber = None
        
    for number, line in enumerate(lines):
        line = line.decode('utf-8')
        try:
            if line.strip().startswith(u"Page"):
                pageNumber = int(line.strip().lstrip(u"Page ").strip())
            elif line.strip().startswith(u"Tape "):
                tapeNumber = line.lstrip(u"Tape ").strip()
            else:
                logLines.append(LogLine(pageNumber, tapeNumber, number, line))
        except:
            print "Failed on line %i: %s" % (number+1, line)
            raise

    return logLines
        


src/s/p/Spacelog-HEAD/mcshred/src/MCShredTest.py   Spacelog(Download)
        logLines = (logLine0, logLine1, logLine2, logLine3,)
 
        shreddedLines = MCShred.shred_to_lines(logLines)
 
        assert len(shreddedLines) == 3
        logLines = (logLine0, logLine1, logLine2, logLine3,)
 
        shreddedLines = MCShred.shred_to_lines(logLines)
 
        translatedLines = MCShred.translate_lines(shreddedLines)