Merges split files back into a single TRS file.
More...
|
def | __init__ |
| Constructor. More...
|
|
def | merge |
| Performs the acutal merger, writing the results to a destination file with the name "<old name>-merged.trs". More...
|
|
Merges split files back into a single TRS file.
Definition at line 155 of file trs_splitter.py.
def parsers.trs_splitter.TRSMerger.__init__ |
( |
|
self, |
|
|
|
src_dir |
|
) |
| |
Constructor.
- Parameters
-
self | |
src_dir | (string) full path to the directory containing the split files |
Definition at line 159 of file trs_splitter.py.
def parsers.trs_splitter.TRSMerger._cmp_filenames |
( |
|
self, |
|
|
|
x, |
|
|
|
y |
|
) |
| |
|
private |
This comparison function is used to sort the split files into ascending order before they are merged.
This is done using the index appended to the end of the filename by the splitter app.
- Parameters
-
self | |
x | (string) filename number one |
y | (string) filename number two |
- Returns
- (int) 0 if names are identical, -1 if filename x should come before filename y, 1 if filename x should come after filename y
Definition at line 247 of file trs_splitter.py.
def parsers.trs_splitter.TRSMerger._get_void_speaker_id |
( |
|
self, |
|
|
|
tree |
|
) |
| |
|
private |
Finds the id number of the VOID speaker that was inserted when the original TRS file was split (see TRSSplitter class)
- Parameters
-
self | |
tree | (etree ElementTree) The XML tree object to search. |
- Returns
- (int) the id of the void speaker, as determined from the "Speaker" tag (which lists all speakers in the file)
Definition at line 172 of file trs_splitter.py.
def parsers.trs_splitter.TRSMerger._remove_void_speaker |
( |
|
self, |
|
|
|
tree |
|
) |
| |
|
private |
Removes the void speaker from the given XML tree.
- Parameters
-
self | |
tree | (etree ElementTree) the XML tree to search |
Definition at line 188 of file trs_splitter.py.
def parsers.trs_splitter.TRSMerger.merge |
( |
|
self, |
|
|
|
progress_update_fcn = None |
|
) |
| |
Performs the acutal merger, writing the results to a destination file with the name "<old name>-merged.trs".
- Parameters
-
self | |
progress_update_fcn | (function=None) function that updates the progress bar, accepting a single parameter, a real number in [0.0, 1.0] |
Definition at line 204 of file trs_splitter.py.
parsers.trs_splitter.TRSMerger.filename_base |
parsers.trs_splitter.TRSMerger.split_files |
parsers.trs_splitter.TRSMerger.src_dir |
The documentation for this class was generated from the following file: