parameters: (self, file)
docstring: Writes the cmd cmd_flags constant.
docstring_summary: Writes the cmd cmd_flags constant.
docstring_tokens: Writes the cmd cmd_flags constant .
function: def WriteCmdFlag(self, file):
      """Writes the cmd cmd_flags constant."""
      flags = []
      trace_level = 3  # By default trace only at the highest level
      if hasattr(self.info, 'trace_level'):
        if (self.info.trace_level < 0) or (self.info.trace_level > 3):
          raise KeyError("Unhandled trace_level: %d" % self.info.trace_level)
        trace_level = self.info.trace_level
  
      flags.append('CMD_FLAG_SET_TRACE_LEVEL(%d)' % trace_level)
  
      if len(flags) > 0:
        cmd_flags = ' | '.join(flags)
      else:
        cmd_flags = 0
  
      file.Write("  static const uint8 cmd_flags = %s;\n" % cmd_flags)
function_tokens: def WriteCmdFlag ( self , file ) : flags = [ ] trace_level = 3 # By default trace only at the highest level if hasattr ( self . info , 'trace_level' ) : if ( self . info . trace_level < 0 ) or ( self . info . trace_level > 3 ) : raise KeyError ( "Unhandled trace_level: %d" % self . info . trace_level ) trace_level = self . info . trace_level flags . append ( 'CMD_FLAG_SET_TRACE_LEVEL(%d)' % trace_level ) if len ( flags ) > 0 : cmd_flags = ' | ' . join ( flags ) else : cmd_flags = 0 file . Write ( "  static const uint8 cmd_flags = %s;\n" % cmd_flags )