Webware for Python

763 Words2 Pages

Overview

Webware for Python is a suite of Python packages and tools for developing object-oriented, web-based applications. The suite uses well known design patterns and includes a fast Application Server, Servlets, Python Server Pages (PSP), Object-Relational Mapping, Task Scheduling, Session Management, and many other features. Webware is modular and extensible.

The version of Webware currently in use at Texas Life is version 0.8. Information about Webware, including documentation and source code, is located at http://www.webwareforpython.org/.

Webware Scripts

Organization & Script Location

Each of the three web servers - WebProd, WebModel, and WebDevelop - has dedicated programs for running each individual web system. These programs are contained in the Context/ directory for each web server, /WebApp/webserver/Context/. Development is done in /WebApp/WebDevelop/Context/; model testing is done in /WebApp/WebModel/Context/; and production is in /WebApp/WebProd/Context/. Only WebDevelop is accessible by all programmers.

Each web system - eg, Agency, WebBill, etc - is contained in a sub-directory of Context/. The name of the sub-directory identifies which web system's files it contains; for example, /WebApp/webserver/Context/Agency/ contains all the files specifically for running the Agent Support pages. These directories also contain the .pyc file(s) which are created when a Python program is executed.

The Context/ directory itself contains files related to ALL web systems. Changes made to files there affect every web system. Because of this, files in the Context/ directory may not be modified by regular programmers. ANY changes to those files must be approved in advance and installed by the web syst...

... middle of paper ...

...k.

Use Strings for Accumulating HTML Code

Do not use multiple write or writeln statements when writing HTML code in a Webware servlet except where absolutely necessary. Excessive use of write and writeln slows down creation of the HTML page being served to the client. Instead, whenever possible, create a string variable to accumulate the HTML code and use a single write statement.

Do Not Embed JavaScripts in HTML

Avoid embedded scripts whenever possible. If you must use an embedded script, immediately before the embedded script insert Python comments explaining the script's purpose and why it must be embedded.

No Viewable Comments

Do not use HTML, Javascript, or CSS comments except when you specifically want them viewable by anyone viewing the page source. Instead, use Python comments separate from the HTML to explain and document your coding.

Open Document