Пример #1
0
   def clone_test(self):
      """Creates a testing clone.

      This function is supposed to be overridden by tutorials requiring more
      cloning work than `FreeFOAM.util.clone()` and `modify_for_test()`
      provide.

      """
      if _op.isdir(self.test_dir):
         _fu.remove_case(self.test_dir)
      _fu.clone_case(self.case_dir, self.test_dir)
      self.modify_for_test()
Пример #2
0
 def clone_from_parent(self, case_dir):
    """Clones the case from its parent case."""
    try:
       parent_dir = self._parent_runner.case_dir
       if not _op.isdir(_op.join(case_dir, 'system')):
          _fu.clone_case(parent_dir, case_dir, verbose=False)
       return True
    except Exception:
       import sys
       e = sys.exc_info()[1]
       _fu.cerror("Failed to clone", parent_dir, ":", str(e),
             file=sys.stderr)
       return False