def checkValueCommand(self):
    allowedFields = {}
    allowedFields['command']             = (str, True)
    allowedFields['apply to extensions'] = (list, False)

    # Loop over all the tool arguments looking for any with instructions on replacing a value with a command.
    for argument in self.arguments:
      observedFields = []

      # Loop over all fields in the instructions and check that they are valid.
      if self.arguments[argument].valueCommand:
        for field in self.arguments[argument].valueCommand:
  
          # If the field is invalid, terminate.
          if field not in allowedFields: print('ERROR - checkValueCommand'); exit(1)
  
          # Check that the field has the correct type.
          setValue = self.arguments[argument].valueCommand[field]
          value    = str(setValue) if isinstance(setValue, unicode) else setValue
          if allowedFields[field][0] != type(value): print('ERROR - checkValueCommand - type', field); exit(1)
  
          # Record the field as having been observed.
          observedFields.append(field)
  
          # If the field 'apply to extensions' is set, check that all supplied extensions are valid for the argument.
          if field == 'apply to extensions':
            for extension in self.arguments[argument].valueCommand[field]:
              if extension not in self.arguments[argument].extensions: print('ERROR - checkValueCommand - invalid extension'); exit(1)
  
        # Check that all required fields have been set.
        for field in allowedFields.keys():
          if allowedFields[field][1] and field not in observedFields: print('ERROR - checkValueCommand - missing', field); exit(1)

    return True

  # Check that the 'argument order' list is complete and valid.
dataset/ETHPy150Open gkno/gkno_launcher/src/gkno/toolConfiguration.py/toolConfiguration.checkValueCommand/original