CMS 3D CMS Logo

edmMakeTracerViewerServer.py
Go to the documentation of this file.
1 import os
2 import shutil
3 import argparse
4 
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 
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 
33 if __name__ == "__main__":
34  main()
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
Definition: main.py:1