mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 17:00:46 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ebfd32e02 | ||
|
|
83a9adb48a | ||
|
|
013ebcbe75 | ||
|
|
c87695e5fe | ||
|
|
4a8983cbbb | ||
|
|
9123cbd0b5 | ||
|
|
4224d106b0 | ||
|
|
ac22fab97f | ||
|
|
64ca2c6c5c | ||
|
|
c3af30dc6a | ||
|
|
c30f675cec | ||
|
|
204af7d9cb | ||
|
|
10fc211e80 | ||
|
|
d56c7df376 | ||
|
|
7b38449a5f |
2
.github/workflows/python-package.yml
vendored
2
.github/workflows/python-package.yml
vendored
@@ -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"]
|
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.5.0
|
- uses: actions/checkout@v2.5.0
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ 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 = ptulsconv.__copyright__
|
copyright = '2019-2023 Jamie Hardt. All rights reserved'
|
||||||
# author = ptulsconv.__author__
|
# author = ptulsconv.__author__
|
||||||
release = ptulsconv.__version__
|
release = ptulsconv.__version__
|
||||||
|
|
||||||
|
|||||||
@@ -24,19 +24,21 @@ Step 2: Add More Information to Your Spots
|
|||||||
|
|
||||||
Clips, tracks and markers in your session can contain additional information
|
Clips, tracks and markers in your session can contain additional information
|
||||||
to make your ADR reports more complete and useful. You add this information
|
to make your ADR reports more complete and useful. You add this information
|
||||||
with *tagging*.
|
with :ref:`tagging<tags>`.
|
||||||
|
|
||||||
* Every ADR clip must have a unique cue number. After the name of each clip,
|
* **Every ADR clip must have a unique cue number.** After the name of each
|
||||||
add the letters "$QN=" and then a unique number (any combination of letters
|
clip, add the letters ``$QN=`` and then a unique number (any combination of
|
||||||
or numbers that don't contain a space). You can type these yourself or add
|
letters or numbers that don't contain a space). You can type these yourself
|
||||||
them with batch-renaming when you're done spotting.
|
or add them with batch-renaming when you're done spotting.
|
||||||
* ADR spots should usually have a reason indicated, so you can remember exactly
|
* ADR spots should usually have a reason indicated, so you can remember exactly
|
||||||
why you're replacing a particular line. Do this by adding the the text "{R="
|
why you're replacing a particular line. Do this by adding the the text
|
||||||
to your clip names after the prompt and then some short text describing the
|
``{R=`` to your clip names after the prompt and then some short text
|
||||||
reason, and then a closing "}". You can type anything, including spaces.
|
describing the reason, and then a closing ``}``. You can type anything,
|
||||||
* If a line is a TV cover line, you can add the text "[TV]" to the end.
|
including spaces.
|
||||||
|
* If, for example, a line is a TV cover line, you can add the text ``[TV]`` to
|
||||||
|
the end.
|
||||||
|
|
||||||
So for example, some ADR spot's clip name might look like:
|
So for example, some ADR spot's clip name might look like::
|
||||||
|
|
||||||
Get to the ladder! {R=Noise} $QN=J1001
|
Get to the ladder! {R=Noise} $QN=J1001
|
||||||
"Forget your feelings! {R=TV Cover} $QN=J1002 [TV]
|
"Forget your feelings! {R=TV Cover} $QN=J1002 [TV]
|
||||||
@@ -45,32 +47,26 @@ These tags can appear in any order.
|
|||||||
|
|
||||||
* You can add the name of an actor to a character's track, so this information
|
* You can add the name of an actor to a character's track, so this information
|
||||||
will appear on your reports. In the track name, or in the track comments,
|
will appear on your reports. In the track name, or in the track comments,
|
||||||
type "{Actor=xxx}" replacing the xxx with the actor's name.
|
type ``{Actor=xxx}`` replacing the xxx with the actor's name.
|
||||||
* Characters need to have a number (perhaps from the cast list) to express how
|
* Characters need to have a number (perhaps from the cast list) to express how
|
||||||
they should be collated. Add "$CN=xxx" with a unique number to each track (or
|
they should be collated. Add ``$CN=xxx`` with
|
||||||
the track's comments.)
|
a unique number to each track (or the track's comments.)
|
||||||
* Set the scene for each line with markers. Create a marker at the beginning of
|
* Set the scene for each line with markers. Create a marker at the beginning of
|
||||||
a scene and make it's name "{Sc=xxx}", replacing the xxx with the scene
|
a scene and make it's name ``{Sc=xxx}``, replacing the xxx with the scene
|
||||||
number and name.
|
number and name.
|
||||||
|
|
||||||
|
|
||||||
Step 3: Export Tracks from Pro Tools as a Text File
|
Step 3: Run `ptulsconv`
|
||||||
---------------------------------------------------
|
------------------------
|
||||||
|
|
||||||
Export the file as a UTF-8 and be sure to include clips and markers. Export
|
In Pro Tools, select the tracks that contain your spot clips.
|
||||||
using the Timecode time format.
|
|
||||||
|
|
||||||
Do not export crossfades.
|
Then, in your Terminal, run the following command::
|
||||||
|
|
||||||
|
ptulsconv
|
||||||
|
|
||||||
Step 4: Run `ptulsconv` on the Text Export
|
`ptulsconv` will connect to Pro Tools and read all of the clips on the selected
|
||||||
------------------------------------------
|
track. It will then create a folder named "Title_CURRENT_DATE", and within that
|
||||||
|
|
||||||
In your Terminal, run the following command:
|
|
||||||
|
|
||||||
ptulsconv path/to/your/TEXT_EXPORT.txt
|
|
||||||
|
|
||||||
`ptulsconv` will create a folder named "Title_CURRENT_DATE", and within that
|
|
||||||
folder it will create several PDFs and folders:
|
folder it will create several PDFs and folders:
|
||||||
|
|
||||||
- "TITLE ADR Report" 📄 a PDF tabular report of every ADR line you've spotted.
|
- "TITLE ADR Report" 📄 a PDF tabular report of every ADR line you've spotted.
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ Tagging
|
|||||||
=======
|
=======
|
||||||
|
|
||||||
Tags are used to add additional data to a clip in an organized way. The
|
Tags are used to add additional data to a clip in an organized way. The
|
||||||
tagging system in `ptulsconv` allows is flexible and can be used to add
|
tagging system in `ptulsconv` is flexible and can be used to add any kind of
|
||||||
any kind of extra data to a clip.
|
extra data to a clip.
|
||||||
|
|
||||||
Fields in Clip Names
|
Fields in Clip Names
|
||||||
--------------------
|
--------------------
|
||||||
@@ -14,7 +14,7 @@ Track names, track comments, and clip names can also contain meta-tags, or
|
|||||||
"fields," to add additional columns to the output. Thus, if a clip has the
|
"fields," to add additional columns to the output. Thus, if a clip has the
|
||||||
name:::
|
name:::
|
||||||
|
|
||||||
`Fireworks explosion {note=Replace for final} $V=1 [FX] [DESIGN]`
|
Fireworks explosion {note=Replace for final} $V=1 [FX] [DESIGN]
|
||||||
|
|
||||||
The row output for this clip will contain columns for the values:
|
The row output for this clip will contain columns for the values:
|
||||||
|
|
||||||
@@ -27,20 +27,24 @@ The row output for this clip will contain columns for the values:
|
|||||||
|
|
||||||
|
|
||||||
These fields can be defined in the clip name in three ways:
|
These fields can be defined in the clip name in three ways:
|
||||||
* `$NAME=VALUE` creates a field named `NAME` with a one-word value `VALUE`.
|
|
||||||
* `{NAME=VALUE}` creates a field named `NAME` with the value `VALUE`. `VALUE`
|
* ``$NAME=VALUE`` creates a field named ``NAME`` with a one-word value
|
||||||
in this case may contain spaces or any chartacter up to the closing bracket.
|
``VALUE``.
|
||||||
* `[NAME]` creates a field named `NAME` with a value `NAME`. This can be used
|
* ``{NAME=VALUE}`` creates a field named ``NAME`` with the value ``VALUE``.
|
||||||
to create a boolean-valued field; in the output, clips with the field
|
``VALUE`` in this case may contain spaces or any chartacter up to the
|
||||||
will have it, and clips without will have the column with an empty value.
|
closing bracket.
|
||||||
|
* ``[NAME]`` creates a field named ``NAME`` with a value ``NAME``. This can
|
||||||
|
be used to create a boolean-valued field; in the output, clips with the
|
||||||
|
field will have it, and clips without will have the column with an empty
|
||||||
|
value.
|
||||||
|
|
||||||
For example, if three clips are named:::
|
For example, if three clips are named:::
|
||||||
|
|
||||||
`"Squad fifty-one, what is your status?" [FUTZ] {Ch=Dispatcher} [ADR]`
|
"Squad fifty-one, what is your status?" [FUTZ] {Ch=Dispatcher} [ADR]
|
||||||
|
|
||||||
`"We are ten-eight at Rampart Hospital." {Ch=Gage} [ADR]`
|
"We are ten-eight at Rampart Hospital." {Ch=Gage} [ADR]
|
||||||
|
|
||||||
`(1M) FC callouts rescuing trapped survivors. {Ch=Group} $QN=1001 [GROUP]`
|
(1M) FC callouts rescuing trapped survivors. {Ch=Group} $QN=1001 [GROUP]
|
||||||
|
|
||||||
The output will contain the range:
|
The output will contain the range:
|
||||||
|
|
||||||
@@ -63,7 +67,7 @@ Fields in Track Names and Markers
|
|||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
Fields set in track names, and in track comments, will be applied to *each*
|
Fields set in track names, and in track comments, will be applied to *each*
|
||||||
clip on that track. If a track comment contains the text `{Dept=Foley}` for
|
clip on that track. If a track comment contains the text ``{Dept=Foley}`` for
|
||||||
example, every clip on that track will have a "Foley" value in a "Dept" column.
|
example, every clip on that track will have a "Foley" value in a "Dept" column.
|
||||||
|
|
||||||
Likewise, fields set on the session name will apply to all clips in the session.
|
Likewise, fields set on the session name will apply to all clips in the session.
|
||||||
@@ -84,17 +88,17 @@ track, the value set on the clip will prevail.
|
|||||||
Apply Fields to a Time Range of Clips
|
Apply Fields to a Time Range of Clips
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
A clip name beginning with "@" will not be included in the output, but its
|
A clip name beginning with ``@`` will not be included in the output, but its
|
||||||
fields will be applied to clips within its time range on lower tracks.
|
fields will be applied to clips within its time range on lower tracks.
|
||||||
|
|
||||||
If track 1 has a clip named `@ {Sc=1- The House}`, any clips beginning within
|
If track 1 has a clip named ``@ {Sc=1- The House}``, any clips beginning within
|
||||||
that range on lower tracks will have a field `Sc` with that value.
|
that range on lower tracks will have a field ``Sc`` with that value.
|
||||||
|
|
||||||
|
|
||||||
Combining Clips with Long Names or Many Tags
|
Combining Clips with Long Names or Many Tags
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
|
|
||||||
A clip name beginning with `&` will have its parsed clip name appended to the
|
A clip name beginning with ``&`` will have its parsed clip name appended to the
|
||||||
preceding cue, and the fields of following cues will be applied, earlier clips
|
preceding cue, and the fields of following cues will be applied, earlier clips
|
||||||
having precedence. The clips need not be touching, and the clips will be
|
having precedence. The clips need not be touching, and the clips will be
|
||||||
combined into a single row of the output. The start time of the first clip will
|
combined into a single row of the output. The start time of the first clip will
|
||||||
@@ -108,23 +112,24 @@ Setting Document Options
|
|||||||
.. note::
|
.. note::
|
||||||
Document options are not yet implemented.
|
Document options are not yet implemented.
|
||||||
|
|
||||||
A clip beginning with `!` sends a command to `ptulsconv`. These commands can
|
..
|
||||||
appear anywhere in the document and apply to the entire document. Commands are
|
A clip beginning with ``!`` sends a command to `ptulsconv`. These commands can
|
||||||
a list of words
|
appear anywhere in the document and apply to the entire document. Commands are
|
||||||
|
a list of words
|
||||||
|
|
||||||
The following commands are available:
|
The following commands are available:
|
||||||
|
|
||||||
page $SIZE=`(letter|legal|a4)`
|
page $SIZE=`(letter|legal|a4)`
|
||||||
Sets the PDF page size for the output.
|
Sets the PDF page size for the output.
|
||||||
|
|
||||||
font {NAME=`name`} {PATH=`path`}
|
font {NAME=`name`} {PATH=`path`}
|
||||||
Sets the primary font for the output.
|
Sets the primary font for the output.
|
||||||
|
|
||||||
sub `replacement text` {FOR=`text_to_replace`} {IN=`tag`}
|
sub `replacement text` {FOR=`text_to_replace`} {IN=`tag`}
|
||||||
Declares a substitution. Whereever text_to_replace is encountered in the
|
Declares a substitution. Whereever text_to_replace is encountered in the
|
||||||
document it will be replaced with "replacement text".
|
document it will be replaced with "replacement text".
|
||||||
|
|
||||||
If `tag` is set, this substitution will only be applied to the values of
|
If `tag` is set, this substitution will only be applied to the values of
|
||||||
that tag.
|
that tag.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Parse and convert Pro Tools text exports
|
Parse and convert Pro Tools text exports
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = '2.1.0'
|
__version__ = '2.1.1'
|
||||||
__author__ = 'Jamie Hardt'
|
__author__ = 'Jamie Hardt'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = "%s %s (c) 2023 %s. All rights reserved." \
|
__copyright__ = "%s %s (c) 2023 %s. All rights reserved." \
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ def main():
|
|||||||
default='doc',
|
default='doc',
|
||||||
help='Set output format, `raw`, `tagged`, `doc`.')
|
help='Set output format, `raw`, `tagged`, `doc`.')
|
||||||
|
|
||||||
|
parser.add_option('-m', '--movie-opts',
|
||||||
|
dest='movie_opts',
|
||||||
|
metavar="MOVIE_OPTS",
|
||||||
|
help="Set movie options")
|
||||||
|
|
||||||
warn_options = OptionGroup(title="Warning and Validation Options",
|
warn_options = OptionGroup(title="Warning and Validation Options",
|
||||||
parser=parser)
|
parser=parser)
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ from fractions import Fraction
|
|||||||
import ptsl
|
import ptsl
|
||||||
|
|
||||||
from .docparser.adr_entity import make_entities, ADRLine
|
from .docparser.adr_entity import make_entities, ADRLine
|
||||||
from .reporting import print_section_header_style, print_status_style,\
|
from .reporting import print_section_header_style, print_status_style, \
|
||||||
print_warning
|
print_warning
|
||||||
from .validations import validate_unique_field, validate_non_empty_field,\
|
from .validations import validate_unique_field, validate_non_empty_field, \
|
||||||
validate_dependent_value
|
validate_dependent_value
|
||||||
|
|
||||||
from ptulsconv.docparser import parse_document
|
from ptulsconv.docparser import parse_document
|
||||||
@@ -32,7 +32,7 @@ from ptulsconv.pdf.continuity import output_report as output_continuity
|
|||||||
from json import JSONEncoder
|
from json import JSONEncoder
|
||||||
|
|
||||||
|
|
||||||
class MyEncoder(JSONEncoder):
|
class FractionEncoder(JSONEncoder):
|
||||||
"""
|
"""
|
||||||
A subclass of :class:`JSONEncoder` which encodes :class:`Fraction` objects
|
A subclass of :class:`JSONEncoder` which encodes :class:`Fraction` objects
|
||||||
as a dict.
|
as a dict.
|
||||||
@@ -97,7 +97,7 @@ def output_adr_csv(lines: List[ADRLine], time_format: TimecodeFormat):
|
|||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
|
||||||
|
|
||||||
def generate_documents(session_tc_format, scenes, adr_lines: Iterator[ADRLine],
|
def generate_documents(session_tc_format, scenes, adr_lines: List[ADRLine],
|
||||||
title):
|
title):
|
||||||
"""
|
"""
|
||||||
Create PDF output.
|
Create PDF output.
|
||||||
@@ -112,7 +112,7 @@ def generate_documents(session_tc_format, scenes, adr_lines: Iterator[ADRLine],
|
|||||||
supervisor = next((x.supervisor for x in adr_lines), "")
|
supervisor = next((x.supervisor for x in adr_lines), "")
|
||||||
|
|
||||||
output_continuity(scenes=scenes, tc_display_format=session_tc_format,
|
output_continuity(scenes=scenes, tc_display_format=session_tc_format,
|
||||||
title=title, client=client,
|
title=title, client=client or "",
|
||||||
supervisor=supervisor)
|
supervisor=supervisor)
|
||||||
|
|
||||||
reels = ['R1', 'R2', 'R3', 'R4', 'R5', 'R6']
|
reels = ['R1', 'R2', 'R3', 'R4', 'R5', 'R6']
|
||||||
@@ -193,7 +193,7 @@ def convert(major_mode, input_file=None, output=sys.stdout, warnings=True):
|
|||||||
session_tc_format = session.header.timecode_format
|
session_tc_format = session.header.timecode_format
|
||||||
|
|
||||||
if major_mode == 'raw':
|
if major_mode == 'raw':
|
||||||
output.write(MyEncoder().encode(session))
|
output.write(FractionEncoder().encode(session))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
compiler = TagCompiler()
|
compiler = TagCompiler()
|
||||||
@@ -201,7 +201,7 @@ def convert(major_mode, input_file=None, output=sys.stdout, warnings=True):
|
|||||||
compiled_events = list(compiler.compile_events())
|
compiled_events = list(compiler.compile_events())
|
||||||
|
|
||||||
if major_mode == 'tagged':
|
if major_mode == 'tagged':
|
||||||
output.write(MyEncoder().encode(compiled_events))
|
output.write(FractionEncoder().encode(compiled_events))
|
||||||
|
|
||||||
elif major_mode == 'doc':
|
elif major_mode == 'doc':
|
||||||
generic_events, adr_lines = make_entities(compiled_events)
|
generic_events, adr_lines = make_entities(compiled_events)
|
||||||
@@ -225,9 +225,10 @@ def convert(major_mode, input_file=None, output=sys.stdout, warnings=True):
|
|||||||
print_status_style("%i ADR events found." % len(adr_lines))
|
print_status_style("%i ADR events found." % len(adr_lines))
|
||||||
|
|
||||||
if warnings:
|
if warnings:
|
||||||
perform_adr_validations(adr_lines)
|
perform_adr_validations(iter(adr_lines))
|
||||||
|
|
||||||
generate_documents(session_tc_format, scenes, adr_lines, title)
|
generate_documents(session_tc_format, scenes, adr_lines,
|
||||||
|
title)
|
||||||
|
|
||||||
|
|
||||||
def perform_adr_validations(lines: Iterator[ADRLine]):
|
def perform_adr_validations(lines: Iterator[ADRLine]):
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from parsimonious.nodes import NodeVisitor
|
from parsimonious.nodes import NodeVisitor
|
||||||
from parsimonious.grammar import Grammar
|
from parsimonious.grammar import Grammar
|
||||||
|
|
||||||
from .doc_entity import SessionDescriptor, HeaderDescriptor, TrackDescriptor,\
|
from .doc_entity import SessionDescriptor, HeaderDescriptor, TrackDescriptor, \
|
||||||
FileDescriptor, TrackClipDescriptor, ClipDescriptor, PluginDescriptor,\
|
FileDescriptor, TrackClipDescriptor, ClipDescriptor, PluginDescriptor, \
|
||||||
MarkerDescriptor
|
MarkerDescriptor
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from .__init__ import make_doc_template
|
|||||||
from reportlab.lib.units import inch
|
from reportlab.lib.units import inch
|
||||||
from reportlab.lib.pagesizes import letter
|
from reportlab.lib.pagesizes import letter
|
||||||
|
|
||||||
from reportlab.platypus import Paragraph, Spacer, KeepTogether, Table,\
|
from reportlab.platypus import Paragraph, Spacer, KeepTogether, Table, \
|
||||||
HRFlowable
|
HRFlowable
|
||||||
from reportlab.lib.styles import getSampleStyleSheet
|
from reportlab.lib.styles import getSampleStyleSheet
|
||||||
from reportlab.lib import colors
|
from reportlab.lib import colors
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ classifiers = [
|
|||||||
"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",
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"Topic :: Text Processing :: Filters"
|
"Topic :: Text Processing :: Filters"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user