__init__(self,
text_line)
(Constructor)
|
|
Creates a new event object from the data received.
Receives one line from the log file and extracts the information to
object variables.
The meaning of the strings in the line are(from left to right):
"Type","MPG","Date","Time","Vehicle","Odometer","Filled Up","Cost/Gallon","Gallons","Total Cost","Octane","Gas Brand","Location","Tags","Payment Type","Tire Pressure","Notes","Total Cost","Services"
And one line is (for example):
"Gas","0.0","2010-01-18","10:39 PM","Nissan Versa SL","20406","Full","$2.729","7.255","$19.80","87","Kwik Trip","","","Debit","0.0","","$19.80",""
Types of the fields are as follows. Common fields for all entries:
type: string
date: a date object
time: a time object with hours an minutes
vehicle: string
odometer: integer
gas brand: string
location: string
payment type: string
tire pressure: float
notes: string
total cost: float
Fields for service entry:
tags: string
service: string, multiple operations separated by comma
Fields for refueling entry:
mpg: float
filled up: string
cost/gallon: float
gallons: float
total_cost 1: float
octane: int
- Parameters:
text_line - one line from the log file as it is there.
- Overrides:
object.__init__
|