63 Commits

Author SHA1 Message Date
32191791c6 Twiddling with RtD 2025-09-20 23:00:49 -07:00
1ff910e4d2 Doc notes 2025-09-20 22:34:58 -07:00
0e8a77f548 removing flake8 file 2025-09-20 22:26:21 -07:00
Jamie Hardt
7058397f6f Update __init__.py 2025-09-20 22:24:10 -07:00
Jamie Hardt
16d7befd9f Update __init__.py 2025-09-20 22:21:56 -07:00
Jamie Hardt
2a3f4a7c18 Update python-package.yml 2025-09-20 22:19:14 -07:00
d7fff23e5e Tweaking workflow 2025-09-20 22:12:55 -07:00
Jamie Hardt
757c3171e7 Merge branch 'master' into feat-uv 2025-09-20 22:10:15 -07:00
48dd7de07e Changing to ruff linter 2025-09-20 22:07:33 -07:00
Jamie Hardt
dc259d54aa Update README.md 2025-09-20 16:39:06 -07:00
Jamie Hardt
09ed12fc8f Migrating to uv build and manager (#16)
* Migrating to uv build and manager

* Updated Flake8 settings

* Updating github workflow

* Update python-package.yml

* Removed redundant flake8 run

* Version number in banner

---------

Co-authored-by: Jamie Hardt <jamie@squad51.us>
2025-09-20 10:04:15 -07:00
2a69bf47c8 Version number in banner 2025-09-20 10:02:44 -07:00
01d2374a9b Merge branch 'feat-uv' of https://github.com/iluvcapra/ptulsconv into feat-uv 2025-09-20 09:47:07 -07:00
68e7eb89a9 Twiddle 2025-09-20 09:46:46 -07:00
Jamie Hardt
517fe3526a Update python-package.yml
Removed redundant flake8 run
2025-09-20 08:56:34 -07:00
7789c0df4c Updating github workflow 2025-09-19 10:43:20 -07:00
d97dcc3e08 Updated Flake8 settings 2025-09-19 10:41:41 -07:00
615b2b5a2a Migrating to uv build and manager 2025-09-19 10:36:28 -07:00
4cd6ba1772 Updated for latest ptsl-py
Major version change, dependency changes
2025-09-19 09:52:24 -07:00
1942b323b3 Merge branch 'master' of https://github.com/iluvcapra/ptulsconv 2025-09-08 16:27:19 -07:00
7d297a7564 Nudged version 2025-09-08 16:26:40 -07:00
Jamie Hardt
54fa8f04a7 Update pyproject.toml
Nudge version to 3.0.0
2025-09-08 13:18:24 -07:00
Jamie Hardt
dcc6113a63 Merge pull request #15 from iluvcapra/remove-3.8-support
Remove 3.8 Support
2025-09-08 13:14:47 -07:00
Jamie Hardt
04b9e35240 Update python-package.yml
Remove 3.8 from test matrix
2025-09-08 13:13:09 -07:00
Jamie Hardt
f460022160 Update pyproject.toml
Removing 3.8 from classifiers
2025-09-08 13:11:23 -07:00
5c5cd84811 Merged upstream 2025-09-08 13:06:02 -07:00
Jamie Hardt
ee90697be0 Update pythonpublish.yml
pypa/gh-action-pypi-publish@v1.13.0
2025-09-08 12:50:46 -07:00
Jamie Hardt
4a0d19ade1 Added 3.13 to classifiers. 2025-05-25 07:58:55 -07:00
Jamie Hardt
df6c783c51 Added 3.13 to test matrix 2025-05-25 07:57:42 -07:00
Jamie Hardt
f0b232b2b6 autopep 2025-05-25 07:54:50 -07:00
Jamie Hardt
519c6403ba Nudged version 2025-05-25 07:52:11 -07:00
Jamie Hardt
d29c36eafa Fixed some bugs I introduced, fixed entrypoint 2025-05-25 07:50:37 -07:00
Jamie Hardt
2095a1fb75 Nudged version 2025-05-25 07:24:07 -07:00
Jamie Hardt
70defcc46c fixed typo in copyright line 2025-05-25 07:23:25 -07:00
Jamie Hardt
d156b6df89 Added notes 2025-05-25 07:21:50 -07:00
Jamie Hardt
3ba9d7933e Merge branch 'master' of https://github.com/iluvcapra/ptulsconv 2025-05-25 07:16:45 -07:00
Jamie Hardt
b0c40ee0b6 Merged 2025-05-25 07:16:35 -07:00
Jamie Hardt
921b0f07af Update pyproject.toml
Fixing sphinx dependencies
2025-05-25 07:13:11 -07:00
Jamie Hardt
57764bc859 Update conf.py 2025-05-25 07:05:24 -07:00
Jamie Hardt
779c93282c Update conf.py
Updated copyright message
2025-05-25 07:04:17 -07:00
Jamie Hardt
9684be6c7e Update __init__.py 2025-05-25 07:03:28 -07:00
Jamie Hardt
484a70fc8e Update __init__.py 2025-05-25 07:01:47 -07:00
Jamie Hardt
5aa005c317 Update conf.py 2025-05-25 07:00:44 -07:00
Jamie Hardt
454adea3d1 Merge pull request #13 from iluvcapra/maint-poetry
Upgrade build tool to Poetry
2025-05-24 22:25:53 -07:00
Jamie Hardt
1e6546dab5 Tweak file for flake 2025-05-24 22:24:45 -07:00
Jamie Hardt
8b262d3bfb Rearranged pyproject, brought in metadata 2025-05-24 22:22:04 -07:00
Jamie Hardt
630e7960dc Making changes for peotry 2025-05-24 22:20:15 -07:00
Jamie Hardt
aa7b418121 Update __init__.py
Nudging version to 2.2.1
2025-05-24 21:58:50 -07:00
Jamie Hardt
a519a525b2 Update pythonpublish.yml
Updating python publish action to the latest version
2025-05-24 21:54:42 -07:00
Jamie Hardt
1412efe509 autopep 2025-05-18 13:39:06 -07:00
Jamie Hardt
12a6c05467 autopep 2025-05-18 13:37:46 -07:00
Jamie Hardt
cf87986014 autopep'd test 2025-05-18 13:35:12 -07:00
Jamie Hardt
67533879f8 Rewrote parsing to handle old & new-style markers 2025-05-18 13:33:51 -07:00
Jamie Hardt
f847b88aa3 Nudged version and copyright date 2025-05-17 12:06:56 -07:00
Jamie Hardt
c3a600c5d7 Integrated track marker test case and fixed parser 2025-05-17 12:05:27 -07:00
Jamie Hardt
914783a809 Updated documentation 2025-05-17 11:26:07 -07:00
Jamie Hardt
c638c673e8 Adding track marker export case 2025-05-17 11:23:54 -07:00
Jamie Hardt
15fe6667af Fixed up unit test 2025-05-17 11:23:02 -07:00
Jamie Hardt
d4e23b59eb Adding support for track markers
(Always ignore for now)
2025-05-17 11:19:22 -07:00
Jamie Hardt
a602b09551 flake8 2025-05-17 10:47:21 -07:00
Jamie Hardt
448d93d717 Fix for flake 2025-05-17 10:45:40 -07:00
Jamie Hardt
59e7d40d97 Merge branch 'master' of https://github.com/iluvcapra/ptulsconv 2025-05-11 22:19:26 -07:00
Jamie Hardt
eaa5fe824f Fixed parser logic to handle new-style marker tracks 2025-05-11 22:17:42 -07:00
39 changed files with 213 additions and 116 deletions

View File

@@ -1,4 +0,0 @@
[flake8]
per-file-ignores =
ptulsconv/__init__.py: F401
ptulsconv/docparser/__init__.py: F401

View File

@@ -16,7 +16,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps: steps:
- uses: actions/checkout@v2.5.0 - uses: actions/checkout@v2.5.0
@@ -27,15 +27,11 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install flake8 pytest pip install .
pip install -e . pip install --group dev .
- name: Lint with flake8 - name: Lint with ruff
run: | run: |
# stop the build if there are Python syntax errors or undefined names ruff check src
flake8 ptulsconv tests --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ptulsconv tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest - name: Test with pytest
run: | run: |
pytest pytest
flake8 ptulsconv

View File

@@ -26,14 +26,4 @@ jobs:
- name: Build package - name: Build package
run: python -m build run: python -m build
- name: pypi-publish - name: pypi-publish
uses: pypa/gh-action-pypi-publish@v1.8.6 uses: pypa/gh-action-pypi-publish@v1.13.0
# - name: Report to Mastodon
# uses: cbrgm/mastodon-github-action@v1.0.1
# with:
# message: |
# I just released a new version of ptulsconv, my ADR cue sheet generator!
# #python #protools #pdf #filmmaking
# ${{ github.server_url }}/${{ github.repository }}
# env:
# MASTODON_URL: ${{ secrets.MASTODON_URL }}
# MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}

View File

@@ -10,10 +10,15 @@ build:
os: ubuntu-20.04 os: ubuntu-20.04
tools: tools:
python: "3.10" python: "3.10"
# You can also specify other tool versions: jobs:
# nodejs: "16" pre_install:
# rust: "1.55" - pip install --upgrade --upgrade-strategy only-if-needed --group doc .
# golang: "1.17" build:
html:
python -m sphinx -T -b html -d _build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html
post_build:
- echo "Command run at 'post_build' step"
- echo `date`
# Build documentation in the docs/ directory with Sphinx # Build documentation in the docs/ directory with Sphinx
sphinx: sphinx:
@@ -23,10 +28,13 @@ sphinx:
formats: formats:
- pdf - pdf
# FIXME: We should be installing the `doc` dependency group and not the `doc`
# extra.
#Optionally declare the Python requirements required to build your docs #Optionally declare the Python requirements required to build your docs
python: # python:
install: # install:
- method: pip # - method: pip
path: . # path: .
extra_requirements: # extra_requirements:
- doc # - doc

View File

@@ -23,6 +23,10 @@ The easiest way to install on your site is to use `pip`:
% pip3 install ptulsconv % pip3 install ptulsconv
If you are using `uv` you can also do a tool install...
% uv tool install ptulsconv
This will install the necessary libraries on your host and gives you This will install the necessary libraries on your host and gives you
command-line access to the tool through an entry-point `ptulsconv`. In a command-line access to the tool through an entry-point `ptulsconv`. In a
terminal window type `ptulsconv -h` for a list of available options. terminal window type `ptulsconv -h` for a list of available options.

View File

@@ -3,6 +3,7 @@
# For the full list of built-in configuration values, see the documentation: # For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html # https://www.sphinx-doc.org/en/master/usage/configuration.html
import importlib
import sys import sys
import os import os
@@ -15,9 +16,9 @@ import ptulsconv
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'ptulsconv' project = 'ptulsconv'
copyright = '2019-2023 Jamie Hardt. All rights reserved' copyright = '2019-2025 Jamie Hardt. All rights reserved'
# author = ptulsconv.__author__ version = "Version 2"
release = ptulsconv.__version__ release = importlib.metadata.version("ptulsconv")
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

View File

@@ -6,7 +6,12 @@ Usage Form
Invocations of ptulsconv take the following form: Invocations of ptulsconv take the following form:
ptulsconv [options] IN_FILE ptulsconv [options] [IN_FILE]
`IN_FILE` is a Pro Tools text export in UTF-8 encoding. If `IN_FILE` is
missing, `ptulsconv` will attempt to connect to Pro Tools and read cue data
from the selected tracks of the currently-open session.
Flags Flags

View File

@@ -76,7 +76,10 @@ Fields set in markers, and in marker comments, will be applied to all clips
whose finish is *after* that marker. Fields in markers are applied cumulatively whose finish is *after* that marker. Fields in markers are applied cumulatively
from breakfast to dinner in the session. The latest marker applying to a clip has from breakfast to dinner in the session. The latest marker applying to a clip has
precedence, so if one marker comes after the other, but both define a field, the precedence, so if one marker comes after the other, but both define a field, the
value in the later marker value in the later marker.
All markers on all rulers will be scanned for tags. All markers on tracks will
be ignored.
An important note here is that, always, fields set on the clip name have the An important note here is that, always, fields set on the clip name have the
highest precedence. If a field is set in a clip name, the same field set on the highest precedence. If a field is set in a clip name, the same field set on the

View File

@@ -1,9 +0,0 @@
"""
Parse and convert Pro Tools text exports
"""
__version__ = '2.1.1'
__author__ = 'Jamie Hardt'
__license__ = 'MIT'
__copyright__ = "%s %s (c) 2023 %s. All rights reserved." \
% (__name__, __version__, __author__)

View File

@@ -1,53 +1,60 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project] [project]
name = "ptulsconv" name = "ptulsconv"
authors = [ version = "4.0.0"
{name = "Jamie Hardt", email = "jamiehardt@me.com"}, description = "Read Pro Tools Text exports and generate PDF ADR Reports, JSON"
]
readme = "README.md" readme = "README.md"
license = { file = "LICENSE" } requires-python = ">=3.9"
license-files = ["LICENSE"]
keywords = ["text-processing", "parsers", "film",
"broadcast", "editing", "editorial"]
classifiers = [ classifiers = [
'License :: OSI Approved :: MIT License', 'License :: OSI Approved :: MIT License',
'Topic :: Multimedia', 'Topic :: Multimedia',
'Topic :: Multimedia :: Sound/Audio', 'Topic :: Multimedia :: Sound/Audio',
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
"Topic :: Text Processing :: Filters" "Topic :: Text Processing :: Filters"
] ]
requires-python = ">=3.8" authors = [{name = "Jamie Hardt", email = "<jamiehardt@me.com>"}]
dynamic = ["version", "description"]
keywords = ["text-processing", "parsers", "film",
"broadcast", "editing", "editorial"]
dependencies = [ dependencies = [
'parsimonious', "parsimonious>=0.10.0",
'tqdm', "py-ptsl>=600.0.0",
'reportlab', "reportlab>=4.4.4",
'py-ptsl >= 101.1.0' "tqdm>=4.67.1",
]
[project.optional-dependencies]
doc = [
"Sphinx ~= 5.3.0",
"sphinx-rtd-theme >= 1.1.1"
] ]
[tool.flit.module] # [tool.uv.build-backend]
name = "ptulsconv" # data = { headers = "include/headers", scripts = "bin" }
[project.scripts]
ptulsconv = "ptulsconv.__main__:main"
[project.entry_points.console_scripts]
ptulsconv = 'ptulsconv.__main__:main'
[project.urls] [project.urls]
Source = 'https://github.com/iluvcapra/ptulsconv' Source = 'https://github.com/iluvcapra/ptulsconv'
Issues = 'https://github.com/iluvcapra/ptulsconv/issues' Issues = 'https://github.com/iluvcapra/ptulsconv/issues'
Documentation = 'https://ptulsconv.readthedocs.io/' Documentation = 'https://ptulsconv.readthedocs.io/'
[project.optional-dependencies]
doc = [
"sphinx>=7.4.7",
"sphinx-rtd-theme>=3.0.2",
]
[project.scripts]
ptulsconv = "ptulsconv:__main__.main"
[build-system]
requires = ["uv_build>=0.8.18,<0.9.0"]
build-backend = "uv_build"
[dependency-groups]
dev = [
"ruff>=0.13.1",
]
doc = [
"sphinx>=7.4.7",
"sphinx-rtd-theme>=3.0.2",
]

