from abstract import BCFerriesAbstractObject
from helpers import to_int
import dateutil.parser, datetime, re

time_regex = re.compile(r'(\d) HOURS?(?: (\d{1,2}) MINUTES?)?')

class BCFerriesScheduledCrossing(BCFerriesAbstractObject):
  def __init__(self, name, sailing_time, time_row):
    super(BCFerriesScheduledCrossing, self).__init__(self)

    scheduled_dep, actual_dep, arrival, status, _ = time_row
    self.boat_name = name
    self.name = '{} at {}'.format(name, scheduled_dep)
    self.status = status.strip()

    self.sailing_time = 0
    match = time_regex.match(sailing_time)
    if match:
      hours, minutes = match.group(1, 2)
      self.sailing_time = datetime.timedelta(minutes=to_int(minutes), hours=to_int(hours))

    self.scheduled_departure = dateutil.parser.parse(scheduled_dep, fuzzy=True) if scheduled_dep else None
    self.actual_departure = dateutil.parser.parse(actual_dep, fuzzy=True) if actual_dep else None
    self.arrival = dateutil.parser.parse(arrival, fuzzy=True) if arrival else None

    self._register_properties(['boat_name', 'sailing_time', 'scheduled_departure', 'actual_departure', 'arrival'])

  def is_early(self):
    return (self.actual_departure or self.scheduled_departure) < self.scheduled_departure

  def is_late(self):
    return (self.actual_departure or self.scheduled_departure) > self.scheduled_departure

  def is_departed(self):
    return (self.actual_departure or self.scheduled_departure) <= datetime.datetime.now()

  def delta_from_schedule(self):
    actual_departure = (self.actual_departure or self.scheduled_departure)
    if self.is_early():
      return self.scheduled_departure - actual_departure
    else:
      return actual_departure - self.scheduled_departure

@@ -1020,16 +1020,102 @@
 e None%0A%0A
+    self.__fake_actual_departure = self.actual_departure or self.scheduled_departure%0A%0A
     self
@@ -1259,48 +1259,26 @@
 urn 
-(
 self.
-actual_departure or self.scheduled
+__fake_actual
 _dep
@@ -1283,17 +1283,16 @@
 eparture
-)
  %3C self.
@@ -1348,48 +1348,26 @@
 urn 
-(
 self.
-actual_departure or self.scheduled
+__fake_actual
 _dep
@@ -1372,17 +1372,16 @@
 eparture
-)
  %3E self.
@@ -1441,48 +1441,26 @@
 urn 
-(
 self.
-actual_departure or self.scheduled
+__fake_actual
 _dep
@@ -1465,17 +1465,16 @@
 eparture
-)
  %3C= date
@@ -1531,83 +1531,8 @@
 f):%0A
-    actual_departure = (self.actual_departure or self.scheduled_departure)%0A
     
@@ -1591,16 +1591,28 @@
 rture - 
+self.__fake_
 actual_d
@@ -1643,16 +1643,28 @@
  return 
+self.__fake_
 actual_d

Make code more DRY