Exemple #1
0
    def GenerateAppYamlString(self,
                              basepath,
                              static_file_list,
                              api_version=None):
        """Constructs an app.yaml string equivalent to the XML files under WEB-INF.

    Args:
      basepath: a string that is the path to the WEB-INF directory. This
        might not be self.basepath, because it might be a staging directory.
      static_file_list: a list of strings that are the absolute path names of
        static file resources.
      api_version: a string that is the Java API version number, or None if
        not known or relevant.

    Returns:
      A string that would have the same effect as the XML files under WEB-INF
      if it were the contents of an app.yaml file.
    """
        backends = []
        if os.path.isfile(
                os.path.join(self.basepath, 'WEB-INF', 'backends.xml')):
            backends = self._ReadBackendsXml(basepath)
        return yaml_translator.AppYamlTranslator(self.app_engine_web_xml,
                                                 backends, self.web_xml,
                                                 static_file_list,
                                                 api_version).GetYaml()
    def GenerateAppYamlString(self, static_file_list, api_version=None):
        """Constructs an app.yaml string equivalent to the XML files under WEB-INF.

    Args:
      static_file_list: a list of strings that are the absolute path names of
        static file resources.
      api_version: a string that is the Java API version number, or None if
        not known or relevant.

    Returns:
      A string that would have the same effect as the XML files under WEB-INF
      if it were the contents of an app.yaml file.
    """
        return yaml_translator.AppYamlTranslator(self.app_engine_web_xml,
                                                 self.web_xml,
                                                 static_file_list,
                                                 api_version).GetYaml()