Moved Issue type into Issue class

This commit is contained in:
Maxim Kulkin 2013-09-17 16:19:03 +04:00
parent 18db66377b
commit 83b1bee14f
4 changed files with 9 additions and 9 deletions

View File

@ -91,11 +91,11 @@ class Error:
def __str__(self):
return self.message
ERROR = 'ERROR'
WARNING = 'WARNING'
INFO = 'INFO'
class Issue(object):
ERROR = 'ERROR'
WARNING = 'WARNING'
INFO = 'INFO'
def __init__(self, type, message):
self.type = type
self.message = message

View File

@ -1,6 +1,6 @@
from ostack_validator.common import Mark, MarkedIssue, ERROR
from ostack_validator.common import Mark, Issue, MarkedIssue
class ParseError(MarkedIssue):
def __init__(self, message, mark):
super(ParseError, self).__init__(ERROR, message, mark)
super(ParseError, self).__init__(Issue.ERROR, message, mark)

View File

@ -1,6 +1,6 @@
import logging
from ostack_validator.common import Error, Mark, Issue, Inspection
from ostack_validator.common import Error, Mark, Issue, MarkedIssue, Inspection
from ostack_validator.schema import ConfigSchemaRegistry, TypeValidatorRegistry
import ostack_validator.schemas

View File

@ -1,6 +1,6 @@
import sys
from ostack_validator.common import Inspection, MarkedIssue, ERROR, Mark, Version, find, index
from ostack_validator.common import Inspection, Issue, MarkedIssue, Mark, Version, find, index
class SchemaUpdateRecord(object):
# checkpoint's data is version number
@ -167,7 +167,7 @@ class TypeValidatorRegistry:
class InvalidValueError(MarkedIssue):
def __init__(self, message, mark=Mark('', 1, 1)):
super(InvalidValueError, self).__init__(ERROR, message, mark)
super(InvalidValueError, self).__init__(Issue.ERROR, message, mark)
class TypeValidator(object):
def __init__(self, f):