make up for lack of 'total_seconds()' lib function for pre 2.7 version of python

This commit is contained in:
Martin Konecny 2013-05-16 12:25:21 -04:00
parent dc1ec789d2
commit 59785a952f
2 changed files with 13 additions and 1 deletions

View file

@ -11,6 +11,7 @@ import subprocess
import signal
from datetime import datetime
import traceback
import pure
from Queue import Empty
from threading import Thread
@ -19,6 +20,7 @@ from subprocess import Popen, PIPE
from api_clients import api_client
from std_err_override import LogWriter
# configure logging
logging_cfg = os.path.join(os.path.dirname(__file__), "logging.cfg")
logging.config.fileConfig(logging_cfg)
@ -462,7 +464,7 @@ class PypoFetch(Thread):
start = datetime.strptime(media_item['start'], "%Y-%m-%d-%H-%M-%S")
end = datetime.strptime(media_item['end'], "%Y-%m-%d-%H-%M-%S")
length1 = (end - start).total_seconds()
length1 = pure.date_interval_to_seconds(end - start)
length2 = media_item['cue_out'] - media_item['cue_in']
if abs(length2 - length1) > 1: