(self, targets_path=None, template_root=None, targets_dict=None)
Constructor.

    Loads targets file.

    Args:
      targets_path: (str) Path to targets file. Defaults to './targets.json'
      template_root: (str) Path to template root. Defaults to '.'
      targets_dict: (dict) Initial data, if not supplied from a file.

    Raises:
      ValueError: if the targets file does not contain the required sections.
Constructor.
Constructor .
def __init__(self, targets_path=None, template_root=None, targets_dict=None):
    """Constructor.

    Loads targets file.

    Args:
      targets_path: (str) Path to targets file. Defaults to './targets.json'
      template_root: (str) Path to template root. Defaults to '.'
      targets_dict: (dict) Initial data, if not supplied from a file.

    Raises:
      ValueError: if the targets file does not contain the required sections.
    """
    self.template_root = template_root or Targets._default_template_root
    self.targets_path = targets_path or os.path.join(self.template_root,
                                                     'targets.json')
    if targets_dict:
      self._targets_dict = targets_dict
    else:
      self._targets_dict = json_with_comments.Loads(
          files.GetFileContents(self.targets_path))

    # Do some basic validation that this has the required fields
    if 'languages' not in self._targets_dict:
      raise ValueError('languages not in targets.json')
def __init__ ( self , targets_path = None , template_root = None , targets_dict = None ) : self . template_root = template_root or Targets . _default_template_root self . targets_path = targets_path or os . path . join ( self . template_root , 'targets.json' ) if targets_dict : self . _targets_dict = targets_dict else : self . _targets_dict = json_with_comments . Loads ( files . GetFileContents ( self . targets_path ) ) # Do some basic validation that this has the required fields if 'languages' not in self . _targets_dict : raise ValueError ( 'languages not in targets.json' )