MethLab File Layout
This page describes the structure of the MethLab source code.
trunk/
Contains the main executable (methlab), tool executables (methlab-hide, methlab-quit, methlab-show, methlab-toggle), documentation (COPYING, CREDITS, README, TODO) and the install script (setup.py) with its manifest file (MANIFEST).
trunk/locale/
Contains the translation framework and the MethLab translation files.
- nl/: Dutch translation.
- ro/: Romanian translation.
- add_lang.sh: Add a new language to the translation framework and add it to SVN.
- compile.sh: Compile a single or all translation files.
- merge.sh: Merge changes in the .pot file to all the .po files.
- methlab.pot: Contains the translation template.
- README: Documentation about the utility scripts.
- update.sh: Update the .pot file from the MethLab sources.
trunk/pymethlab/
Contains the source code. Contains subdirectories with database source and audio player drivers.
- db_sources/: Contains database source drivers.
- drivers/: Contains audio player drivers.
- images/: Contains images used by the user interface.
- init.py: Empty file required to make this directory an importable python package.
- db.py: Contains the database thread. This class abstracts accessing the MethLab database. Even though database access is threaded, this class provides both synchronous and asynchronous query runners. This class is also responsible for transparently migrating the MethLab database to a new layout.
- dbqueries.py: Contains all the SQL queries used by the database class.
- dbus_service.py: Implements the MethLab DBUS service. Currently implements a 'quit' method for the application and 'show', 'hide' and 'toggle' methods for the main application window.
- dirdialog.glade: Contains the user interface for the directory selector.
- gui.py: Contains all the logic for the user interface. Note that this contains the bulk of all the code and is quite fragile in some places.
- methlab.glade: Contains the layout of the main application window.
- querytranslator.py: The query translator translates complex queries ('@artist = "foo"') to proper SQL.
- updatehelper.py: A helper class for updating the database in a seperate thread.
trunk/pymethlab/db_sources
Contains the datasources that can be used by MethLab and some utility classes and functions.
- init.py: Scans the db_sources directory for valid database sources by importing all modules and checking if they export a DB_SOURCES variable.
- fs_source.py: Filesystem database source. Uses the mutagen or TagPy libraries to extract metadata from files in specified directories.
- mpd_source.py: MPD database source. Talks to MPD to update MethLab's metadata database.
- mpdclient3.py: Symlink to ../drivers/mpdclient3.py. Library used to communicate with MPD.
- tagwrap.py: Helper functions and classes to transparently support TagPy, old TagPy and Mutagen in the filesystem source.
- utils.py: Contains a helper function to extract a numerical part from a string.
trunk/pymethlab/drivers
Contains the audio player drivers that allow MethLab to communicate with several audio players.
- init.py: Scans the drivers directory for valid audio player drivers by importing all modules and checking if they export a DRIVERS variable.
- audacious-dbus.py: Driver for communicating with Audacious through its DBUS interface.
- dummy.py: Dummy driver. Acts as a fallback and does absolutely nothing.
- mpd.py: Driver for communicating with MPD.
- mpdclient3.py: 3rd party library for communicating with MPD.
- pyxmms.py: Driver for communicating with XMMS using the PyXMMS library.
- xmms2.py: Driver for communicating with XMMS2 using XMMS2's python library.
- xmmsalike.py: Third party library that allows for communicating with XMMS, Beep and (old) Audacious using ctypes.
- xmmsbeepaudacious.py: Drivers for communicating with XMMS, Beep and (old) Audacious using the 3rd party xmmsalike library.