parameters: (self, obj, topology_model)
docstring: Defined to generate files for generated code products.
          @param obj: the instance of the event model to visit.
docstring_summary: Defined to generate files for generated code products.
docstring_tokens: Defined to generate files for generated code products .
function: def DictStartVisit(self, obj, topology_model):
          """
          Defined to generate files for generated code products.
          @param obj: the instance of the event model to visit.
          """
  
          # Build filename here...
          # Make dictionary directly if it doesn't exist
          output_dir = os.environ["DICT_DIR"] + "/events"
          if not (os.path.isdir(output_dir)):
              os.makedirs(output_dir)
              init_file = os.path.join(output_dir, "__init__.py")
              open(init_file, "w+").close()
  
          self.__fp = {}
  
          try:
              instance_obj_list = topology_model.get_base_id_dict()[
                  obj.get_component_base_name()
              ]
          except Exception:
              PRINT.info(
                  "ERROR: Could not find instance object for component "
                  + obj.get_component_base_name()
                  + ". Check topology model to see if the component was instanced."
              )
              raise
  
          for instance_obj in instance_obj_list:
              if instance_obj[3].get_dict_short_name() is not None:
                  fname = "{}_{}".format(
                      instance_obj[3].get_dict_short_name(), obj.get_name()
                  )
              elif (
                  not topology_model.get_prepend_instance_name()
                  and len(instance_obj_list) == 1
              ):
                  fname = obj.get_name()
              else:
                  fname = "{}_{}".format(instance_obj[0], obj.get_name())
  
              pyfile = "{}/{}.py".format(output_dir, fname)
              DEBUG.info("Open file: {}".format(pyfile))
              fd = open(pyfile, "w")
              if fd is None:
                  raise Exception("Could not open {} file.".format(pyfile))
              DEBUG.info("Completed {} open".format(pyfile))
              self.__fp[fname] = fd
function_tokens: def DictStartVisit ( self , obj , topology_model ) : # Build filename here... # Make dictionary directly if it doesn't exist output_dir = os . environ [ "DICT_DIR" ] + "/events" if not ( os . path . isdir ( output_dir ) ) : os . makedirs ( output_dir ) init_file = os . path . join ( output_dir , "__init__.py" ) open ( init_file , "w+" ) . close ( ) self . __fp = { } try : instance_obj_list = topology_model . get_base_id_dict ( ) [ obj . get_component_base_name ( ) ] except Exception : PRINT . info ( "ERROR: Could not find instance object for component " + obj . get_component_base_name ( ) + ". Check topology model to see if the component was instanced." ) raise for instance_obj in instance_obj_list : if instance_obj [ 3 ] . get_dict_short_name ( ) is not None : fname = "{}_{}" . format ( instance_obj [ 3 ] . get_dict_short_name ( ) , obj . get_name ( ) ) elif ( not topology_model . get_prepend_instance_name ( ) and len ( instance_obj_list ) == 1 ) : fname = obj . get_name ( ) else : fname = "{}_{}" . format ( instance_obj [ 0 ] , obj . get_name ( ) ) pyfile = "{}/{}.py" . format ( output_dir , fname ) DEBUG . info ( "Open file: {}" . format ( pyfile ) ) fd = open ( pyfile , "w" ) if fd is None : raise Exception ( "Could not open {} file." . format ( pyfile ) ) DEBUG . info ( "Completed {} open" . format ( pyfile ) ) self . __fp [ fname ] = fd