class documentation

class LazyFile:

View In Hierarchy

A lazy file works like a regular file but it does not fully open the file but it does perform some basic checks early to see if the filename parameter does make sense. This is useful for safely opening files for writing.
Method __enter__ Undocumented
Method __exit__ Undocumented
Method __getattr__ Undocumented
Method __init__ Undocumented
Method __iter__ Undocumented
Method __repr__ Undocumented
Method close Closes the underlying file, no matter what.
Method close​_intelligently This function only closes the file if it was opened by the lazy file wrapper. For instance this will never close stdin.
Method open Opens the file if it's not yet open. This call might fail with a FileError. Not handling this error will produce an error that Click shows.
Instance Variable ​_f Undocumented
Instance Variable atomic Undocumented
Instance Variable encoding Undocumented
Instance Variable errors Undocumented
Instance Variable mode Undocumented
Instance Variable name Undocumented
Instance Variable should​_close Undocumented
def __enter__(self):

Undocumented

Returns
LazyFileUndocumented
def __exit__(self, exc_type, exc_value, tb):

Undocumented

def __getattr__(self, name):

Undocumented

Parameters
name:strUndocumented
Returns
t.AnyUndocumented
def __init__(self, filename, mode='r', encoding=None, errors='strict', atomic=False):

Undocumented

Parameters
filename:strUndocumented
mode:strUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
atomic:boolUndocumented
def __iter__(self):

Undocumented

Returns
t.Iterator[t.AnyStr]Undocumented
def __repr__(self):

Undocumented

Returns
strUndocumented
def close(self):
Closes the underlying file, no matter what.
def close_intelligently(self):
This function only closes the file if it was opened by the lazy file wrapper. For instance this will never close stdin.
def open(self):
Opens the file if it's not yet open. This call might fail with a FileError. Not handling this error will produce an error that Click shows.
Returns
t.IOUndocumented
_f =

Undocumented

atomic =

Undocumented

encoding =

Undocumented

errors =

Undocumented

mode =

Undocumented

name =

Undocumented

should_close =

Undocumented