Very simple log parser in python