""" WAM exception classes """ # Copyright 2008-2010 eGovMon # This program is distributed under the terms of the GNU General # Public License. # # This file is part of the eGovernment Monitoring # (eGovMon) # # eGovMon 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; either version 2 of the License, or # (at your option) any later version. # # eGovMon 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 eGovMon; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301 USA __author__ = "Morten Goodwin" __version__ = "$Id: wamerror.py 1974 2006-04-24 18:35:47Z num $" __updated__ = "$LastChangedDate$" class WAMError(Exception): """Basic class for reporting Alternative texts errors """ class NotEnoughParametersSetError(WAMError): """Exception when not enough parameters are set """ def __init__(self,parameterlist,comment): """Throws a NotEnoughParametersSetError exception. Keyword argumenst: parameterlist -- list of parameters comment -- comment """ comment = comment + ','.join([str(p) for p in parameterlist]) WAMError.__init__(self,'Not enough parameters set ' + comment) class UnrecognisedWAM(WAMError): """Exception when a WAM is not recognised """ def __init__(self,WAMName): """Throws a UnrecognisedWAM exception. Keyword argumenst: WAMName -- Name of WAM """ WAMError.__init__(self,' '.join([WAMName,'is not recognisable'])) class NotImplemented(WAMError): """Exception when a WAM has not yet been implemented """ def __init__(self,WAMName): """Throws a NotImplemented exception. Keyword argumenst: WAMName -- Name of WAM """ WAMError.__init__(self,' '.join([WAMName,'not implemented yet'])) if __name__ == "__main__": raise UnrecognisedWAM('Some WAM')