View File

@@ -0,0 +1,5 @@
"""
Parse and convert Pro Tools text exports
"""
__copyright__ = "ptulsconv (c) 2025 Jamie Hardt. All rights reserved."

View File

@@ -2,7 +2,10 @@ from optparse import OptionParser, OptionGroup
import datetime import datetime
import sys import sys
from ptulsconv import __name__, __copyright__ import importlib.metadata
from ptulsconv import __name__
import ptulsconv
from ptulsconv.commands import convert from ptulsconv.commands import convert
from ptulsconv.reporting import print_status_style, \ from ptulsconv.reporting import print_status_style, \
print_banner_style, print_section_header_style, \ print_banner_style, print_section_header_style, \
@@ -82,7 +85,9 @@ def main():
parser.add_option_group(informational_options) parser.add_option_group(informational_options)
print_banner_style(__copyright__) version = importlib.metadata.version(ptulsconv.__name__)
print_banner_style(f"{ptulsconv.__name__} - version {version}")
print_banner_style(ptulsconv.__copyright__)
(options, args) = parser.parse_args(sys.argv) (options, args) = parser.parse_args(sys.argv)

View File

@@ -55,8 +55,8 @@ def output_adr_csv(lines: List[ADRLine], time_format: TimecodeFormat):
directories for each character number and name pair, and within that directories for each character number and name pair, and within that
directory, creates a CSV file for each reel. directory, creates a CSV file for each reel.
""" """
reels = set([ln.reel for ln in lines])
reels: set[str | None] = set([ln.reel for ln in lines])
for n, name in [(n.character_id, n.character_name) for n in lines]: for n, name in [(n.character_id, n.character_name) for n in lines]:
dir_name = "%s_%s" % (n, name) dir_name = "%s_%s" % (n, name)
os.makedirs(dir_name, exist_ok=True) os.makedirs(dir_name, exist_ok=True)

