Index: src/mlx/acars.py
===================================================================
--- src/mlx/acars.py	(revision 139)
+++ src/mlx/acars.py	(revision 298)
@@ -1,7 +1,13 @@
-# Module for ACARS handling
+
+import const
 
 #------------------------------------------------------------------------------
 
-import const
+## @package mlx.acars
+#
+# The handling of the ACARS.
+#
+# This module defines the \ref ACARS class that is used to extract and contain
+# the data needed to send ACARS information to the MAVA server.
 
 #------------------------------------------------------------------------------
Index: src/mlx/acft.py
===================================================================
--- src/mlx/acft.py	(revision 297)
+++ src/mlx/acft.py	(revision 298)
@@ -1,2 +1,16 @@
+
+import const
+import checks
+import fs
+import util
+
+import sys
+import time
+import traceback
+
+from collections import deque
+
+#---------------------------------------------------------------------------------------
+
 ## @package mlx.acft
 #
@@ -14,17 +28,4 @@
 # values in the \ref mlx.fs.AircraftState "aircraft state" when it is received
 # from the simulator.
-
-#---------------------------------------------------------------------------------------
-
-import const
-import checks
-import fs
-import util
-
-import sys
-import time
-import traceback
-
-from collections import deque
 
 #---------------------------------------------------------------------------------------
Index: src/mlx/airports.py
===================================================================
--- src/mlx/airports.py	(revision 261)
+++ src/mlx/airports.py	(revision 298)
@@ -1,7 +1,19 @@
-# The mapping of ICAO codes to airport names
 # -*- coding: utf-8 -*-
+
+import sys
 
 #-----------------------------------------------------------------------------
 
+## @package mlx.airports
+#
+# The mapping of ICAO codes to airport names.
+#
+# This module contains the mapping of ICAO codes to airport cities and names,
+# as well as a \ref getWelcomeMessage "function" to produce a welcome message
+# for a certain airport.
+
+#-----------------------------------------------------------------------------
+
+## The mapping of the ICAO codes
 airportNames = {
     "VTBS" : ("Bangkok", "Suvarnabhumi"),
Index: src/mlx/checks.py
===================================================================
--- src/mlx/checks.py	(revision 297)
+++ src/mlx/checks.py	(revision 298)
@@ -1,2 +1,13 @@
+
+import fs
+import const
+import util
+from acars import ACARS
+from sound import startSound
+
+import time
+
+#---------------------------------------------------------------------------------------
+
 ## @package mlx.checks
 #
@@ -13,14 +24,4 @@
 # transitions from one stage of the flight to the next one. Or \ref ACARSSender
 # which sends the ACARS periodically
-
-#---------------------------------------------------------------------------------------
-
-import fs
-import const
-import util
-from acars import ACARS
-from sound import startSound
-
-import time
 
 #---------------------------------------------------------------------------------------
Index: src/mlx/config.py
===================================================================
--- src/mlx/config.py	(revision 273)
+++ src/mlx/config.py	(revision 298)
@@ -1,6 +1,3 @@
-# Configuration and related stuff
 # -*- encoding: utf-8 -*-
-
-#-------------------------------------------------------------------------------
 
 import const
@@ -9,4 +6,16 @@
 import sys
 import ConfigParser
+
+## @package mlx.config
+# 
+# The handling of the configuration.
+#
+# The \ref Config class contains the main configuration and is capable of
+# loading and saving the configuration. It contains getters and setters for the
+# configuration options.
+#
+# Some parts of the configuration are not simple data items, like strings or
+# booleans, but more complicated data. These have their own class, like \ref
+# ApproachCallouts or \ref Checklist.
 
 #-------------------------------------------------------------------------------
Index: src/mlx/const.py
===================================================================
--- src/mlx/const.py	(revision 274)
+++ src/mlx/const.py	(revision 298)
@@ -1,95 +1,102 @@
-# Various constants used in the logger
-
-#-------------------------------------------------------------------------------
-
-# The version of the program
+
+import sys
+
+#-------------------------------------------------------------------------------
+
+## @package mlx.const
+#
+# The constants used by the program.
+
+#-------------------------------------------------------------------------------
+
+## The version of the program
 VERSION="0.6"
 
 #-------------------------------------------------------------------------------
 
-# The ratio between lbs and kg
+## The ratio between lbs and kg
 LBSTOKG=0.4536
 
-# The ratio between kgs and lbs
+## The ratio between kgs and lbs
 KGSTOLB=1/LBSTOKG
 
-# The ratio between feet and metre
+## The ratio between feet and metre
 FEETTOMETRES=0.3048
 
 #-------------------------------------------------------------------------------
 
-# The ratio between knots and km/h
+## The ratio between knots and km/h
 KNOTSTOKMPH=1.852
 
-# The ratio between km/h and knots
+## The ratio between km/h and knots
 KMPHTOKNOTS=1/1.852
 
 #-------------------------------------------------------------------------------
 
-# Flight simulator type: MS Flight Simulator 2004
+## Flight simulator type: MS Flight Simulator 2004
 SIM_MSFS9 = 1
 
-# Flight simulator type: MS Flight Simulator X
+## Flight simulator type: MS Flight Simulator X
 SIM_MSFSX = 2
 
-# Flight simulator type: X-Plane 9
+## Flight simulator type: X-Plane 9
 SIM_XPLANE9 = 3
 
-# Flight simulator type: X-Plane 10
+## Flight simulator type: X-Plane 10
 SIM_XPLANE10 = 4
 
 #-------------------------------------------------------------------------------
 
-# Aircraft type: Boeing 737-600
+## Aircraft type: Boeing 737-600
 AIRCRAFT_B736 = 1
 
-# Aircraft type: Boeing 737-700
+## Aircraft type: Boeing 737-700
 AIRCRAFT_B737 = 2
 
-# Aircraft type: Boeing 737-800
+## Aircraft type: Boeing 737-800
 AIRCRAFT_B738 = 3
 
-# Aircraft type: Boeing 737-800 (charter configuration)
+## Aircraft type: Boeing 737-800 (charter configuration)
 AIRCRAFT_B738C = 16
 
-# Aircraft type: Boeing 737-300
+## Aircraft type: Boeing 737-300
 AIRCRAFT_B733 = 4
 
-# Aircraft type: Boeing 737-400
+## Aircraft type: Boeing 737-400
 AIRCRAFT_B734 = 5
 
-# Aircraft type: Boeing 737-500
+## Aircraft type: Boeing 737-500
 AIRCRAFT_B735 = 6
 
-# Aircraft type: Dash-8 Q400
+## Aircraft type: Dash-8 Q400
 AIRCRAFT_DH8D = 7
 
-# Aircraft type: Boeing 767-200
+## Aircraft type: Boeing 767-200
 AIRCRAFT_B762 = 8
 
-# Aircraft type: Boeing 767-300
+## Aircraft type: Boeing 767-300
 AIRCRAFT_B763 = 9
 
-# Aircraft type: Canadair CRJ-200
+## Aircraft type: Canadair CRJ-200
 AIRCRAFT_CRJ2 = 10
 
-# Aircraft type: Fokker F-70
+## Aircraft type: Fokker F-70
 AIRCRAFT_F70 = 11
 
-# Aircraft type: Lisunov Li-2
+## Aircraft type: Lisunov Li-2
 AIRCRAFT_DC3 = 12
 
-# Aircraft type: Tupolev Tu-134
+## Aircraft type: Tupolev Tu-134
 AIRCRAFT_T134 = 13
 
-# Aircraft type: Tupolev Tu-154
+## Aircraft type: Tupolev Tu-154
 AIRCRAFT_T154 = 14
 
-# Aircraft type: Yakovlev Yak-40
+## Aircraft type: Yakovlev Yak-40
 AIRCRAFT_YK40 = 15
 
 #-------------------------------------------------------------------------------
 
-# The list of aircraft types that we know of
+## The list of aircraft types that we know of
 # The order is mostly from most recent to oldest considering
 # Malev's history
@@ -105,5 +112,5 @@
 #-------------------------------------------------------------------------------
 
-# A mapping of aircraft types to their 'internal' ICAO codes (which are
+## A mapping of aircraft types to their 'internal' ICAO codes (which are
 # the same as the real ICAO codes, except in a few cases)
 icaoCodes = { AIRCRAFT_B736  : "B736",
@@ -126,38 +133,38 @@
 #-------------------------------------------------------------------------------
 
-# Flight stage: boarding
+## Flight stage: boarding
 STAGE_BOARDING = 1
 
-# Flight stage: pushback, startup and taxi
+## Flight stage: pushback, startup and taxi
 STAGE_PUSHANDTAXI = 2
 
-# Flight stage: takeoff
+## Flight stage: takeoff
 STAGE_TAKEOFF = 3
 
-# Flight stage: RTO
+## Flight stage: RTO
 STAGE_RTO = 4
 
-# Flight stage: climb
+## Flight stage: climb
 STAGE_CLIMB = 5
 
-# Flight stage: cruise
+## Flight stage: cruise
 STAGE_CRUISE = 6
 
-# Flight stage: descent
+## Flight stage: descent
 STAGE_DESCENT = 7
 
-# Flight stage: landing
+## Flight stage: landing
 STAGE_LANDING = 8
 
-# Flight stage: taxi after landing
+## Flight stage: taxi after landing
 STAGE_TAXIAFTERLAND = 9
 
-# Flight stage: parking
+## Flight stage: parking
 STAGE_PARKING = 10
 
-# Flight stage: go-around
+## Flight stage: go-around
 STAGE_GOAROUND = 11
 
-# Flight stage: end
+## Flight stage: end
 STAGE_END = 12
 
@@ -183,28 +190,28 @@
 #-------------------------------------------------------------------------------
 
-# Plane status: unknown
+## Plane status: unknown
 PLANE_UNKNOWN = 0
 
-# Plane status: at home, i.e. LHBP
+## Plane status: at home, i.e. LHBP
 PLANE_HOME = 1
 
-# Plane status: away
+## Plane status: away
 PLANE_AWAY = 2
 
-# Plane status: parking
+## Plane status: parking
 PLANE_PARKING = 3
 
 #-------------------------------------------------------------------------------
 
-# Flight type: scheduled
+## Flight type: scheduled
 FLIGHTTYPE_SCHEDULED = 0
 
-# Flight type: old-timer
+## Flight type: old-timer
 FLIGHTTYPE_OLDTIMER = 1
 
-# Flight type: VIP
+## Flight type: VIP
 FLIGHTTYPE_VIP = 2
 
-# Flight type: charter
+## Flight type: charter
 FLIGHTTYPE_CHARTER = 3
 
@@ -230,60 +237,60 @@
 #-------------------------------------------------------------------------------
 
-# Delay code: loading problems
+## Delay code: loading problems
 DELAYCODE_LOADING = 0
 
-# Delay code: VATSIM problem
+## Delay code: VATSIM problem
 DELAYCODE_VATSIM = 1
 
-# Delay code: network problems
+## Delay code: network problems
 DELAYCODE_NETWORK = 2
 
-# Delay code: controller's fault
+## Delay code: controller's fault
 DELAYCODE_CONTROLLER = 3
 
-# Delay code: system crash or freeze
+## Delay code: system crash or freeze
 DELAYCODE_SYSTEM = 4
 
-# Delay code: navigation problem
+## Delay code: navigation problem
 DELAYCODE_NAVIGATION = 5
 
-# Delay code: traffic problems
+## Delay code: traffic problems
 DELAYCODE_TRAFFIC = 6
 
-# Delay code: apron navigation
+## Delay code: apron navigation
 DELAYCODE_APRON = 7
 
-# Delay code: weather problems
+## Delay code: weather problems
 DELAYCODE_WEATHER = 8
 
-# Delay code: personal reasons
+## Delay code: personal reasons
 DELAYCODE_PERSONAL = 9
 
 #-------------------------------------------------------------------------------
 
-# Message type: logger error
+## Message type: logger error
 # FIXME: cannot set the hotkey
 MESSAGETYPE_LOGGER_ERROR = 1
 
-# Message type: information
+## Message type: information
 MESSAGETYPE_INFORMATION = 2
 
-# Message type: fault messages
+## Message type: fault messages
 MESSAGETYPE_FAULT = 3
 
-# Message type: NO-GO fault messages
+## Message type: NO-GO fault messages
 MESSAGETYPE_NOGO = 4
 
-# Message type: gate system messages
+## Message type: gate system messages
 MESSAGETYPE_GATE_SYSTEM = 5
 
-# Message type: environment messages
+## Message type: environment messages
 # FIXME: flight plan closed (5 sec)
 MESSAGETYPE_ENVIRONMENT = 6
 
-# Message type: help messages
+## Message type: help messages
 MESSAGETYPE_HELP = 7
 
-# Message type: visibility messages
+## Message type: visibility messages
 MESSAGETYPE_VISIBILITY = 8
 
@@ -317,14 +324,14 @@
 #-------------------------------------------------------------------------------
 
-# Message display level: none
+## Message display level: none
 MESSAGELEVEL_NONE = 0
 
-# Message display level: only message in the simulator
+## Message display level: only message in the simulator
 MESSAGELEVEL_FS = 1
 
-# Message display level: only sound
+## Message display level: only sound
 MESSAGELEVEL_SOUND = 2
 
-# Message display level: both
+## Message display level: both
 MESSAGELEVEL_BOTH = 3
 
@@ -357,47 +364,47 @@
 #-------------------------------------------------------------------------------
 
-# Sound: ding
+## Sound: ding
 SOUND_DING = "ding.wav"
 
-# Sound: notify
+## Sound: notify
 SOUND_NOTIFY = "notify.wav"
 
-# Sound: NOTAM
+## Sound: NOTAM
 SOUND_NOTAM = "notam.mp3"
 
-# Sound: scream
+## Sound: scream
 SOUND_SCREAM = "sikoly.mp3"
 
-# Sound: boarding
+## Sound: boarding
 SOUND_BOARDING = "board.mp3"
 
-# Sound: Malev theme
+## Sound: Malev theme
 SOUND_MALEV = "malev.mp3"
 
-# Sound: taxi: Boeing 737 NG
+## Sound: taxi: Boeing 737 NG
 SOUND_TAXI_BOEING737NG = "737taxi.mp3"
 
-# Sound: taxi: Boeing 767
+## Sound: taxi: Boeing 767
 SOUND_TAXI_BOEING767 = "767taxi.mp3"
 
-# Sound: taxi: Fokker F70
+## Sound: taxi: Fokker F70
 SOUND_TAXI_F70 = "F70taxi.mp3"
 
-# Sound: takeoff preparation request from the captain
+## Sound: takeoff preparation request from the captain
 SOUND_CAPTAIN_TAKEOFF = "cpt_takeoff.mp3"
 
-# Sound: cruise
+## Sound: cruise
 SOUND_CRUISE = "TOC.mp3"
 
-# Sound: descent
+## Sound: descent
 SOUND_DESCENT = "TOD.mp3"
 
-# Sound: applause
+## Sound: applause
 SOUND_APPLAUSE = "taps.mp3"
 
-# Sound: speedbrake
+## Sound: speedbrake
 SOUND_SPEEDBRAKE = "speed.mp3"
 
-# Sound: taxi after landing
+## Sound: taxi after landing
 SOUND_TAXIAFTERLAND = "TaxiAfterLand.mp3"
 
@@ -405,32 +412,32 @@
 #-------------------------------------------------------------------------------
 
-# Fuel tank: centre
+## Fuel tank: centre
 FUELTANK_CENTRE = 1
 
-# Fuel tank: left
+## Fuel tank: left
 FUELTANK_LEFT = 2
 
-# Fuel tank: right
+## Fuel tank: right
 FUELTANK_RIGHT = 3
 
-# Fuel tank: left aux
+## Fuel tank: left aux
 FUELTANK_LEFT_AUX = 4
 
-# Fuel tank: right aux
+## Fuel tank: right aux
 FUELTANK_RIGHT_AUX = 5
 
-# Fuel tank: left tip
+## Fuel tank: left tip
 FUELTANK_LEFT_TIP = 6
 
-# Fuel tank: right tip
+## Fuel tank: right tip
 FUELTANK_RIGHT_TIP = 7
 
-# Fuel tank: external 1
+## Fuel tank: external 1
 FUELTANK_EXTERNAL1 = 8
 
-# Fuel tank: external 2
+## Fuel tank: external 2
 FUELTANK_EXTERNAL2 = 9
 
-# Fuel tank: centre2
+## Fuel tank: centre2
 FUELTANK_CENTRE2 = 10
 
@@ -486,5 +493,5 @@
 #-------------------------------------------------------------------------------
 
-# The available gates at LHBP
+## The available gates at LHBP
 lhbpGateNumbers = []
 
Index: src/mlx/flight.py
===================================================================
--- src/mlx/flight.py	(revision 274)
+++ src/mlx/flight.py	(revision 298)
@@ -1,5 +1,2 @@
-# Module related to the high-level tracking of the flight
-
-#---------------------------------------------------------------------------------------
 
 from soundsched import SoundScheduler, ChecklistScheduler
@@ -9,4 +6,13 @@
 
 import threading
+
+#---------------------------------------------------------------------------------------
+
+## @package mlx.flight
+#
+# The global flight state.
+#
+# This module defines a single class, \ref Flight, which represents the flight
+# in progress.
 
 #---------------------------------------------------------------------------------------
Index: src/mlx/fs.py
===================================================================
--- src/mlx/fs.py	(revision 295)
+++ src/mlx/fs.py	(revision 298)
@@ -1,2 +1,12 @@
+
+import const
+from sound import startSound
+
+import fsuipc
+import threading
+import time
+
+#-------------------------------------------------------------------------------
+
 ## @package mlx.fs
 #
@@ -11,13 +21,7 @@
 # simulated aircraft. Instances of class \ref AircraftState are used for this
 # purpose.
-
-#-------------------------------------------------------------------------------
-
-import const
-from sound import startSound
-
-import fsuipc
-import threading
-import time
+#
+# This module also contains some definitions for message sending and implements
+# the timing logic itself.
 
 #-------------------------------------------------------------------------------
Index: src/mlx/fsuipc.py
===================================================================
--- src/mlx/fsuipc.py	(revision 290)
+++ src/mlx/fsuipc.py	(revision 298)
@@ -1,5 +1,2 @@
-# Module handling the connection to FSUIPC
-
-#------------------------------------------------------------------------------
 
 import fs
@@ -22,5 +19,40 @@
 #------------------------------------------------------------------------------
 
-# The mapping of tank types to FSUIPC offsets
+## @package mlx.fsuipc
+#
+# The module towards FSUIPC.
+#
+# This module implements the simulator interface to FSUIPC.
+#
+# The \ref Handler class is thread handling the FSUIPC requests. It can be
+# given read, periodic read and write, requests, that are executed
+# asynchronously, and a callback function is called with the result. This class
+# is used internally within the module.
+#
+# The \ref Simulator class is the actual interface to the flight simulator, and
+# an instance of it is returned by \ref mlx.fs.createSimulator. This object can
+# be used to connect to the simulator and disconnect from it, to query various
+# data and to start and stop the monitoring of the data.
+#
+# \ref AircraftModel is the base class of the aircraft models. A "model" is a
+# particular implementation of an aircraft, such as the PMDG Boeing 737NG in
+# Flight Simulator 2004. Since each type and each model has its peculiarities
+# (e.g. the different engine and fuel tank configurations), each aircraft type
+# has a generic model, that should work for most of the time. However, certain
+# models may implement various controls, gauges, etc. differently, and such
+# peculiarites can be handled in a specific subclass of \ref
+# AircraftModel. These subclasses should be registered as special ones, and if
+# the simulator detects that the aircraft's model became known or has changed,
+# it will check these special models before resorting to the generic ones.
+#
+# The models are responsible also for querying certain parameters, such as the
+# fuel tank configuration. While ideally it should be specific to a type only,
+# it is possible that the model contains different tanks, in which case some
+# tricks may be needed. See the \ref DC3Model "DC-3 (Li-2)" aircraft as an
+# example.
+
+#------------------------------------------------------------------------------
+
+## The mapping of tank types to FSUIPC offsets
 _tank2offset = { const.FUELTANK_CENTRE : 0x0b74,
                  const.FUELTANK_LEFT : 0x0b7c,
Index: src/mlx/i18n.py
===================================================================
--- src/mlx/i18n.py	(revision 276)
+++ src/mlx/i18n.py	(revision 298)
@@ -1,10 +1,17 @@
-# Internationalization support
 # -*- coding: utf-8 -*-
-
-#------------------------------------------------------------------------------
 
 import gettext
 import os
 import traceback
+
+#------------------------------------------------------------------------------
+
+## @package mlx.i18n
+#
+# Internationalization support.
+#
+# This module handles the internationalization support in the logger. It is
+# based on the GNU gettext library, and exports the \ref xstr function that
+# returns the translation for a certain key.
 
 #------------------------------------------------------------------------------
Index: src/mlx/logger.py
===================================================================
--- src/mlx/logger.py	(revision 225)
+++ src/mlx/logger.py	(revision 298)
@@ -1,5 +1,2 @@
-# Module for the logging.
-
-#--------------------------------------------------------------------------------------
 
 from fs import sendMessage
@@ -9,4 +6,22 @@
 import sys
 import time
+
+#--------------------------------------------------------------------------------------
+
+## @package mlx.logger
+#
+# The module for the logger.
+#
+# While the program itself is "logger", it contains an internal logger, which
+# maintains the textual log containing information on the various events and is
+# the reason why the program is called "logger".
+#
+# The log is made up of lines containing an optional timestamp and the text of
+# the message. A line can be updated after having been put into the log by
+# referring to its index.
+#
+# The logger object also maintains a separate set of faults and ensures that
+# one fault type has only one score, even if that fault has been reported
+# multiple times.
 
 #--------------------------------------------------------------------------------------
Index: src/mlx/mlx.py
===================================================================
--- src/mlx/mlx.py	(revision 276)
+++ src/mlx/mlx.py	(revision 298)
@@ -1,3 +1,2 @@
-# The main program
 
 from config import Config
@@ -7,4 +6,13 @@
 import os
 import sys
+
+#--------------------------------------------------------------------------------------
+
+## @package mlx.mlx
+#
+# The main program.
+#
+# This module contains the main program of the logger as well as the \ref
+# restart "restart" handling.
 
 #--------------------------------------------------------------------------------------
Index: src/mlx/pirep.py
===================================================================
--- src/mlx/pirep.py	(revision 262)
+++ src/mlx/pirep.py	(revision 298)
@@ -1,8 +1,15 @@
-# The PIREP class collecting all information needed for a PIREP
+
+import const
+import cPickle as pickle
 
 #------------------------------------------------------------------------------
 
-import const
-import cPickle as pickle
+## @package mlx.pirep
+#
+# The PIREP module.
+#
+# This module defines only one class, \ref PIREP. It is used to extract and
+# store the information needed for a PIREP. The saved PIREPs are pickled
+# instances of this class.
 
 #------------------------------------------------------------------------------
Index: src/mlx/pyuipc_emu.py
===================================================================
--- src/mlx/pyuipc_emu.py	(revision 27)
+++ src/mlx/pyuipc_emu.py	(revision 298)
@@ -1,4 +1,2 @@
-# Emulator for the pyuipc module
-#------------------------------------------------------------------------------
 
 import time
@@ -6,8 +4,16 @@
 #------------------------------------------------------------------------------
 
-# The ratio between kg and lbs
+## @package mlx.pyuipc_emu
+#
+# A very simple PyUIPC emulator.
+#
+# This is not used currently.
+
+#------------------------------------------------------------------------------
+
+## The ratio between kg and lbs
 KGTOLBS=1/0.4536
 
-# Feet to metres
+## Feet to metres
 FEETTOMETRES=0.3048
 
@@ -36,5 +42,5 @@
 #------------------------------------------------------------------------------
 
-# Version constants
+## Version constants
 SIM_ANY=0
 SIM_FS98=1
@@ -48,5 +54,5 @@
 #------------------------------------------------------------------------------
 
-# Error constants
+## Error constants
 ERR_OK=0
 ERR_OPEN=1
@@ -68,5 +74,5 @@
 #------------------------------------------------------------------------------
 
-# The version of FSUIPC
+## The version of FSUIPC
 fsuipc_version=0x0401
 lib_version=0x0302
Index: src/mlx/pyuipc_sim.py
===================================================================
--- src/mlx/pyuipc_sim.py	(revision 273)
+++ src/mlx/pyuipc_sim.py	(revision 298)
@@ -1,4 +1,2 @@
-# Simulator for the pyuipc module
-#------------------------------------------------------------------------------
 
 import const
@@ -16,5 +14,23 @@
 #------------------------------------------------------------------------------
 
-# Version constants
+## @package mlx.pyuipc_sim
+#
+# Simulator of the PyUIPC module.
+#
+# This is a simulation of the PyUIPC module emulating offsets that are needed
+# by the logger.
+#
+# This module can also be run as a program, in which case it connects to an
+# already running logger (that uses this module in place of the real pyuipc),
+# and various commands can be given to query or modify the values of the
+# offsets. There is a 'help' command and completion also works.
+#
+# This module is used instead of the real PyUIPC module, if the program is not
+# running on Windows or the FORCE_PYUIPC_SIM environment variable is present.
+
+#------------------------------------------------------------------------------
+#------------------------------------------------------------------------------
+
+## Version constants
 SIM_ANY=0
 SIM_FS98=1
@@ -29,5 +45,5 @@
 #------------------------------------------------------------------------------
 
-# Error constants
+## Error constants
 ERR_OK=0
 ERR_OPEN=1
@@ -49,5 +65,5 @@
 #------------------------------------------------------------------------------
 
-# The version of FSUIPC
+## The version of FSUIPC
 fsuipc_version=0x0401
 lib_version=0x0302
@@ -100,47 +116,47 @@
 class Values(object):
     """The values that can be read from 'FSUIPC'."""
-    # Fuel data index: centre tank
+    ## Fuel data index: centre tank
     FUEL_CENTRE = 0
 
-    # Fuel data index: left main tank
+    ## Fuel data index: left main tank
     FUEL_LEFT = 1
 
-    # Fuel data index: right main tank
+    ## Fuel data index: right main tank
     FUEL_RIGHT = 2
 
-    # Fuel data index: left aux tank
+    ## Fuel data index: left aux tank
     FUEL_LEFT_AUX = 3
 
-    # Fuel data index: right aux tank
+    ## Fuel data index: right aux tank
     FUEL_RIGHT_AUX = 4
 
-    # Fuel data index: left tip tank
+    ## Fuel data index: left tip tank
     FUEL_LEFT_TIP = 5
 
-    # Fuel data index: right tip tank
+    ## Fuel data index: right tip tank
     FUEL_RIGHT_TIP = 6
 
-    # Fuel data index: external 1 tank
+    ## Fuel data index: external 1 tank
     FUEL_EXTERNAL_1 = 7
 
-    # Fuel data index: external 2 tank
+    ## Fuel data index: external 2 tank
     FUEL_EXTERNAL_2 = 8
 
-    # Fuel data index: centre 2 tank
+    ## Fuel data index: centre 2 tank
     FUEL_CENTRE_2 = 9
 
-    # The number of fuel tank entries
+    ## The number of fuel tank entries
     NUM_FUEL = FUEL_CENTRE_2 + 1
 
-    # Engine index: engine #1
+    ## Engine index: engine #1
     ENGINE_1 = 0
 
-    # Engine index: engine #2
+    ## Engine index: engine #2
     ENGINE_2 = 1
 
-    # Engine index: engine #3
+    ## Engine index: engine #3
     ENGINE_3 = 2
 
-    # The number of hotkey entries
+    ## The number of hotkey entries
     HOTKEY_SIZE = 56
 
Index: src/mlx/singleton.py
===================================================================
--- src/mlx/singleton.py	(revision 247)
+++ src/mlx/singleton.py	(revision 298)
@@ -1,6 +1,25 @@
-# Module to allow for a single instance of an application to run
 
 import os
 import time
+
+#----------------------------------------------------------------------------
+
+## @package mlx.singleton
+#
+# Allow a single instance of an application to run.
+#
+# This module implements the logic needed to detect that an instance of the
+# application is already running, and if so, notifying that instance.
+#
+# On Windows, a mutex is used to ensure that only a single instance is running,
+# since a mutex with a certain name can be created by one process only. If the
+# current process is the only instance, a named pipe is created and a thread is
+# started to listen for messages. Otherwise a message is sent to that pipe,
+# which results in calling a callback function.
+#
+# On Linux a Unix socket is created protected by a lock file, and the messages
+# from other instances are received via this socket.
+#
+# The main window is raised if another instance is started.
 
 #----------------------------------------------------------------------------
Index: src/mlx/sound.py
===================================================================
--- src/mlx/sound.py	(revision 180)
+++ src/mlx/sound.py	(revision 298)
@@ -1,8 +1,19 @@
-# Module to handle sound playback
-
-#------------------------------------------------------------------------------
 
 import os
 import traceback
+
+#------------------------------------------------------------------------------
+
+## @package mlx.sound
+#
+# Sound playback handling.
+#
+# This is the low level sound playback handling. The \ref initializeSound
+# function should be called to initialize the sound handling with the directory
+# containing the sound files. Then the \startSound function should be called to
+# start the playback of a certain sound file. A callback may be called when the
+# playback of a certain file has finished.
+#
+# See also the \ref mlx.soundsched module.
 
 #------------------------------------------------------------------------------
Index: src/mlx/soundsched.py
===================================================================
--- src/mlx/soundsched.py	(revision 229)
+++ src/mlx/soundsched.py	(revision 298)
@@ -1,5 +1,2 @@
-# Module to schedule the sounds to be played
-
-#------------------------------------------------------------------------------
 
 from sound import startSound
@@ -8,4 +5,26 @@
 
 import threading
+
+#------------------------------------------------------------------------------
+
+## @package mlx.soundsched
+#
+# Sound playback scheduling.
+#
+# The logger may play certain sound files when certain conditions hold. For
+# example, if the landing or the strobe lights are switched on during taxi, and
+# we go to the takeoff state, a voice says "Cabin crew, please take your seats
+# for takeoff". Some sounds are played only when the pilot presses a hotkey, if
+# the program is set up that way.
+#
+# Each sound is represented by an instance of a subclass of \ref Sound. If a
+# new \ref mlx.fs.AircraftState "aircraft state" comes in from the simulator,
+# the \ref Sound.shouldPlay "shouldPlay" functions of the registered sound
+# objects are called with that state, and if the function returns \c True, the
+# corresponding sound file is played.
+#
+# The \ref ChecklistScheduler class handles the playback of the checklists,
+# which are basically sequences of sound files played back one-by-one when a
+# certain hotkey is pressed.
 
 #------------------------------------------------------------------------------
Index: src/mlx/update.py
===================================================================
--- src/mlx/update.py	(revision 189)
+++ src/mlx/update.py	(revision 298)
@@ -1,5 +1,2 @@
-# Module handling the download of updates
-
-#------------------------------------------------------------------------------
 
 from config import Config
@@ -15,4 +12,22 @@
 if os.name=="nt":
     import win32api
+
+#------------------------------------------------------------------------------
+
+## @package mlx.update
+#
+# Automatic update handling.
+#
+# The program can update itself automatically. For this purpose it maintains a
+# manifest of the files installed containing the relative paths, sizes and
+# checksums of each files. When the program starts up, this manifest file is
+# downloaded from the update server and is compared to the local one. Then the
+# updated and new files are downloaded with names that are created by appending
+# the checksum to the actual name, so as not to overwrite any existing files at
+# this stage. If all files are downloaded, the downloaded files are renamed to
+# their real names. On Windows, the old file is removed first to avoid trouble
+# with 'busy' files. If removing a file fails, the file will be moved to a
+# temporary directory, that will be removed when the program starts the next
+# time.
 
 #------------------------------------------------------------------------------
Index: src/mlx/util.py
===================================================================
--- src/mlx/util.py	(revision 134)
+++ src/mlx/util.py	(revision 298)
@@ -1,3 +1,2 @@
-# Various utilities
 
 import math
@@ -6,5 +5,11 @@
 #------------------------------------------------------------------------------
 
-# The average of the radius at the poles and a the equator, in metres
+## @package mlx.util
+#
+# Utilities.
+
+#------------------------------------------------------------------------------
+
+## The average of the radius at the poles and a the equator, in metres
 #EARTH_RADIUS=6367467.4
 EARTH_RADIUS=6371000
Index: src/mlx/web.py
===================================================================
--- src/mlx/web.py	(revision 214)
+++ src/mlx/web.py	(revision 298)
@@ -1,5 +1,2 @@
-# Interface towards the websites used
-
-#------------------------------------------------------------------------------
 
 import const
@@ -16,4 +13,21 @@
 import traceback
 import xml.sax
+
+#---------------------------------------------------------------------------------------
+
+## @package mlx.web
+#
+# Web interface.
+#
+# This module implements a thread that can perform (HTTP) requests
+# asynchronously. When the request is performed, a callback is called. The main
+# interface is the \ref Handler class. Each of its functions creates a \ref
+# Request subclass instance and puts it to the request queue. The handler
+# thread then takes the requests one by one, and executes them.
+#
+# This module also defines some data classes the contents of which are
+# retrieved or sent via HTTP. \ref BookedFlight contains data of a flight
+# booked on the MAVA website, \ref Fleet and \ref Plane represents the MAVA
+# fleet and the gates at Ferihegy and \ref NOTAM is a NOTAM.
 
 #---------------------------------------------------------------------------------------
