Module Expr Str Assign NameStore Str Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str If NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareNotIn Str AttributeLoad NameLoad attr body Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad If UnaryOpNot NameLoad body Return NameLoad Return Call NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index Str decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Str Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return CompareIn NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore BoolOpOr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Str NameLoad orelse Assign NameStore NameLoad If UnaryOpNot NameLoad body Assign NameStore BoolOpOr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad Dict attr Str NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Call AttributeLoad NameLoad attr Str body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr BoolOpOr NameLoad Dict Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr Str ListLoad body Assign NameStore SubscriptLoad NameLoad Index Str If BoolOpOr CompareIn Str NameLoad CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If BoolOpOr CompareIn Str NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad For NameStore BoolOpOr NameLoad ListLoad body For NameStore BoolOpOr Call AttributeLoad NameLoad attr Str ListLoad body Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpAnd NameLoad BoolOpOr CompareIs NameLoad NameLoad CompareEq NameLoad Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad For NameStore Call AttributeLoad NameLoad attr Str ListLoad body For NameStore BoolOpOr Call AttributeLoad NameLoad attr Str ListLoad body Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot NameLoad body Return ListLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Return BinOpSub NameLoad NameLoad decorator_list decorator_list
N/A N/A Targets class describes which languages/platforms we support. N/A __author__ wclarkso@google.com (Will Clarkson) N/A logging N/A os googleapis.codegen.filesys files googleapis.codegen.utilities json_expander googleapis.codegen.utilities json_with_comments Targets N/A object N/A N/A Targets maintains the list of possible target options.

  Reads targets.json file in local directory. This file is formatted
  as:
  {
  'languages': {
    'languageA': {
      'surface_option1': {
        'path': 'stable',
        'description': 'something about language A',
        'displayName': 'SurfaceOption1',
      },
      'surface_option2': {
        'path': 'experimental',
        'description': 'something about language A',
        'displayName': 'SurfaceOption2',
        'platforms': ['cmd-line'],
      }
     },
    'languageB': {
      ...
    }, ...
    },
  'platforms': {
    'cmd-line': {
      'displayName': 'Pretty Platform Name'
    }
   }
  }
   __init__ N/A N/A self targets_path template_root targets_dict N/A None None None N/A N/A 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.
     N/A N/A self template_root N/A template_root N/A Targets _default_template_root N/A N/A self targets_path N/A targets_path N/A N/A N/A os path join N/A self template_root targets.json N/A targets_dict N/A N/A N/A self _targets_dict targets_dict N/A N/A N/A self _targets_dict N/A N/A json_with_comments Loads N/A N/A files GetFileContents N/A self targets_path N/A N/A languages N/A self _targets_dict N/A N/A N/A ValueError languages not in targets.json N/A Dict N/A N/A self N/A N/A N/A The targets.json file as a dictionary. N/A N/A self _targets_dict N/A VariationsForLanguage N/A N/A self language N/A N/A N/A language_def N/A N/A N/A N/A self _targets_dict N/A languages get language N/A N/A language_def N/A N/A None N/A N/A Variations self language N/A language_def N/A variations N/A GetLanguage N/A N/A self language N/A N/A N/A N/A N/A N/A self _targets_dict N/A languages N/A language N/A Languages N/A N/A self N/A N/A N/A N/A N/A self _targets_dict N/A languages N/A Platforms N/A N/A self N/A N/A N/A N/A N/A N/A self _targets_dict get platforms N/A N/A SetDefaultTemplateRoot N/A N/A path N/A N/A N/A Sets a new default full path to the templates directory.

    Args:
      path: (str) full path to templates directory.
     N/A N/A N/A logging info setting default template root to %s path N/A N/A Targets _default_template_root path N/A staticmethod GetDefaultTemplateRoot N/A N/A N/A N/A N/A N/A Targets _default_template_root N/A staticmethod N/A _default_template_root N/A N/A N/A os path join N/A N/A N/A os path dirname __file__ languages N/A use_versioned_paths False SetUseVersionedPaths N/A N/A use_versioned_paths N/A N/A N/A Sets whether versions are used in the template path. N/A N/A Targets use_versioned_paths use_versioned_paths N/A staticmethod N/A Variations N/A dict N/A N/A A set of variations available for a particular language. __init__ N/A N/A self targets language variations_dict N/A N/A N/A N/A N/A N/A super Variations self __init__ variations_dict N/A N/A self _targets targets N/A N/A self _language language N/A IsValid N/A N/A self variation N/A N/A N/A Test is a variation exists. N/A N/A variation self N/A _RelativeTemplateDir N/A N/A self variation N/A N/A N/A Returns the path to template dir for the selected variation.

    By default, the path is the same as the variation name. It can be
    overridden in two ways, of descending precedence:
      1. by the 'releaseVersion' element, if use_versioned_paths is set.
      2. with an explicit 'path' statement.

    Args:
      variation: (str) A target variation name.
    Returns:
      (str) Relative path to template directory.
     N/A N/A N/A self _targets use_versioned_paths N/A N/A path N/A N/A N/A N/A self N/A variation get releaseVersion variation N/A N/A path None N/A N/A path N/A N/A path N/A N/A N/A N/A N/A self get variation N/A get path variation N/A N/A N/A N/A os path join N/A self _language path N/A AbsoluteTemplateDir N/A N/A self variation N/A N/A N/A Returns the path to template dir for the selected variation.

    Args:
      variation: (str) A target variation name.
    Returns:
      (str) Absolute path to template directory.
     N/A N/A N/A N/A os path join N/A N/A self _targets template_root N/A N/A self _RelativeTemplateDir variation N/A GetFeaturesForReleaseVersion N/A N/A self release_version N/A N/A N/A name self N/A N/A features N/A N/A self GetFeatures name N/A N/A release_version N/A N/A features get releaseVersion N/A N/A features N/A None N/A GetFeatures N/A N/A self variation N/A N/A N/A Returns the features dictionary for a specific variation.

    This is the basic dictionary informaion plus any specific overrides in
    the per-template-tree features.json file.

    Args:
      variation: (str) A target variation name.
    Returns:
      (Features) features dictionary
     N/A N/A variation N/A N/A None N/A template_dir N/A N/A self AbsoluteTemplateDir variation N/A features N/A Features template_dir N/A N/A self get variation variation N/A json_path N/A N/A N/A os path join template_dir features.json N/A N/A N/A features_json N/A N/A files GetFileContents json_path N/A N/A N/A N/A files FileDoesNotExist N/A N/A features N/A N/A N/A features update N/A N/A json_expander ExpandJsonTemplate N/A N/A json_with_comments Loads features_json N/A N/A N/A N/A features get releaseVersion N/A N/A N/A features N/A releaseVersion variation N/A features N/A N/A Features N/A dict N/A N/A A dictionary describing the features of a particular API variation. __init__ N/A N/A self template_dir initial_content name N/A None None N/A N/A N/A N/A N/A super Features self __init__ N/A initial_content N/A N/A N/A self name name N/A N/A self template_dir template_dir N/A N/A path self N/A N/A N/A self N/A path N/A N/A N/A os path basename template_dir N/A DependenciesForEnvironment N/A N/A self environment N/A None N/A N/A Returns the list of dependencies for an environment.

    Given an environment:
       build the list of dependencies required for that environment. This
         includes elements marked as all (platform='*') and ones specifically
         mentioning that environment.
       build the list of optional packages which might be useful to your app.
         That is, everything marked generic, but not in the first list.
       build the list of everything excluded from the first two sets

    Args:
      environment: (str) An environment (as per platforms.PLATFORMS). If None,
          the optional packages list will include everything that is not
          mandatory (i.e. marked with platform='*').
    Returns:
      list(dict), list(dict), list(dict): required_packages, optional_packages,
          packages we do not want.
     N/A required N/A N/A optional N/A N/A excluded N/A N/A r N/A N/A self get requires N/A N/A N/A environments N/A r N/A environments N/A N/A N/A * environments N/A environment environments N/A N/A N/A N/A required append r N/A N/A N/A N/A generic environments N/A environment N/A N/A N/A N/A optional append r N/A N/A N/A N/A excluded append r N/A N/A required optional excluded N/A ExtractPathsFromDependencies N/A N/A self dependencies file_type N/A None N/A N/A Extract the file paths from a list of dependencies.

    Args:
      dependencies: (list(str)) list of dependencies from a Features object
      file_type: (str) If specified, only extract paths for that file type.
    Returns:
      set(str): The set of file paths required for this dependency set.
     N/A ret N/A set N/A d N/A dependencies N/A N/A N/A f N/A N/A N/A d get files N/A N/A N/A p N/A N/A f get path N/A N/A p N/A N/A file_type None N/A file_type N/A N/A f get type N/A N/A N/A N/A ret add p N/A ret N/A AllDependencyPaths N/A N/A self N/A N/A N/A Returns the set of all file paths mentioned as dependencies.

    Returns:
      set(str)
     N/A ret N/A set N/A dependency N/A N/A self get requires N/A N/A N/A f N/A N/A N/A dependency get files N/A N/A N/A p N/A N/A f get path N/A p N/A N/A N/A N/A ret add p N/A ret N/A FilePathsWeDoNotDependOn N/A N/A self environment file_type N/A None None N/A N/A Returns the list of file paths which are NOT required for an environment.

    Figure out the files we need for an environment and reduce that by the
    kind of files (if we only want source or binary), then invert that list
    w.r.t. all the files mentioned in the features requirements list.

    The rationale for this function is to make it easy to find the set of
    files which should be stripped from a download, while leaving all files
    not explicitly mentioned in the features.

    Args:
      environment: (str) An environment (as per platforms.PLATFORMS). If None,
          return have the optional packages list include everything that is
          not requried.
      file_type: (str) If specified, only extract paths for that file type.
    Returns:
      list(str): The paths which are NOT required for that platform
     N/A N/A N/A environment N/A file_type N/A N/A N/A N/A N/A req _ _ N/A N/A self DependenciesForEnvironment environment environment N/A req_paths N/A N/A self ExtractPathsFromDependencies req file_type file_type N/A all_paths N/A N/A self AllDependencyPaths N/A N/A all_paths req_paths N/A N/A