CMS 3D CMS Logo

Functions
edmMakeTracerViewerServer Namespace Reference

Functions

def copy_directory_content (src, dest)
 
def main ()
 

Function Documentation

◆ copy_directory_content()

def edmMakeTracerViewerServer.copy_directory_content (   src,
  dest 
)
Copies all content from the source directory to the destination directory.

Definition at line 5 of file edmMakeTracerViewerServer.py.

Referenced by main().

5 def copy_directory_content(src, dest):
6  """
7  Copies all content from the source directory to the destination directory.
8  """
9  if not os.path.exists(dest):
10  os.makedirs(dest)
11 
12  for item in os.listdir(src):
13  src_path = os.path.join(src, item)
14  dest_path = os.path.join(dest, item)
15 
16  if os.path.isdir(src_path):
17  shutil.copytree(src_path, dest_path)
18  else:
19  shutil.copy2(src_path, dest_path)
20 

◆ main()

def edmMakeTracerViewerServer.main ( )

Definition at line 21 of file edmMakeTracerViewerServer.py.

References copy_directory_content(), and print().

21 def main():
22  parser = argparse.ArgumentParser(description='Copy contents of a directory to a specified target directory.')
23  parser.add_argument('target_directory', type=str, help='The target directory where content will be copied.')
24 
25  args = parser.parse_args()
26 
27  current_directory = os.path.dirname(os.path.abspath(__file__)) # Get the directory where the script is located
28  target_directory = args.target_directory
29 
30  copy_directory_content(current_directory, target_directory)
31  print(f"All content from {current_directory} has been copied to {target_directory}")
32 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47