diff --git a/appengine/standard_python3/cloud_debugger/app.yaml b/appengine/standard_python3/cloud_debugger/app.yaml deleted file mode 100644 index 0ac1ae69ea41..000000000000 --- a/appengine/standard_python3/cloud_debugger/app.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2021 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -runtime: python38 diff --git a/appengine/standard_python3/cloud_debugger/main.py b/appengine/standard_python3/cloud_debugger/main.py deleted file mode 100644 index a17b617a19a5..000000000000 --- a/appengine/standard_python3/cloud_debugger/main.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# [START gae_python38_app] -# [START gae_python3_app] -import logging - -from flask import Flask, render_template, request - -# Enable cloud debugger -try: - import googleclouddebugger - - googleclouddebugger.enable() -except ImportError: - pass - -# Adjust logging level to INFO -logging.basicConfig(level=logging.INFO) - -# If `entrypoint` is not defined in app.yaml, App Engine will look for an app -# called `app` in `main.py`. -app = Flask(__name__) - - -# There is a bug in the code. -class StringProcessor: - def __init__(self, string): - self._string = string - - def Reverse(self): - if self._string == "": - return "" - - chars = [c for c in self._string] - left = 0 - right = len(chars) - 1 - while True: - tmp = chars[left] - chars[left] = chars[right] - chars[right] = tmp - if left >= right: - break - left += 1 - right -= 1 - - return "".join(chars) - - -@app.route("/reverse_string", methods=["GET"]) -def ReverseString(): - try: - s = str(request.args.get("string")) - except Exception as e: - print(e) - return "Not a valid string!" - - current = StringProcessor(s).Reverse() - expected = s[::-1] - return render_template("index.html", current=current, expected=expected) - - -@app.route("/") -def Hello(): - """Return a friendly HTTP greeting.""" - return """ - Hello! Enter a string to reverse it. -
-

-

-

- """ - - -if __name__ == "__main__": - # This is used when running locally only. When deploying to Google App - # Engine, a webserver process such as Gunicorn will serve the app. This - # can be configured by adding an `entrypoint` to app.yaml. - app.run(host="127.0.0.1", port=8080, debug=True) -# [END gae_python3_app] -# [END gae_python38_app] diff --git a/appengine/standard_python3/cloud_debugger/noxfile_config.py b/appengine/standard_python3/cloud_debugger/noxfile_config.py deleted file mode 100644 index 43a5796d1940..000000000000 --- a/appengine/standard_python3/cloud_debugger/noxfile_config.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default TEST_CONFIG_OVERRIDE for python repos. - -# You can copy this file into your directory, then it will be imported from -# the noxfile.py. - -# The source of truth: -# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/noxfile_config.py - -TEST_CONFIG_OVERRIDE = { - # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.6", "3.10", "3.11"], - # Old samples are opted out of enforcing Python type hints - # All new samples should feature them - "enforce_type_hints": False, - # An envvar key for determining the project id to use. Change it - # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": {}, -} diff --git a/appengine/standard_python3/cloud_debugger/requirements-test.txt b/appengine/standard_python3/cloud_debugger/requirements-test.txt deleted file mode 100644 index c2845bffbe89..000000000000 --- a/appengine/standard_python3/cloud_debugger/requirements-test.txt +++ /dev/null @@ -1 +0,0 @@ -pytest==7.0.1 diff --git a/appengine/standard_python3/cloud_debugger/requirements.txt b/appengine/standard_python3/cloud_debugger/requirements.txt deleted file mode 100644 index b3b2bb77f1dd..000000000000 --- a/appengine/standard_python3/cloud_debugger/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Flask==2.1.0 -google-python-cloud-debugger==3.5 diff --git a/appengine/standard_python3/cloud_debugger/templates/index.html b/appengine/standard_python3/cloud_debugger/templates/index.html deleted file mode 100644 index 8d320223b899..000000000000 --- a/appengine/standard_python3/cloud_debugger/templates/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Reverse a String - - - - - - -
Program Output:{{ current }}
Correct Output:{{ expected }}
- -