From 7953adc767a9a37b0bf75ef5565c345d0ab0342e Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 5 May 2022 22:51:33 +0000 Subject: [PATCH] chore: remove obsolete samples folder --- samples/api-python-client-doc/README | 5 - samples/api-python-client-doc/app.yaml | 12 -- samples/api-python-client-doc/embed.html | 78 ----------- samples/api-python-client-doc/gadget.html | 17 --- samples/api-python-client-doc/index.html | 79 ----------- samples/api-python-client-doc/index.yaml | 11 -- samples/api-python-client-doc/main.py | 124 ------------------ .../static/preso_embed.xml | 5 - 8 files changed, 331 deletions(-) delete mode 100644 samples/api-python-client-doc/README delete mode 100644 samples/api-python-client-doc/app.yaml delete mode 100644 samples/api-python-client-doc/embed.html delete mode 100644 samples/api-python-client-doc/gadget.html delete mode 100644 samples/api-python-client-doc/index.html delete mode 100644 samples/api-python-client-doc/index.yaml delete mode 100755 samples/api-python-client-doc/main.py delete mode 100644 samples/api-python-client-doc/static/preso_embed.xml diff --git a/samples/api-python-client-doc/README b/samples/api-python-client-doc/README deleted file mode 100644 index bcbf47507e6..00000000000 --- a/samples/api-python-client-doc/README +++ /dev/null @@ -1,5 +0,0 @@ -This sample is the code that drives http://api-python-client-doc.appspot.com/ -It is an application that serves up the Python help documentation for each API. - -api: discovery -keywords: appengine diff --git a/samples/api-python-client-doc/app.yaml b/samples/api-python-client-doc/app.yaml deleted file mode 100644 index b2d087a1403..00000000000 --- a/samples/api-python-client-doc/app.yaml +++ /dev/null @@ -1,12 +0,0 @@ -application: api-python-client-doc-hrd -version: 1 -runtime: python -api_version: 1 - -handlers: -- url: /static - static_dir: static - -- url: .* - script: main.py - diff --git a/samples/api-python-client-doc/embed.html b/samples/api-python-client-doc/embed.html deleted file mode 100644 index df21c85b55f..00000000000 --- a/samples/api-python-client-doc/embed.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Google API Client for Python Documentation - - - - - - - - - - - {% for item in directory %} - - - - - - - - {% endfor %} -
APIDocumentationPyDocNameVersion
{{ item.title }}DocumentationPyDoc{{ item.name }}{{ item.version}}
- - diff --git a/samples/api-python-client-doc/gadget.html b/samples/api-python-client-doc/gadget.html deleted file mode 100644 index 1a7cb07e4e6..00000000000 --- a/samples/api-python-client-doc/gadget.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - {% for item in directory %} - - {{ item.name }} - Documentation - PyDoc - - {% endfor %} - - ]]> - - diff --git a/samples/api-python-client-doc/index.html b/samples/api-python-client-doc/index.html deleted file mode 100644 index 90cffd4a8af..00000000000 --- a/samples/api-python-client-doc/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - Google API Client for Python Documentation - - - -

Google API Client for Python Documentation

- - - - - - - - - {% for item in directory %} - - - - - - - - {% endfor %} -
APIDocumentationPyDocNameVersion
{{ item.title }}DocumentationPyDoc{{ item.name }}{{ item.version}}
- - diff --git a/samples/api-python-client-doc/index.yaml b/samples/api-python-client-doc/index.yaml deleted file mode 100644 index a3b9e05e351..00000000000 --- a/samples/api-python-client-doc/index.yaml +++ /dev/null @@ -1,11 +0,0 @@ -indexes: - -# AUTOGENERATED - -# This index.yaml is automatically updated whenever the dev_appserver -# detects that a new type of query is run. If you want to manage the -# index.yaml file manually, remove the above marker line (the line -# saying "# AUTOGENERATED"). If you want to manage some indexes -# manually, move them above the marker line. The index.yaml file is -# automatically uploaded to the admin console when you next deploy -# your application using appcfg.py. diff --git a/samples/api-python-client-doc/main.py b/samples/api-python-client-doc/main.py deleted file mode 100755 index 19ed5410753..00000000000 --- a/samples/api-python-client-doc/main.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2014 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. -# -"""Sample application for Python documentation of APIs. - -This is running live at http://api-python-client-doc.appspot.com where it -provides a list of APIs and PyDoc documentation for all the generated API -surfaces as they appear in the google-api-python-client. In addition it also -provides a Google Gadget. -""" - -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - -import httplib2 -import inspect -import json -import logging -import os -import pydoc -import re - -import describe -import uritemplate - -from googleapiclient import discovery -from googleapiclient.errors import HttpError -from google.appengine.api import memcache -from google.appengine.ext import webapp -from google.appengine.ext.webapp import template -from google.appengine.ext.webapp import util - - -DISCOVERY_URI = 'https://www.googleapis.com/discovery/v1/apis?preferred=true' - - -def get_directory_doc(): - http = httplib2.Http(memcache) - ip = os.environ.get('REMOTE_ADDR', None) - uri = DISCOVERY_URI - if ip: - uri += ('&userIp=' + ip) - resp, content = http.request(uri) - directory = json.loads(content)['items'] - for item in directory: - item['title'] = item.get('title', item.get('description', '')) - item['safe_version'] = describe.safe_version(item['version']) - return directory - - -class MainHandler(webapp.RequestHandler): - """Handles serving the main landing page. - """ - - def get(self): - directory = get_directory_doc() - path = os.path.join(os.path.dirname(__file__), 'index.html') - self.response.out.write( - template.render( - path, {'directory': directory, - })) - - -class GadgetHandler(webapp.RequestHandler): - """Handles serving the Google Gadget.""" - - def get(self): - directory = get_directory_doc() - path = os.path.join(os.path.dirname(__file__), 'gadget.html') - self.response.out.write( - template.render( - path, {'directory': directory, - })) - self.response.headers.add_header('Content-Type', 'application/xml') - - -class EmbedHandler(webapp.RequestHandler): - """Handles serving a front page suitable for embedding.""" - - def get(self): - directory = get_directory_doc() - path = os.path.join(os.path.dirname(__file__), 'embed.html') - self.response.out.write( - template.render( - path, {'directory': directory, - })) - - -class ResourceHandler(webapp.RequestHandler): - """Handles serving the PyDoc for a given collection. - """ - - def get(self, service_name, version, collection): - - return self.redirect('https://google-api-client-libraries.appspot.com/documentation/%s/%s/python/latest/%s_%s.%s.html' - % (service_name, version, service_name, version, collection)) - - -def main(): - application = webapp.WSGIApplication( - [ - (r'/', MainHandler), - (r'/_gadget/', GadgetHandler), - (r'/_embed/', EmbedHandler), - (r'/([^_]+)_([^\.]+)(?:\.(.*))?\.html$', ResourceHandler), - ], - debug=True) - util.run_wsgi_app(application) - - -if __name__ == '__main__': - main() diff --git a/samples/api-python-client-doc/static/preso_embed.xml b/samples/api-python-client-doc/static/preso_embed.xml deleted file mode 100644 index 495e4c4ec51..00000000000 --- a/samples/api-python-client-doc/static/preso_embed.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - -