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

Method _get_first_line

lectures/srt-split/pysrt/srtfile.py:265–276  ·  view source on GitHub ↗
(cls, string_iterable)

Source from the content-addressed store, hash-verified

263
264 @classmethod
265 def _get_first_line(cls, string_iterable):
266 if hasattr(string_iterable, 'tell'):
267 previous_position = string_iterable.tell()
268
269 try:
270 first_line = next(iter(string_iterable))
271 except StopIteration:
272 return ''
273 if hasattr(string_iterable, 'seek'):
274 string_iterable.seek(previous_position)
275
276 return first_line
277
278 @classmethod
279 def _detect_encoding(cls, path):

Callers 1

_guess_eolMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected