parameters: (self)
docstring: Compile the exam as a directory on the filesystem
docstring_summary: Compile the exam as a directory on the filesystem
docstring_tokens: Compile the exam as a directory on the filesystem
function: def compileToDir(self):
          """
              Compile the exam as a directory on the filesystem
          """
          if self.options.action == 'clean':
              try:
                  shutil.rmtree(self.options.output)
              except OSError:
                  pass
  
          outpath = Path(self.options.output)
  
          outpath.mkdir(exist_ok=True,parents=True)
          
          for (dst, src) in self.files.items():
              dst = outpath / dst
              dst.parent.mkdir(exist_ok=True,parents=True)
              if isinstance(src, Path):
                  if self.options.action=='clean' or not dst.exists() or src.stat().st_mtime > dst.stat().st_mtime:
                      shutil.copyfile(src, dst)
              else:
                  shutil.copyfileobj(src, open(dst, 'w', encoding='utf-8'))
          
          print("Exam created in %s" % os.path.relpath(self.options.output))
function_tokens: def compileToDir ( self ) : if self . options . action == 'clean' : try : shutil . rmtree ( self . options . output ) except OSError : pass outpath = Path ( self . options . output ) outpath . mkdir ( exist_ok = True , parents = True ) for ( dst , src ) in self . files . items ( ) : dst = outpath / dst dst . parent . mkdir ( exist_ok = True , parents = True ) if isinstance ( src , Path ) : if self . options . action == 'clean' or not dst . exists ( ) or src . stat ( ) . st_mtime > dst . stat ( ) . st_mtime : shutil . copyfile ( src , dst ) else : shutil . copyfileobj ( src , open ( dst , 'w' , encoding = 'utf-8' ) ) print ( "Exam created in %s" % os . path . relpath ( self . options . output ) )