OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, filename, mode="r", encoding=None, errors="strict", atomic=False) |
def | __getattr__ (self, name) |
def | __repr__ (self) |
def | open (self) |
def | close (self) |
def | close_intelligently (self) |
def | __enter__ (self) |
def | __exit__ (self, exc_type, exc_value, tb) |
def | __iter__ (self) |
Data Fields | |
name | |
mode | |
encoding | |
errors | |
atomic | |
should_close | |
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.
def __init__ | ( | self, | |
filename, | |||
mode = "r" , |
|||
encoding = None , |
|||
errors = "strict" , |
|||
atomic = False |
|||
) |
def __enter__ | ( | self | ) |
def __exit__ | ( | self, | |
exc_type, | |||
exc_value, | |||
tb | |||
) |
def __getattr__ | ( | self, | |
name | |||
) |
def __iter__ | ( | self | ) |
def __repr__ | ( | self | ) |
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 :exc:`FileError`. Not handling this error will produce an error that Click shows.
atomic |
encoding |
errors |
mode |
name |
should_close |