From 7fa40d7671d2f27dc033634341f6b379734fc6f3 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Wed, 21 Jan 2015 12:00:13 +0000 Subject: [PATCH] Use Python docsctrings --- web/pgAdmin4.py | 6 ++++-- web/pgadmin/__init__.py | 9 +++++---- web/pgadmin/utils/views.py | 7 ++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py index c3808f9f7..81e347a7c 100644 --- a/web/pgAdmin4.py +++ b/web/pgAdmin4.py @@ -5,10 +5,12 @@ # Copyright (C) 2013 - 2014, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # -# pgAdmin4.py - Main application entry point -# ########################################################################## +"""This is the main application entry point for pgAdmin 4. If running on +a webserver, this will provide the WSGI interface, otherwise, we're going +to start a web server.""" + import os, sys # We need to include the root directory in sys.path to ensure that we can diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py index 718628f4b..67df40f91 100644 --- a/web/pgadmin/__init__.py +++ b/web/pgadmin/__init__.py @@ -5,10 +5,11 @@ # Copyright (C) 2013 - 2014, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # -# pgadmin/__init__.py - Main application startup -# ########################################################################## +"""The main pgAdmin module. This handles the application initialisation tasks, +such as setup of logging, dynamic loading of modules etc.""" + import inspect, logging, os from flask import Flask @@ -16,8 +17,8 @@ from flask import Flask import config def create_app(app_name=config.APP_NAME): - - # Setup the app object + """Create the Flask application, startup logging and dynamically load + additional modules (blueprints) that are found in this directory.""" app = Flask(__name__, static_url_path='') app.config.from_object(config) diff --git a/web/pgadmin/utils/views.py b/web/pgadmin/utils/views.py index 2a4b5872d..89f8a2e37 100644 --- a/web/pgadmin/utils/views.py +++ b/web/pgadmin/utils/views.py @@ -5,10 +5,9 @@ # Copyright (C) 2013 - 2014, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # -# utils/views.py - Utility views -# ########################################################################## +"""A blueprint module providing utility functions for the application.""" MODULE_NAME = 'utils' import config @@ -23,7 +22,7 @@ blueprint = Blueprint(MODULE_NAME, __name__, static_folder='static', static_url ########################################################################## @blueprint.route("/test") def test(): - + """Generate a simple test page to demonstrate that output can be rendered.""" output = """ Today is %s
@@ -38,4 +37,6 @@ Today is %s ########################################################################## @blueprint.route("/ping") def ping(): + """Generate a "PING" response to indicate that the server is alive.""" return "PING" +