2013-04-16 22:44:16 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Copyright (C) 2012-2013 Team tiramisu (see AUTHORS for all contributors)
|
|
|
|
#
|
|
|
|
# This program 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.
|
|
|
|
#
|
|
|
|
# This program 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; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
# The original `Config` design model is unproudly borrowed from
|
|
|
|
# the rough pypy's guys: http://codespeak.net/svn/pypy/dist/pypy/config/
|
|
|
|
# the whole pypy projet is under MIT licence
|
|
|
|
# ____________________________________________________________
|
|
|
|
|
2013-04-14 12:01:32 +02:00
|
|
|
#ValueError if function's parameter not correct
|
|
|
|
# or if not logical
|
|
|
|
# or if validation falied
|
|
|
|
#TypeError if parameter has no good type
|
|
|
|
#AttributeError if no option or optiondescription in optiondescription (also when specified a path)
|
2013-04-13 22:50:55 +02:00
|
|
|
|
|
|
|
|
2013-04-14 12:01:32 +02:00
|
|
|
class AmbigousOptionError(StandardError):
|
|
|
|
"more than one option"
|
2012-07-13 09:37:35 +02:00
|
|
|
pass
|
2013-04-13 22:50:55 +02:00
|
|
|
|
|
|
|
|
2013-04-14 12:01:32 +02:00
|
|
|
class ConfigError(StandardError):
|
2013-04-17 21:33:34 +02:00
|
|
|
"""try to change owner for an option without value
|
2013-04-14 12:01:32 +02:00
|
|
|
or if error in calculation"""
|
2012-07-13 09:37:35 +02:00
|
|
|
pass
|
2013-04-13 22:50:55 +02:00
|
|
|
|
|
|
|
|
2012-07-13 09:37:35 +02:00
|
|
|
class ConflictConfigError(ConfigError):
|
2013-04-14 12:01:32 +02:00
|
|
|
"duplicate config"
|
2012-07-13 09:37:35 +02:00
|
|
|
pass
|
2013-04-13 22:50:55 +02:00
|
|
|
|
|
|
|
|
2012-08-13 12:49:58 +02:00
|
|
|
class PropertiesOptionError(AttributeError):
|
2013-04-14 12:01:32 +02:00
|
|
|
"try to access to opt with not allowed property"
|
2012-10-16 15:09:52 +02:00
|
|
|
def __init__(self, msg, proptype):
|
2012-09-07 15:47:06 +02:00
|
|
|
self.proptype = proptype
|
|
|
|
super(PropertiesOptionError, self).__init__(msg)
|
|
|
|
|
2013-04-13 22:50:55 +02:00
|
|
|
|
2013-04-14 12:01:32 +02:00
|
|
|
class RequirementRecursionError(StandardError):
|
|
|
|
"recursive error"
|
2012-07-26 10:54:57 +02:00
|
|
|
pass
|
2013-04-13 22:50:55 +02:00
|
|
|
|
|
|
|
|
2013-02-22 11:09:17 +01:00
|
|
|
class MultiTypeError(Exception):
|
2013-04-14 12:01:32 +02:00
|
|
|
"""multi must be a list
|
|
|
|
or error with multi length"""
|
2013-02-22 11:09:17 +01:00
|
|
|
pass
|