Commit 7c5ad7da authored by Stefano Rivera's avatar Stefano Rivera

Break out pentabarf date parsing utils

parent 0679df5c
......@@ -5,7 +5,7 @@
import argparse
import re
from datetime import datetime, time, timedelta
from datetime import datetime
from pathlib import Path
from xml.etree import ElementTree
......@@ -14,6 +14,7 @@ import requests
from utils.files import dc11_filename, files_with_prefix, penta_filename
from utils.objects import Conference, Event, Meta, VideoFormat
from utils.pentabarf import parse_time, parse_timedelta
from utils.yaml import yaml_dump
......@@ -30,21 +31,6 @@ def scrape(url, args):
)
def parse_time(string):
parts = string.split(':')
parts = [int(part) for part in parts]
assert len(parts) == 2
return time(hour=parts[0], minute=parts[1])
def parse_timedelta(string):
parts = string.split(':')
parts = [int(part) for part in parts]
assert len(parts) == 2
seconds = (parts[0] * 60 + parts[1]) * 60
return timedelta(seconds=seconds)
def index_files(conference):
video_prefix = conference.video_base[56:] + 'high/'
index = {}
......
from datetime import time, timedelta
def parse_time(string):
parts = string.split(':')
parts = [int(part) for part in parts]
assert len(parts) == 2
return time(hour=parts[0], minute=parts[1])
def parse_timedelta(string):
parts = string.split(':')
parts = [int(part) for part in parts]
assert len(parts) == 2
seconds = (parts[0] * 60 + parts[1]) * 60
return timedelta(seconds=seconds)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment