mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Fixed errors with track_index field
In tests
This commit is contained in:
@@ -108,8 +108,12 @@ def parse_document(session_text: str) -> SessionDescriptor:
|
||||
|
||||
class DocParserVisitor(NodeVisitor):
|
||||
|
||||
@staticmethod
|
||||
def visit_document(_, visited_children) -> SessionDescriptor:
|
||||
def __init__(self):
|
||||
self.track_index = 0
|
||||
|
||||
# @staticmethod
|
||||
def visit_document(self, _, visited_children) -> SessionDescriptor:
|
||||
self.track_index = 0
|
||||
files = next(iter(visited_children[1]), None)
|
||||
clips = next(iter(visited_children[2]), None)
|
||||
plugins = next(iter(visited_children[3]), None)
|
||||
@@ -196,8 +200,8 @@ class DocParserVisitor(NodeVisitor):
|
||||
def visit_frame_rate(node, _):
|
||||
return node.text
|
||||
|
||||
def visit_track_listing(self, _, visited_children):
|
||||
self.track_index = 0
|
||||
@staticmethod
|
||||
def visit_track_listing(_, visited_children):
|
||||
return visited_children[1]
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -88,7 +88,9 @@ class TestTagCompiler(unittest.TestCase):
|
||||
state='Unmuted',
|
||||
timestamp=None),
|
||||
]
|
||||
test_track = doc_entity.TrackDescriptor(name="Track 1 [A] {Color=Red} $Mode=1",
|
||||
test_track = doc_entity.TrackDescriptor(
|
||||
index=0,
|
||||
name="Track 1 [A] {Color=Red} $Mode=1",
|
||||
comments="{Comment=This is some text in the comments}",
|
||||
user_delay_samples=0,
|
||||
plugins=[],
|
||||
|
||||
Reference in New Issue
Block a user