diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 67f4489..1fe9260 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 64264ca..870006f 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -2,7 +2,7 @@ name: Upload Python Package on: release: - types: [created] + types: [published] jobs: deploy: diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..e69de29 diff --git a/ptulsconv/__init__.py b/ptulsconv/__init__.py index 27e8aca..b671e4a 100644 --- a/ptulsconv/__init__.py +++ b/ptulsconv/__init__.py @@ -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__) diff --git a/ptulsconv/broadcast_timecode.py b/ptulsconv/broadcast_timecode.py index 4c8af71..90f1d8f 100644 --- a/ptulsconv/broadcast_timecode.py +++ b/ptulsconv/broadcast_timecode.py @@ -1,11 +1,21 @@ -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")): +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) if frame_count is None: diff --git a/test-coverage.sh b/test-coverage.sh deleted file mode 100755 index 5b7dca1..0000000 --- a/test-coverage.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -coverage run -m pytest . ; coverage-lcov -