This commit is contained in:
Jamie Hardt
2022-11-15 12:15:45 -08:00
6 changed files with 16 additions and 10 deletions

View File

@@ -37,4 +37,4 @@ jobs:
flake8 ptulsconv tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
PYTHONPATH=. pytest
pytest

View File

@@ -2,7 +2,7 @@ name: Upload Python Package
on:
release:
types: [created]
types: [published]
jobs:
deploy:

0
conftest.py Normal file
View File

View File

@@ -1,6 +1,6 @@
from ptulsconv.docparser.ptuls_grammar import protools_text_export_grammar
__version__ = '1.0.4'
__version__ = '1.0.5'
__author__ = 'Jamie Hardt'
__license__ = 'MIT'
__copyright__ = "%s %s (c) 2022 %s. All rights reserved." % (__name__, __version__, __author__)

View File

@@ -1,10 +1,20 @@
from fractions import Fraction
import re
"""
broadcast_timecode.py
Useful functions for parsing and working with timecode.
"""
import math
import re
from collections import namedtuple
from fractions import Fraction
from typing import Optional, SupportsFloat
class TimecodeFormat(namedtuple("_TimecodeFormat", "frame_duration logical_fps drop_frame")):
"""
A struct reperesenting a timecode datum.
"""
def smpte_to_seconds(self, smpte: str) -> Optional[Fraction]:
frame_count = smpte_to_frame_count(smpte, self.logical_fps, drop_frame_hint=self.drop_frame)

View File

@@ -1,4 +0,0 @@
#!/bin/bash
coverage run -m pytest . ; coverage-lcov