Use Python docsctrings

pull/3/head
Dave Page 2015-01-21 12:00:13 +00:00
parent df5054f253
commit 7fa40d7671
3 changed files with 13 additions and 9 deletions

View File

@ -5,10 +5,12 @@
# Copyright (C) 2013 - 2014, The pgAdmin Development Team # Copyright (C) 2013 - 2014, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence # 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 import os, sys
# We need to include the root directory in sys.path to ensure that we can # We need to include the root directory in sys.path to ensure that we can

View File

@ -5,10 +5,11 @@
# Copyright (C) 2013 - 2014, The pgAdmin Development Team # Copyright (C) 2013 - 2014, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence # 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 import inspect, logging, os
from flask import Flask from flask import Flask
@ -16,8 +17,8 @@ from flask import Flask
import config import config
def create_app(app_name=config.APP_NAME): def create_app(app_name=config.APP_NAME):
"""Create the Flask application, startup logging and dynamically load
# Setup the app object additional modules (blueprints) that are found in this directory."""
app = Flask(__name__, static_url_path='') app = Flask(__name__, static_url_path='')
app.config.from_object(config) app.config.from_object(config)

View File

@ -5,10 +5,9 @@
# Copyright (C) 2013 - 2014, The pgAdmin Development Team # Copyright (C) 2013 - 2014, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence # 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' MODULE_NAME = 'utils'
import config import config
@ -23,7 +22,7 @@ blueprint = Blueprint(MODULE_NAME, __name__, static_folder='static', static_url
########################################################################## ##########################################################################
@blueprint.route("/test") @blueprint.route("/test")
def test(): def test():
"""Generate a simple test page to demonstrate that output can be rendered."""
output = """ output = """
Today is <b>%s</b> Today is <b>%s</b>
<br /> <br />
@ -38,4 +37,6 @@ Today is <b>%s</b>
########################################################################## ##########################################################################
@blueprint.route("/ping") @blueprint.route("/ping")
def ping(): def ping():
"""Generate a "PING" response to indicate that the server is alive."""
return "PING" return "PING"