View File

@@ -2,4 +2,7 @@
Docparser module Docparser module
""" """
from .pt_doc_parser import parse_document from .pt_doc_parser import parse_document
__all__ = [parse_document]

View File

@@ -19,11 +19,17 @@ class SessionDescriptor:
self.tracks = kwargs['tracks'] self.tracks = kwargs['tracks']
self.markers = kwargs['markers'] self.markers = kwargs['markers']
def markers_timed(self) -> Iterator[Tuple['MarkerDescriptor', Fraction]]: def markers_timed(self,
only_ruler_markers: bool = True) -> \
Iterator[Tuple['MarkerDescriptor', Fraction]]:
""" """
Iterate each marker in the session with its respective time reference. Iterate each marker in the session with its respective time reference.
""" """
for marker in self.markers: for marker in self.markers:
if marker.track_marker and only_ruler_markers:
continue
marker_time = Fraction(marker.time_reference, marker_time = Fraction(marker.time_reference,
int(self.header.sample_rate)) int(self.header.sample_rate))
# marker_time = self.header.convert_timecode(marker.location) # marker_time = self.header.convert_timecode(marker.location)
@@ -182,6 +188,7 @@ class MarkerDescriptor:
units: str units: str
name: str name: str
comments: str comments: str
track_marker: bool
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.number = kwargs['number'] self.number = kwargs['number']
@@ -190,3 +197,4 @@ class MarkerDescriptor:
self.units = kwargs['units'] self.units = kwargs['units']
self.name = kwargs['name'] self.name = kwargs['name']
self.comments = kwargs['comments'] self.comments = kwargs['comments']
self.track_marker = kwargs['track_marker']

