BaseResourceHandle

class lsst.resources._resourceHandles._baseResourceHandle.BaseResourceHandle(mode: str, log: Logger, *, newline: AnyStr | None = None)

Bases: ABC, ResourceHandleProtocol[U]

Base class interface for the handle like interface of ResourcePath subclasses.

Parameters:
modestr

Handle modes as described in the python io module.

logLogger

Logger to used when writing messages.

newlinestr

When doing multiline operations, break the stream on given character Defaults to newline.

Notes

Documentation on the methods of this class line should refer to the corresponding methods in the io module.

Attributes Summary

closed

isatty

mode

Methods Summary

close()

fileno()

flush()

read([size])

readable()

readline([size])

readlines([hint])

seek(offset[, whence])

seekable()

tell()

truncate([size])

writable()

write(b, /)

writelines(lines, /)

Attributes Documentation

closed
isatty
mode

Methods Documentation

abstract close() None
abstract fileno() int
abstract flush() None
abstract read(size: int = -1) U
abstract readable() bool
abstract readline(size: int = -1) U
abstract readlines(hint: int = -1) Iterable[U]
abstract seek(offset: int, whence: int = 0, /) int
abstract seekable() bool
abstract tell() int
abstract truncate(size: int | None = None) int
abstract writable() bool
abstract write(b: U, /) int
abstract writelines(lines: Iterable[U], /) None