# common.py --- Python interface to libxmms -- common module. # Copyright (c) 2005 Scott Grayban # # This file is part of PyBMP. # # PyBMP is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 dated June, 1991. # # PyBMP is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. # # $Id: common.py 3 2006-03-28 11:52:53Z sgrayban $ # """Python interface to beep-media-player --- common module. This module is part of PyBMP and contains objects to share between other modules in the xmms package, most interestingly the 'error' generic exception. It also provides 'PyBMPGenericException' as an alias for 'error' to preserve backward-compatibility, but its use is deprecated. """ class error(Exception): """Base class for exceptions in the xmms package.""" def __init__(self, message=None): self.message = message def __str__(self): return "<%s: %s>" % (self.__class__.__name__, self.message) def complete_message(self): if self.message: return "%s: %s" % (self.ExceptionShortDescription, self.message) else: return "%s" % self.ExceptionShortDescription ExceptionShortDescription = "PyBMP generic exception" # For backward-compatibility PyBMPGenericException = error