html/html_gen.py
def find_replace(from_file: str, to_file: str, replacements: Dict[str, str]) -> None:
        """
        from_file: path of file to read from
        to_file: path of file to write in
        replacements: Map of strings to find and replace
        """
        # read template file into string, perform replacements and then write to destination file
        # in order to minimise file access time
        try:
            with open(from_file, 'r') as f:
                src = f.read()
            for placeholder in replacements.keys():
                src = src.replace(("{{ % _{}_ % }}".format(placeholder.upper())), replacements[placeholder])
            with open(to_file, 'w') as dest:
                dest.write(src)
        except Exception as e:
            raise e

        from_file: path of file to read from
        to_file: path of file to write in
        replacements: Map of strings to find and replace
        
path of file to read from
to_file: path of file to write in
replacements: Map of strings to find and replace
path of file to read from to_file : path of file to write in replacements : Map of strings to find and replace
def find_replace(from_file: str, to_file: str, replacements: Dict[str, str]) -> None:
        try:
            with open(from_file, 'r') as f:
                src = f.read()
            for placeholder in replacements.keys():
                src = src.replace(("{{ % _{}_ % }}".format(placeholder.upper())), replacements[placeholder])
            with open(to_file, 'w') as dest:
                dest.write(src)
        except Exception as e:
            raise e
def find_replace ( from_file : str , to_file : str , replacements : Dict [ str , str ] ) -> None : try : with open ( from_file , 'r' ) as f : src = f . read ( ) for placeholder in replacements . keys ( ) : src = src . replace ( ( "{{ % _{}_ % }}" . format ( placeholder . upper ( ) ) ) , replacements [ placeholder ] ) with open ( to_file , 'w' ) as dest : dest . write ( src ) except Exception as e : raise e
from_file: path of file to read from
to_file: path of file to write in
replacements: Map of strings to find and replace
from_file : path of file to read from to_file : path of file to write in replacements : Map of strings to find and replace
"""
        from_file: path of file to read from
        to_file: path of file to write in
        replacements: Map of strings to find and replace
        """ # read template file into string, perform replacements and then write to destination file # in order to minimise file access time
from_file
str
to_file
str
replacements
Dict[str, str]