Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
click.utils.LazyFile Class Reference

Public Member Functions

 __init__ (self, str|os.PathLike[str] filename, str mode="r", str|None encoding=None, str|None errors="strict", bool atomic=False)
 
t.Any __getattr__ (self, str name)
 
str __repr__ (self)
 
t.IO[t.Any] open (self)
 
None close (self)
 
None close_intelligently (self)
 
LazyFile __enter__ (self)
 
None __exit__ (self, type[BaseException]|None exc_type, BaseException|None exc_value, TracebackType|None tb)
 
cabc.Iterator[t.AnyStr] __iter__ (self)
 

Public Attributes

 mode
 
 encoding
 
 errors
 
 atomic
 
 name
 
 should_close
 

Protected Attributes

 _f
 

Detailed Description

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.

Member Function Documentation

◆ close()

None click.utils.LazyFile.close (   self)
Closes the underlying file, no matter what.

◆ close_intelligently()

None click.utils.LazyFile.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.

◆ open()

t.IO[t.Any] click.utils.LazyFile.open (   self)
Opens the file if it's not yet open.  This call might fail with
a :exc:`FileError`.  Not handling this error will produce an error
that Click shows.

The documentation for this class was generated from the following file: