Software Components

PTOMMI applications are constructed with Python scripts. These scripts are responsible for dynamically generating HTML pages for user interaction, responding to user commands through HTML forms, performing MP3 management functions on the server side, and maintaining a persistent user state within each application.

The software included in the PTOMMI distribution can be divided into two general categories: common modules and application-specific scripts. The following sections describe the software components used to build the MPS and MTag PTOMMI applications.

3.1 Common Modules

PTOMMI scripts rely on a number of Python modules and packages to provide many of their essential functions. Besides the standard Python library of modules included with most Python distributions, the following components have either been developed as part of PTOMMI, or were provided by outside developers under GPL or compatible license. Some contributed modules have been modified from their original form to better fit the needs of PTOMMI applications. All common modules and packages are within the MPS_Core package.

3.1.1 CGI_Environ

PTOMMI module which provides CGI scripts with a number of useful methods and attributes that simplify the process of constructing CGI applications with user authentication (through cookies) and persistent storage of user state, to name just a few.

3.1.2 Cookie

Contributed module which provides CGI scripts with the ability to create and manage cookies. A version of this module is standard in Python 2.0 and later, but the version provided here is compatible with Python 1.5.2 and later (primarily for the convenience of users running earlier versions of Python).

3.1.3 Directory

PTOMMI module which provides classes for constructing, traversing, and searching a tree representation of file directory structure.

3.1.4 eyeD3

Contributed package which provides capabilities for reading and writing ID3 tag information for both ID3v1 and ID3v2 tags.

3.1.5 ezt

Contributed package which provides simple but effective HTML templating capabilities. Performs text substitution, conditional output, and iteration over list objects.

3.1.6 GLock

Contributed module which provides cross-platform (POSIX and Windows) file locking functionality.

3.1.7 MP3Tag_eyeD3

PTOMMI module which provides a wrapper class for reading song information from ID3 tags using the eyeD3 package.

3.1.8 MP3TagEdit_eyeD3

PTOMMI module which provides a wrapper class for reading and writing ID3 tag information using the eyeD3 package.

3.1.9 MReportClasses

PTOMMI module which provides class definitions for classes used in reading, writing, and processing XML report description files.

3.1.10 MReportInXML

PTOMMI module which provides methods for building a SAX parser for XML formatted report descriptions.

3.1.11 MReport2Doc

PTOMMI module which provides methods for processing report descriptions and song information to produce reports in a variety of output formats using POST.

3.1.12 PathParse

PTOMMI module which provides methods for parsing a path string into ID3 fields using a string format descriptor.

3.1.13 PathTree

PTOMMI module which provides methods used in constructing a tree representation of directory contents.

3.1.14 SongClasses

PTOMMI module which provides classes for creating various song list formats used by MPS, and functions for looking up song meta-information.

3.1.15 SonglistInXML

PTOMMI module which provides methods for reading song information from XML representations.

3.1.16 User

PTOMMI module which provides methods for establishing a user identity, creating a persistent user store, and creating and setting a browser cookie.

3.2 MPS Application Scripts

The MPS (MP3 Playlist Server) application presents to the user five different functional modes: browser, tree view, search, playlist edit, and report generation. The following sections describe the scripts used to make this happen.

3.2.1 MPS

Application-specific module which provides methods for displaying application frames and performing MPS-related functions that are used in building other MPS scripts.

3.2.2 MPS_screen.py

CGI script which services requests for generating MPS screen elements.

3.2.3 MPS_userlogin.py

CGI script which handles form inputs from the MPS login screen.

3.2.4 MPS_process_menu.py

CGI script which handles form inputs from the MPS menu screen.

3.2.5 gen_playlist.py

CGI script which takes a song path string and sends a single-item playlist to the client for that song.

3.2.6 send_playlist.py

CGI script which reads a WinAmp-style playlist file on the server, converts relative entries to absolute when possible, and sends it to the client.

3.2.7 process_treeview_view.py

CGI script which handles form inputs from the MPS treeview screen.

3.2.8 process_search_form.py

CGI script which handles form inputs from the MPS search screen.

3.2.9 process_search_query.py

CGI script which handles form inputs from the search query screen.

3.2.10 process_playlist_form.py

CGI script which handles form inputs from the MPS search screen.

3.2.11 process_report_form.py

CGI script which handles form inputs from the MPS report generation screen.

3.3 MTag Application Scripts

The MTag (MP3 Tagger) application allows the user to edit ID3 tags on MP3 files. It supports ID3v1 and ID3v2 tags. Tags can be individually editted, or selected files can have their tags modified in a batch mode.

3.3.1 MTAG

Application-specific module which provides methods for displaying application frames and performing MTag-related functions that are used in building other MTag scripts.

3.3.2 MTAG_screen.py

CGI script which services requests for generating MTag screen elements.

3.3.3 MTAG_userlogin.py

CGI script which handles form inputs from the MTag login screen.

3.3.4 MTAG_process_menu.py

CGI script which handles form inputs from the MTag menu screen.

3.3.5 modify_tag.py

CGI script which handles form inputs from the single tag editting window.

3.3.6 batch_modify_tag.py

CGI script which handles form inputs from the batch tag editting window.

3.3.7 modify_track_num.py

CGI script which handles form inputs from the track editting window.

3.4 Included Packages

The PTOMMI distribution includes two additional Python packages that provide functionality that is not specific to PTOMMI, but which are used in the process of report generation.

3.4.1 POST

POST provides components for creating compound documents and generating output in a variety of document formats. Supported formats include HTML, PDF, RTF, and LaTeX.

3.4.2 PyChart

PyChart provides components for creating charts in Python, and is used in POST. Supported chart types include line charts, bar charts, interval charts and pie charts. Custom chart annotation is also supported.