OpenQuizz
Une application de gestion des contenus pédagogiques
FileOperator Class Reference
Inheritance diagram for FileOperator:
Collaboration diagram for FileOperator:

Public Member Functions

def __init__ (self, dry_run=False)
 
def record_as_written (self, path)
 
def newer (self, source, target)
 
def copy_file (self, infile, outfile, check=True)
 
def copy_stream (self, instream, outfile, encoding=None)
 
def write_binary_file (self, path, data)
 
def write_text_file (self, path, data, encoding)
 
def set_mode (self, bits, mask, files)
 
def ensure_dir (self, path)
 
def byte_compile (self, path, optimize=False, force=False, prefix=None, hashed_invalidation=False)
 
def ensure_removed (self, path)
 
def is_writable (self, path)
 
def commit (self)
 
def rollback (self)
 

Data Fields

 dry_run
 
 ensured
 
 record
 
 files_written
 
 dirs_created
 

Static Public Attributes

 set_executable_mode
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  dry_run = False 
)

Member Function Documentation

◆ byte_compile()

def byte_compile (   self,
  path,
  optimize = False,
  force = False,
  prefix = None,
  hashed_invalidation = False 
)

◆ commit()

def commit (   self)
Commit recorded changes, turn off recording, return
changes.

◆ copy_file()

def copy_file (   self,
  infile,
  outfile,
  check = True 
)
Copy a file respecting dry-run and force flags.

◆ copy_stream()

def copy_stream (   self,
  instream,
  outfile,
  encoding = None 
)

◆ ensure_dir()

def ensure_dir (   self,
  path 
)

◆ ensure_removed()

def ensure_removed (   self,
  path 
)

◆ is_writable()

def is_writable (   self,
  path 
)

◆ newer()

def newer (   self,
  source,
  target 
)
Tell if the target is newer than the source.

Returns true if 'source' exists and is more recently modified than
'target', or if 'source' exists and 'target' doesn't.

Returns false if both exist and 'target' is the same age or younger
than 'source'. Raise PackagingFileError if 'source' does not exist.

Note that this test is not very accurate: files created in the same
second will have the same "age".

◆ record_as_written()

def record_as_written (   self,
  path 
)

◆ rollback()

def rollback (   self)

◆ set_mode()

def set_mode (   self,
  bits,
  mask,
  files 
)

◆ write_binary_file()

def write_binary_file (   self,
  path,
  data 
)

◆ write_text_file()

def write_text_file (   self,
  path,
  data,
  encoding 
)

Field Documentation

◆ dirs_created

dirs_created

◆ dry_run

dry_run

◆ ensured

ensured

◆ files_written

files_written

◆ record

record

◆ set_executable_mode

set_executable_mode
static

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