View File

@@ -9,7 +9,8 @@ from .doc_entity import SessionDescriptor, HeaderDescriptor, TrackDescriptor, \
protools_text_export_grammar = Grammar( protools_text_export_grammar = Grammar(
r""" r"""
document = header files_section? clips_section? plugin_listing? document = header files_section? clips_section? plugin_listing?
track_listing? markers_listing? track_listing? markers_block?
header = "SESSION NAME:" fs string_value rs header = "SESSION NAME:" fs string_value rs
"SAMPLE RATE:" fs float_value rs "SAMPLE RATE:" fs float_value rs
"BIT DEPTH:" fs integer_value "-bit" rs "BIT DEPTH:" fs integer_value "-bit" rs
@@ -74,17 +75,33 @@ protools_text_export_grammar = Grammar(
track_clip_state = ("Muted" / "Unmuted") track_clip_state = ("Muted" / "Unmuted")
markers_listing = markers_listing_header markers_column_header markers_block = markers_block_header
marker_record* (markers_list / markers_list_simple)
markers_listing_header = "M A R K E R S L I S T I N G" rs
markers_column_header = "# " fs "LOCATION " fs markers_list_simple = markers_column_header_simple marker_record_simple*
"TIME REFERENCE " fs
"UNITS " fs markers_list = markers_column_header marker_record*
"NAME " fs
"COMMENTS" rs markers_block_header = "M A R K E R S L I S T I N G" rs
markers_column_header_simple =
"# LOCATION TIME REFERENCE "
"UNITS NAME "
"COMMENTS" rs
markers_column_header =
"# LOCATION TIME REFERENCE "
"UNITS NAME "
"TRACK NAME "
"TRACK TYPE COMMENTS" rs
marker_record_simple = integer_value isp fs string_value fs
integer_value isp fs string_value fs string_value
fs string_value rs
marker_record = integer_value isp fs string_value fs integer_value isp fs marker_record = integer_value isp fs string_value fs integer_value isp fs
string_value fs string_value fs string_value rs string_value fs string_value fs string_value fs
string_value fs string_value rs
fs = "\t" fs = "\t"
rs = "\n" rs = "\n"
@@ -231,22 +248,37 @@ class DocParserVisitor(NodeVisitor):
return node.text return node.text
@staticmethod @staticmethod
def visit_markers_listing(_, visited_children): def visit_markers_block(_, visited_children):
markers = [] markers = []
for marker in visited_children[2]: for marker in visited_children[1][0][1]:
markers.append(marker) markers.append(marker)
return markers return markers
@staticmethod @staticmethod
def visit_marker_record(_, visited_children): def visit_marker_record_simple(_, visited_children):
return MarkerDescriptor(number=visited_children[0], return MarkerDescriptor(number=visited_children[0],
location=visited_children[3], location=visited_children[3],
time_reference=visited_children[5], time_reference=visited_children[5],
units=visited_children[8], units=visited_children[8],
name=visited_children[10], name=visited_children[10],
comments=visited_children[12]) comments=visited_children[12],
track_marker=False)
@staticmethod
def visit_marker_record(_, visited_children):
track_type = visited_children[15]
is_track_marker = (track_type == "Track")
return MarkerDescriptor(number=visited_children[0],
location=visited_children[3],
time_reference=visited_children[5],
units=visited_children[8],
name=visited_children[10],
comments=visited_children[16],
track_marker=is_track_marker)
@staticmethod @staticmethod
def visit_formatted_clip_name(_, visited_children): def visit_formatted_clip_name(_, visited_children):

View File

@@ -79,13 +79,13 @@ def make_doc_template(page_size, filename, document_title,
header_box, page_box = page_box.split_y(0.75 * inch, direction='d') header_box, page_box = page_box.split_y(0.75 * inch, direction='d')
title_box, report_box = header_box.split_x(3.5 * inch, direction='r') title_box, report_box = header_box.split_x(3.5 * inch, direction='r')
on_page_lambda = (lambda c, _: def on_page_lambda(c, _):
draw_header_footer(c, report_box, title_box, draw_header_footer(c, report_box, title_box,
footer_box, title=title, footer_box, title=title,
supervisor=supervisor, supervisor=supervisor,
document_subheader=document_subheader, document_subheader=document_subheader,
client=client, client=client,
doc_title=document_header)) doc_title=document_header)
frames = [Frame(page_box.min_x, page_box.min_y, frames = [Frame(page_box.min_x, page_box.min_y,
page_box.width, page_box.height)] page_box.width, page_box.height)]

View File

@@ -0,0 +1,24 @@
SESSION NAME: Test for ptulsconv
SAMPLE RATE: 48000.000000
BIT DEPTH: 24-bit
SESSION START TIMECODE: 00:00:00:00
TIMECODE FORMAT: 23.976 Frame
# OF AUDIO TRACKS: 1
# OF AUDIO CLIPS: 0
# OF AUDIO FILES: 0
T R A C K L I S T I N G
TRACK NAME: Hamlet
COMMENTS: {Actor=Laurence Olivier}
USER DELAY: 0 Samples
STATE:
CHANNEL EVENT CLIP NAME START TIME END TIME DURATION STATE
1 1 Test Line 1 $QN=T1001 00:00:00:00 00:00:02:00 00:00:02:00 Unmuted
1 2 Test Line 2 $QN=T1002 00:00:04:00 00:00:06:00 00:00:02:00 Unmuted
M A R K E R S L I S T I N G
# LOCATION TIME REFERENCE UNITS NAME TRACK NAME TRACK TYPE COMMENTS
1 00:00:00:00 0 Samples {Title=Multiple Marker Rulers Project} Markers Ruler
2 00:00:04:00 192192 Samples Track Marker Hamlet Track

View File

@@ -2,33 +2,52 @@ import unittest
import tempfile import tempfile
import sys
import os.path import os.path
import os import os
import glob import glob
from ptulsconv import commands from ptulsconv import commands
class TestPDFExport(unittest.TestCase): class TestPDFExport(unittest.TestCase):
def test_report_generation(self): def test_report_generation(self):
""" """
Setp through every text file in export_cases and make sure it can Setp through every text file in export_cases and make sure it can
be converted into PDF docs without throwing an error be converted into PDF docs without throwing an error
""" """
files = [os.path.dirname(__file__) + "/../export_cases/Robin Hood Spotting.txt"] files = []
#files.append(os.path.dirname(__file__) + "/../export_cases/Robin Hood Spotting2.txt") files = [os.path.dirname(__file__) +
"/../export_cases/Robin Hood Spotting.txt"]
for path in files: for path in files:
tempdir = tempfile.TemporaryDirectory() tempdir = tempfile.TemporaryDirectory()
os.chdir(tempdir.name) os.chdir(tempdir.name)
try: try:
commands.convert(input_file=path, major_mode='doc') commands.convert(input_file=path, major_mode='doc')
except: except Exception as e:
assert False, "Error processing file %s" % path print("Error in test_report_generation")
print(f"File: {path}")
print(repr(e))
raise e
finally:
tempdir.cleanup()
def test_report_generation_track_markers(self):
files = []
files.append(os.path.dirname(__file__) +
"/../export_cases/Test for ptulsconv.txt")
for path in files:
tempdir = tempfile.TemporaryDirectory()
os.chdir(tempdir.name)
try:
commands.convert(input_file=path, major_mode='doc')
except Exception as e:
print("Error in test_report_generation_track_markers")
print(f"File: {path}")
print(repr(e))
raise e
finally: finally:
tempdir.cleanup() tempdir.cleanup()
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

View File

@@ -102,14 +102,14 @@ class TestTagCompiler(unittest.TestCase):
time_reference=48000 * 3600, time_reference=48000 * 3600,
units="Samples", units="Samples",
name="Marker 1 {Part=1}", name="Marker 1 {Part=1}",
comments="" comments="", track_marker=False,
), ),
doc_entity.MarkerDescriptor(number=2, doc_entity.MarkerDescriptor(number=2,
location="01:00:01:00", location="01:00:01:00",
time_reference=48000 * 3601, time_reference=48000 * 3601,
units="Samples", units="Samples",
name="Marker 2 {Part=2}", name="Marker 2 {Part=2}",
comments="[M1]" comments="[M1]", track_marker=False,
), ),
] ]