MCPcopy
hub / github.com/csev/py4e / split

Method split

lectures/srt-split/pysrt/commands.py:162–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 self.input_file.write_into(self.output_file)
161
162 def split(self):
163 limits = [0] + self.arguments.limits + [self.input_file[-1].end.ordinal + 1]
164 base_name, extension = os.path.splitext(self.arguments.file)
165 for index, (start, end) in enumerate(zip(limits[:-1], limits[1:])):
166 file_name = '%s.%s%s' % (base_name, index + 1, extension)
167 part_file = self.input_file.slice(ends_after=start, starts_before=end)
168 part_file.shift(milliseconds=-start)
169 part_file.clean_indexes()
170 part_file.save(path=file_name, encoding=self.output_encoding)
171
172 def create_backup(self):
173 backup_file = self.arguments.file + self.BACKUP_EXTENSION

Callers 15

updateLinesNoUndoFunction · 0.80
codemirrorepl.jsFile · 0.80
repl.jsFile · 0.80
wordsFunction · 0.80
codemirror.jsFile · 0.80
joinClassesFunction · 0.80
skulpt.jsFile · 0.80
renameByPartsFunction · 0.80
resolveFunction · 0.80
formatFunction · 0.80
CompilerFunction · 0.80
skulpt.min.jsFile · 0.80

Calls 4

sliceMethod · 0.80
clean_indexesMethod · 0.80
shiftMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected