Commits

Ronny Pfannschmidt committed 26c64b0

more language enum killing patches

  • Participants
  • Parent commits ba6f7a3

Comments (0)

Files changed (4)

kill-most-language-enum-definitions

+# HG changeset patch
+# Parent 967439fac1e58fb7a9dee7afca0de36100eab5ad
+diff --git a/pida/core/languages.py b/pida/core/languages.py
+--- a/pida/core/languages.py
++++ b/pida/core/languages.py
+@@ -16,7 +16,7 @@ from pida.core.projects import Project
+ from pida.core.service import Service
+ from pida.core.features import FeaturesConfig
+ from pida.utils.languages import (
+-    LANG_COMPLETER_TYPES, LANG_PRIO,
++    LANG_PRIO,
+     Suggestion, Definition, ValidationError, Documentation)
+ from pida.utils.path import get_relative_path
+ # locale
+diff --git a/pida/utils/languages.py b/pida/utils/languages.py
+--- a/pida/utils/languages.py
++++ b/pida/utils/languages.py
+@@ -36,31 +36,30 @@ completer_types = [
+     'keyword',
+     'snippet',
+ ]
+-completer_type_order = dict(zip(completer_types, range(len(completer_types))))
+-
+-LANG_COMPLETER_TYPES = Enumeration('LANG_COMPLETER_TYPES', map(str.upper, completer_types))
+ 
+ 
+ 
+ # main types
+-LANG_VALIDATOR_TYPES = Enumeration('LANG_TYPES',
+-    ('UNKNOWN', 'INFO', 'WARNING', 'ERROR', 'FATAL'))
++validator_types = ('unknown', 'info', 'warning', 'error', 'fatal')
+ 
+ # validation sub types
+-LANG_VALIDATOR_SUBTYPES = Enumeration('LANG_VALIDATION_ERRORS',
+-    ('UNKNOWN', 'SYNTAX', 'INDENTATION', 'UNDEFINED', 'REDEFINED', 'BADSTYLE',
+-     'DUPLICATE', 'UNUSED', 'FIXME', 'PROTECTION', 'DANGEROUS'))
++validator_subtypes = (
++    'unknown', 'syntax', 'indentation', 'undefined', 'redefined', 'badstyle',
++    'duplicate', 'unused', 'fixme', 'protection', 'dangerous',
++)
+ 
+ # validation sub types
+ 
+-LANG_TYPES = Enumeration('LANG_TYPES',
+- ('', 'UNKNOWN', 
+- 'ATTRIBUTE', 'BUILTIN', 'CLASS', 'DEFINE', 'ENUMERATION',
+- 'ENUMERATION_NAME', 'FUNCTION', 'IMPORT', 'MEMBER', 'METHOD', 'PROPERTY',
+- 'PROTOTYPE', 'STRUCTURE', 'SUPERMETHOD', 'SUPERPROPERTY', 'TYPEDEF', 'UNION',
+- 'VARIABLE', 'NAMESPACE', 'ELEMENT', 'SECTION', 'CHAPTER', 'PARAGRAPH'))
++types = (
++    'unknown', 'attribute', 'builtin', 'class', 'define', 'enumeration',
++    'enumeration_name', 'function', 'import', 'member', 'method', 'property',
++    'prototype', 'structure', 'supermethod', 'superproperty', 'typedef',
++    'union', 'variable',
++    'namespace', 'element',
++    'section', 'chapter', 'paragraph',
++)
+ 
+-LANG_OUTLINER_TYPES = LANG_TYPES
++outliner_types = types
+ 
+ LANG_PRIO = Enumeration('LANG_PRIORITIES',
+ (
+@@ -74,29 +73,29 @@ LANG_PRIO = Enumeration('LANG_PRIORITIES
+ 
+ 
+ LANG_IMAGE_MAP = {
+-    LANG_TYPES.ATTRIBUTE: 'source-attribute',
+-    LANG_TYPES.BUILTIN: 'source-attribute',
+-    LANG_TYPES.CLASS: 'source-class',
+-    LANG_TYPES.DEFINE: 'source-define',
+-    LANG_TYPES.ENUMERATION: 'source-enum',
+-    LANG_TYPES.ENUMERATION_NAME: 'source-enumarator',
+-    LANG_TYPES.FUNCTION: 'source-function',
+-    LANG_TYPES.IMPORT: 'source-import',
+-    LANG_TYPES.MEMBER: 'source-member',
+-    LANG_TYPES.METHOD: 'source-method',
+-    LANG_TYPES.PROTOTYPE: 'source-interface',
+-    LANG_TYPES.PROPERTY: 'source-property',
+-    LANG_TYPES.METHOD: 'source-method',
+-    LANG_TYPES.SUPERMETHOD: 'source-extramethod',
+-    #FIXME: superproperty icon
+-    LANG_TYPES.SUPERPROPERTY: 'source-property',
+-    LANG_TYPES.TYPEDEF: 'source-typedef',
+-    LANG_TYPES.UNION: 'source-union',
+-    LANG_TYPES.VARIABLE: 'source-variable',
+-    LANG_TYPES.SECTION: 'source-section',
+-    LANG_TYPES.PARAGRAPH: 'source-paragraph',
+-    LANG_TYPES.NAMESPACE: 'source-namespace',
+-    LANG_TYPES.ELEMENT: 'source-element',
++    'attribute': 'Source-attribute',
++    'builtin': 'source-attribute',
++    'class': 'source-class',
++    'define': 'source-define',
++    'enumeration': 'source-enum',
++    'enumeration_name': 'source-enumarator',
++    'function': 'source-function',
++    'import': 'source-import',
++    'member': 'source-member',
++    'method': 'source-method',
++    'prototype': 'source-interface',
++    'property': 'source-property',
++    'method': 'source-method',
++    'supermethod': 'source-extramethod',
++    #fixme: SUPERPROPERTY ICON
++    'superproperty': 'source-property',
++    'typedef': 'source-typedef',
++    'union': 'source-union',
++    'variable': 'source-variable',
++    'section': 'source-section',
++    'paragraph': 'source-paragraph',
++    'namespace': 'source-namespace',
++    'element': 'source-element',
+ }
+ 
+ 
+@@ -148,10 +147,9 @@ class ValidationError(InitObject):
+     """<span foreground="%(typec)s" style="italic" weight="bold">%(type)s</span"""
+     """>:<span style="italic">%(subtype)s</span>\n%(message)s""" % 
+                       {'lineno':self.lineno, 
+-                      'type':_(self.type_.capitalize()),
+-                      'subtype':_(LANG_VALIDATOR_SUBTYPES.whatis(
+-                                    self.subtype).capitalize()),
+-                      'message':self.message,
++                      'type': self.type_.capitalize(),
++                      'subtype': self.subtype.capitalize(),
++                      'message': self.message,
+                       'linecolor': color_to_string(self.lookup_color('pida-lineno')),
+                       'typec': color_to_string(typec),
+                       })
+@@ -177,7 +175,7 @@ class OutlineItem(InitObject):
+     """
+     Outlines are returned by an Outliner class
+     """
+-    type = LANG_TYPES.UNKNOWN
++    type = 'unknown'
+     name = ''
+     parent = None
+     id = None
+@@ -217,7 +215,7 @@ class OutlineItem(InitObject):
+ 
+ class Definition(InitObject):
+     """Returned by a Definer instance"""
+-    type = LANG_TYPES.UNKNOWN
++    type = 'unknown'
+     file_name = None
+     offset = None
+     length = None

kill-outliner-types-enum

+# HG changeset patch
+# Parent f2bd1a42824a40be9726449bad84f44470288189
+diff --git a/pida-plugins/ctags/ctags.py b/pida-plugins/ctags/ctags.py
+--- a/pida-plugins/ctags/ctags.py
++++ b/pida-plugins/ctags/ctags.py
+@@ -37,7 +37,7 @@ from pida.core.options import OptionsCon
+ from pida.core.languages import (LanguageService, Outliner, Validator,
+     Completer, LanguageServiceFeaturesConfig, LanguageInfo, Definer, Documentator)
+ 
+-from pida.utils.languages import (LANG_PRIO, LANG_OUTLINER_TYPES, OutlineItem )
++from pida.utils.languages import LANG_PRIO, OutlineItem
+ 
+ # locale
+ from pida.core.locale import Locale
+@@ -282,19 +282,21 @@ class CtagsOutliner(Outliner):
+ 		v	variable        
+         """
+         def v2t(i):
+-            if i == 'm': return LANG_OUTLINER_TYPES.MEMBER
+-            if i == 'c': return LANG_OUTLINER_TYPES.CLASS
+-            if i == 'd': return LANG_OUTLINER_TYPES.DEFINE
+-            if i == 'e': return LANG_OUTLINER_TYPES.ENUMERATION
+-            if i == 'f': return LANG_OUTLINER_TYPES.FUNCTION
+-            if i == 'g': return LANG_OUTLINER_TYPES.ENUMERATION_NAME
+-            if i == 'n': return LANG_OUTLINER_TYPES.NAMESPACE
+-            if i == 'p': return LANG_OUTLINER_TYPES.PROTOTYPE
+-            if i == 's': return LANG_OUTLINER_TYPES.STRUCTURE
+-            if i == 't': return LANG_OUTLINER_TYPES.TYPEDEF
+-            if i == 'u': return LANG_OUTLINER_TYPES.UNION
+-            if i == 'v': return LANG_OUTLINER_TYPES.VARIABLE
+-            return LANG_OUTLINER_TYPES.UNKNOWN
++            mapping = {
++                'm': 'member',
++                'c': 'class',
++                'd': 'define',
++                'e': 'enumeration',
++                'f': 'function',
++                'g': 'enumeration_name',
++                'n': 'namespace',
++                'p': 'prototype',
++                's': 'structure',
++                't': 'typedef',
++                'u': 'union',
++                'v': 'variable',
++            }
++            return mapping.get(i, 'unknown')
+ 
+         if len(tokrow) == 4 and isinstance(tokrow[3], int):
+             return tokrow[3]
+@@ -304,8 +306,8 @@ class CtagsOutliner(Outliner):
+                 return v2t(i)# most common case: just one char
+             elif i[:4] == "kind":
+                 return v2t(i[5:])
+-            return LANG_OUTLINER_TYPES.UNKNOWN
+-        return LANG_OUTLINER_TYPES.UNKNOWN
++            return 'unknown'
++        return 'unknown'
+ 
+ 
+     def _get_container_name(self, tokrow):
+@@ -327,15 +329,9 @@ class CtagsOutliner(Outliner):
+         """ class, enumerations, structs and unions are considerer containers.
+             See Issue 13 for some issues we had with this.
+         """
+-        if self._get_type(tokrow) in (
+-            LANG_OUTLINER_TYPES.CLASS,
+-            LANG_OUTLINER_TYPES.ENUMERATION_NAME,
+-            LANG_OUTLINER_TYPES.STRUCTURE,
+-            LANG_OUTLINER_TYPES.UNION,
+-            LANG_OUTLINER_TYPES.TYPEDEF): 
+-                return True
+-        return False
+-            
++        return self._get_type(tokrow) in (
++            'class', 'enumeration_name',
++            'structure', 'union', 'typedef')
+         # remove temp file
+         #os.remove(tmpfile)
+ 
+diff --git a/pida-plugins/python/python.py b/pida-plugins/python/python.py
+--- a/pida-plugins/python/python.py
++++ b/pida-plugins/python/python.py
+@@ -38,7 +38,6 @@ from pida.core.languages import (Languag
+     Documentator, External)
+ 
+ from pida.utils.languages import (
+-    LANG_OUTLINER_TYPES, 
+     LANG_PRIO, Definition, Suggestion, Documentation, ValidationError)
+ 
+ # services
+@@ -131,14 +130,10 @@ class PythonOutliner(Outliner):
+     description = _("A very deep and precises, but slow outliner")
+ 
+ 
+-    filter_type = (LANG_OUTLINER_TYPES.IMPORT,
+-                    LANG_OUTLINER_TYPES.BUILTIN,
+-                    LANG_OUTLINER_TYPES.METHOD,
+-                    LANG_OUTLINER_TYPES.FUNCTION,
+-                    LANG_OUTLINER_TYPES.PROPERTY,
+-                    LANG_OUTLINER_TYPES.ATTRIBUTE,
+-                    LANG_OUTLINER_TYPES.SUPERMETHOD,
+-                    )
++    filter_type = (
++        'import', 'builtin', 'method', 'function',
++        'property', 'attribute', 'supermethod',
++        )
+ 
+     def get_outline(self):
+         from rope.base.exceptions import RopeError
+diff --git a/pida-plugins/python/ropebrowser.py b/pida-plugins/python/ropebrowser.py
+--- a/pida-plugins/python/ropebrowser.py
++++ b/pida-plugins/python/ropebrowser.py
+@@ -14,7 +14,7 @@ from pida.core.projects import Project a
+ from rope.base.project import Project, get_no_project
+ from rope.base import pynames, pyobjects, builtins
+ 
+-from pida.utils.languages import LANG_OUTLINER_TYPES, OutlineItem
++from pida.utils.languages import OutlineItem
+ from itertools import count
+ 
+ OUTLINE_COUNTER = count()
+@@ -70,7 +70,7 @@ class TreeOptions(object):
+     position = 0
+     has_children = False
+     icon_name = 'source-property'
+-    filter_type =  LANG_OUTLINER_TYPES.UNKNOWN
++    filter_type = 'unknown'
+ 
+     def __init__(self, treeitem, obj):
+         pass
+@@ -91,7 +91,7 @@ class FunctionOptions(TreeOptions):
+     icon_name = 'source-function'
+     type_color = '#900000'
+     position = 2
+-    filter_type = LANG_OUTLINER_TYPES.UNKNOWN
++    filter_type = 'unknown'
+ 
+     def __init__(self, item, obj):
+         decs = []
+@@ -126,13 +126,13 @@ class EvaluatedOptions(TreeOptions):
+     type_name = 'p'
+     icon_name = 'source-property'
+     type_color = '#900090'
+-    filter_type = LANG_OUTLINER_TYPES.PROPERTY
++    filter_type = 'property'
+ 
+ class MethodOptions(FunctionOptions):
+ 
+     type_name = 'm'
+     icon_name = 'source-method'
+-    filter_type = LANG_OUTLINER_TYPES.METHOD
++    filter_type = 'method'
+ 
+ 
+ class SuperMethodOptions(MethodOptions):
+@@ -140,7 +140,7 @@ class SuperMethodOptions(MethodOptions):
+     type_name = '(m)'
+     icon_name = 'source-extramethod'
+     position = 6
+-    filter_type = LANG_OUTLINER_TYPES.SUPERMETHOD
++    filter_type = 'supermethod'
+ 
+ 
+ class ClassMethodOptions(MethodOptions):
+@@ -188,7 +188,7 @@ class AssignedOptions(TreeOptions):
+     icon_name = 'source-attribute'
+     type_color = '#009000'
+     position = 5
+-    filter_type = LANG_OUTLINER_TYPES.ATTRIBUTE
++    filter_type = 'attribute'
+ 
+ 
+ class BuiltinOptions(TreeOptions):
+@@ -197,7 +197,7 @@ class BuiltinOptions(TreeOptions):
+     icon_name = None
+     type_color = '#999999'
+     position = 7
+-    filter_type = LANG_OUTLINER_TYPES.BUILTIN
++    filter_type = 'builtin'
+ 
+ 
+ class ImportedOptions(TreeOptions):
+@@ -206,7 +206,7 @@ class ImportedOptions(TreeOptions):
+     icon_name = 'source-import'
+     type_color = '#999999'
+     position = 8
+-    filter_type = LANG_OUTLINER_TYPES.IMPORT
++    filter_type = 'import'
+ 
+ 
+ def get_option_for_item(item, node, obj, parent_obj=None):
+diff --git a/pida-plugins/rst/rst.py b/pida-plugins/rst/rst.py
+--- a/pida-plugins/rst/rst.py
++++ b/pida-plugins/rst/rst.py
+@@ -13,7 +13,7 @@ from collections import defaultdict
+ # PIDA imports
+ from pida.core.languages import LanguageService, Outliner, Validator
+ from pida.utils.languages import (
+-    LANG_PRIO, LANG_OUTLINER_TYPES,
++    LANG_PRIO,
+     OutlineItem, ValidationError,
+ )
+ from pida.services.language import DOCTYPES
+@@ -247,8 +247,7 @@ class RSTOutliner(Outliner):
+     name = "rst outliner"
+     description = _("An outliner for ReStructuredText")
+ 
+-    section_types = (LANG_OUTLINER_TYPES.SECTION,
+-                     LANG_OUTLINER_TYPES.PARAGRAPH)
++    section_types = ('section', 'paragraph')
+ 
+     def get_outline(self):
+         self.doc_items = RSTTokenList()
+@@ -280,7 +279,7 @@ class RSTOutliner(Outliner):
+                   isinstance(node, nodes.figure)):
+                 new_item = True
+                 name = node.attributes['uri']
+-                type = LANG_OUTLINER_TYPES.UNKNOWN
++                type = 'unknown'
+                 is_container = False
+                 # nodes with options have no line attribute
+                 linenumber = node.line or node.parent.line
+diff --git a/pida/services/language/outlinefilter.py b/pida/services/language/outlinefilter.py
+--- a/pida/services/language/outlinefilter.py
++++ b/pida/services/language/outlinefilter.py
+@@ -1,56 +1,54 @@
+-from pida.utils.languages import LANG_OUTLINER_TYPES
+-
+ FILTERMAP = {
+-    LANG_OUTLINER_TYPES.IMPORT: {
++    'import': {
+         "name": "import",
+         "alias": "include",
+         "display": "Imports",
+         "icon": "source-import",
+         "default": True 
+     },
+-    LANG_OUTLINER_TYPES.BUILTIN: {
++    'builtin': {
+         "name": "builtin",
+         "alias": "",
+         "display": "Builtins",
+         "icon": "source-module",
+         "default": True
+     },
+-    LANG_OUTLINER_TYPES.ATTRIBUTE: {
++    'attribute': {
+         "name": "attribute",
+         "alias": "",
+         "display": "Attributes",
+         "icon": "source-attribute",
+         "default": True
+     },
+-    LANG_OUTLINER_TYPES.METHOD: {
++    'method': {
+         "name": "method",
+         "alias": "",
+         "display": "Methods",
+         "icon": "source-method",
+         "default": True
+     },
+-    LANG_OUTLINER_TYPES.PROPERTY: {
++    'property': {
+         "name": "property",
+         "alias": "",
+         "display": "Properties",
+         "icon": "source-property",
+         "default": True
+     },
+-    LANG_OUTLINER_TYPES.FUNCTION: {
++    'function': {
+         "name": "function",
+         "alias": "",
+         "display": "Functions",
+         "icon": "source-function",
+         "default": True
+     },
+-    LANG_OUTLINER_TYPES.SUPERMETHOD: {
++    'supermethod': {
+         "name": "import",
+         "alias": "include",
+         "display": "Super methods",
+         "icon": "source-extramethod",
+         "default": True 
+     },
+-    LANG_OUTLINER_TYPES.SUPERPROPERTY: {
++    'superproperty': {
+         "name": "import",
+         "alias": "include",
+         "display": "Super properties",

kill-validator-types-subtypes-enums

+# HG changeset patch
+# Parent 7930fec0ec63b77ed20bffeaceb32581d1f496f5
+diff --git a/pida-plugins/python/python.py b/pida-plugins/python/python.py
+--- a/pida-plugins/python/python.py
++++ b/pida-plugins/python/python.py
+@@ -38,7 +38,7 @@ from pida.core.languages import (Languag
+     Documentator, External)
+ 
+ from pida.utils.languages import (
+-    LANG_VALIDATOR_TYPES, LANG_VALIDATOR_SUBTYPES, LANG_OUTLINER_TYPES, 
++    LANG_OUTLINER_TYPES, 
+     LANG_PRIO, Definition, Suggestion, Documentation, ValidationError)
+ 
+ # services
+@@ -222,22 +222,22 @@ def _create_exception_validation(e):
+     msg.lineno = lineno
+     msg.message_args = (line,)
+     msg.message = '<tt>%%s</tt>\n<tt>%s^</tt>' % (' ' * (offset - 2))
+-    msg.type_ = LANG_VALIDATOR_TYPES.ERROR
++    msg.type_ = 'error'
+     if isinstance(e, SyntaxError):
+-        msg.subtype = LANG_VALIDATOR_SUBTYPES.SYNTAX
++        msg.subtype = 'syntax'
+     else:
+-        msg.subtype = LANG_VALIDATOR_SUBTYPES.INDENTATION
++        msg.subtype = 'indentation'
+     return [msg]
+ 
+ class PythonError(ValidationError):
+     def get_markup(self):
+         args = [('<b>%s</b>' % arg) for arg in self.message_args]
+         message_string = self.message % tuple(args)
+-        if self.type_ == LANG_VALIDATOR_TYPES.ERROR:
++        if self.type_ == 'error':
+             typec = self.lookup_color('pida-val-error')
+-        elif self.type_ == LANG_VALIDATOR_TYPES.INFO:
++        elif self.type_ == 'info':
+             typec = self.lookup_color('pida-val-info')
+-        elif self.type_ == LANG_VALIDATOR_TYPES.WARNING:
++        elif self.type_ == 'warning':
+             typec = self.lookup_color('pida-val-warning')
+         else:
+             typec = self.lookup_color('pida-val-def')
+@@ -257,10 +257,9 @@ class PythonError(ValidationError):
+     """<span foreground="%(typec)s" style="italic" weight="bold">%(type)s</span"""
+     """>:<span style="italic">%(subtype)s</span>\n%(message)s""" % 
+                       {'lineno':self.lineno, 
+-                      'type':_(LANG_VALIDATOR_TYPES.whatis(self.type_).capitalize()),
+-                      'subtype':_(LANG_VALIDATOR_SUBTYPES.whatis(
+-                                    self.subtype).capitalize()),
+-                      'message':message_string,
++                      'type': self.type_.capitalize(),
++                      'subtype': self.subtype.capitalize(),
++                      'message': message_string,
+                       'linecolor': linecolor,
+                       'typec': typec,
+                       })
+@@ -285,26 +284,27 @@ class PythonValidator(Validator):
+             w = Checker(tree, filename)
+             messages = w.messages
+         for m in messages:
+-            type_ = getattr(m, 'type_', LANG_VALIDATOR_TYPES.UNKNOWN)
+-            subtype = getattr(m, 'subtype', LANG_VALIDATOR_SUBTYPES.UNKNOWN)
+ 
+             #FIXME add pyflakes 0.3 types
+             #FIXME make mapping
+             if isinstance(m, pyflakes.messages.UnusedImport):
+-                type_ = LANG_VALIDATOR_TYPES.INFO
+-                subtype = LANG_VALIDATOR_SUBTYPES.UNUSED
++                type_ = 'info'
++                subtype = 'unused'
+             elif isinstance(m, pyflakes.messages.RedefinedWhileUnused):
+-                type_ = LANG_VALIDATOR_TYPES.WARNING
+-                subtype = LANG_VALIDATOR_SUBTYPES.REDEFINED
++                type_ = 'warning'
++                subtype = 'redefined'
+             elif isinstance(m, pyflakes.messages.ImportStarUsed):
+-                type_ = LANG_VALIDATOR_TYPES.WARNING
+-                subtype = LANG_VALIDATOR_SUBTYPES.BADSTYLE
++                type_ = 'warning'
++                subtype = 'badstyle'
+             elif isinstance(m, pyflakes.messages.UndefinedName):
+-                type_ = LANG_VALIDATOR_TYPES.ERROR
+-                subtype = LANG_VALIDATOR_SUBTYPES.UNDEFINED
++                type_ = 'error'
++                subtype = 'undefined'
+             elif isinstance(m, pyflakes.messages.DuplicateArgument):
+-                type_ = LANG_VALIDATOR_TYPES.ERROR
+-                subtype = LANG_VALIDATOR_SUBTYPES.DUPLICATE
++                type_ = 'error'
++                subtype = 'duplicate'
++            else:
++                type_ = 'unknown'
++                subtype = 'unknown'
+ 
+             ve = PythonError(
+                 message=m.message,
+diff --git a/pida-plugins/python_lint/python_lint.py b/pida-plugins/python_lint/python_lint.py
+--- a/pida-plugins/python_lint/python_lint.py
++++ b/pida-plugins/python_lint/python_lint.py
+@@ -21,8 +21,7 @@ from pida.core.options import OptionsCon
+ from pida.core.log import Log
+ 
+ from pida.core.languages import (LanguageService, Validator, External)
+-from pida.utils.languages import (LANG_COMPLETER_TYPES,
+-    LANG_VALIDATOR_TYPES, LANG_VALIDATOR_SUBTYPES, LANG_PRIO,
++from pida.utils.languages import (LANG_PRIO,
+    Definition, Suggestion, Documentation, ValidationError)
+ 
+ # locale
+@@ -90,16 +89,15 @@ except ImportError:
+ #         pass
+ 
+ SUBTYPE_MAPPING = {
+-'W0511': LANG_VALIDATOR_SUBTYPES.FIXME,
+-'W0622': LANG_VALIDATOR_SUBTYPES.REDEFINED,
+-'W0611': LANG_VALIDATOR_SUBTYPES.UNUSED,
+-'W0612': LANG_VALIDATOR_SUBTYPES.UNUSED,
+-'E1101': LANG_VALIDATOR_SUBTYPES.UNDEFINED,
+-'W0201': LANG_VALIDATOR_SUBTYPES.UNDEFINED,
+-'W0212': LANG_VALIDATOR_SUBTYPES.PROTECTION,
+-'W0703': LANG_VALIDATOR_SUBTYPES.DANGEROUS,
+-'W0107': LANG_VALIDATOR_SUBTYPES.UNUSED,
+-
++    'W0511': 'fixme',
++    'W0622': 'redefined',
++    'W0611': 'unused',
++    'W0612': 'unused',
++    'E1101': 'undefined',
++    'W0201': 'undefined',
++    'W0212': 'protection',
++    'W0703': 'dangerous',
++    'W0107': 'unused',
+ }
+ 
+ 
+@@ -122,11 +120,11 @@ class PythonError(ValidationError, Log):
+                 message_string = self.message
+         else:
+             message_string = self.message
+-        if self.type_ == LANG_VALIDATOR_TYPES.ERROR:
++        if self.type_ == 'error':
+             typec = self.lookup_color('pida-val-error')
+-        elif self.type_ == LANG_VALIDATOR_TYPES.INFO:
++        elif self.type_ == 'error':
+             typec = self.lookup_color('pida-val-info')
+-        elif self.type_ == LANG_VALIDATOR_TYPES.WARNING:
++        elif self.type_ == 'warning':
+             typec = self.lookup_color('pida-val-warning')
+         else:
+             typec = self.lookup_color('pida-val-def')
+@@ -144,10 +142,9 @@ class PythonError(ValidationError, Log):
+     """>:<span style="italic">%(subtype)s</span>  -  """
+     """<span size="small" style="italic">%(msg_id)s</span>\n%(message)s""" % 
+                       {'lineno':self.lineno,
+-                      'type':_(LANG_VALIDATOR_TYPES.whatis(self.type_).capitalize()),
+-                      'subtype':_(LANG_VALIDATOR_SUBTYPES.whatis(
+-                                    self.subtype).capitalize()),
+-                      'message':message_string,
++                      'type': self.type_.capitalize(),
++                      'subtype': self.subtype.capitalize(),
++                      'message': message_string,
+                       'linecolor': linecolor,
+                       'typec': typec,
+                       'msg_id': self.msg_id
+@@ -225,26 +222,26 @@ class PidaLinter(PyLinter, Log):
+             return        
+         # update stats
+         if msg_id[0] == 'I':
+-            ty = LANG_VALIDATOR_TYPES.INFO
+-            sty = LANG_VALIDATOR_SUBTYPES.UNKNOWN
++            ty = 'info'
++            sty = 'unknown'
+         elif msg_id[0] == 'C':
+-            ty = LANG_VALIDATOR_TYPES.INFO
+-            sty = LANG_VALIDATOR_SUBTYPES.BADSTYLE
++            ty = 'info'
++            sty = 'badstyle'
+         elif msg_id[0] == 'R':
+-            ty = LANG_VALIDATOR_TYPES.WARNING
+-            sty = LANG_VALIDATOR_SUBTYPES.BADSTYLE
++            ty = 'info'
++            sty = 'badstyle'
+         elif msg_id[0] == 'W':
+-            ty = LANG_VALIDATOR_TYPES.WARNING
+-            sty = LANG_VALIDATOR_SUBTYPES.UNKNOWN
++            ty = 'warning'
++            sty = 'unknown'
+         elif msg_id[0] == 'E':
+-            ty = LANG_VALIDATOR_TYPES.ERROR
+-            sty = LANG_VALIDATOR_SUBTYPES.UNKNOWN
++            ty = 'error'
++            sty = 'unknown'
+         elif msg_id[0] == 'F':
+-            ty = LANG_VALIDATOR_TYPES.FATAL
+-            sty = LANG_VALIDATOR_SUBTYPES.UNKNOWN
++            ty = 'fatal'
++            sty = 'unknown'
+         else:
+-            ty = LANG_VALIDATOR_TYPES.UNKNOWN
+-            sty = LANG_VALIDATOR_SUBTYPES.UNKNOWN
++            ty = 'unknown'
++            sty = 'unknown'
+ 
+         #msg_cat = MSG_TYPES[msg_id[0]]
+         #self.stats[msg_cat] += 1
+diff --git a/pida-plugins/rst/rst.py b/pida-plugins/rst/rst.py
+--- a/pida-plugins/rst/rst.py
++++ b/pida-plugins/rst/rst.py
+@@ -12,9 +12,10 @@ from collections import defaultdict
+ 
+ # PIDA imports
+ from pida.core.languages import LanguageService, Outliner, Validator
+-from pida.utils.languages import (LANG_PRIO,
+-    LANG_OUTLINER_TYPES, OutlineItem,
+-    LANG_VALIDATOR_TYPES, LANG_VALIDATOR_SUBTYPES, ValidationError)
++from pida.utils.languages import (
++    LANG_PRIO, LANG_OUTLINER_TYPES,
++    OutlineItem, ValidationError,
++)
+ from pida.services.language import DOCTYPES
+ 
+ # docutils imports
+@@ -312,7 +313,7 @@ class RSTValidator(Validator):
+     name = "rst validator"
+     description = _("A validator for ReStructuredText")
+ 
+-    subtype = LANG_VALIDATOR_SUBTYPES.SYNTAX
++    subtype = 'syntax'
+ 
+     def get_validations(self):
+         self.rstplugin = RSTPlugin(self.svc)
+@@ -335,9 +336,7 @@ class RSTValidator(Validator):
+         message = textwrap.fill(msg.children[0].children[0].data, width)
+         # docutils defines the following error levels:
+         #     "info/1", '"warning"/"2" (default), "error"/"3", "severe"/"4"
+-        type_ = (LANG_VALIDATOR_TYPES.INFO, LANG_VALIDATOR_TYPES.WARNING,
+-                 LANG_VALIDATOR_TYPES.ERROR, LANG_VALIDATOR_TYPES.FATAL
+-                )[msg['level'] - 1]
++        type_ = ('info', 'warning', 'error', 'fatal')[msg['level'] - 1]
+         filename = msg.source
+         lineno = msg.line
+         return (message, type_, filename, lineno)
+diff --git a/pida/core/languages.py b/pida/core/languages.py
+--- a/pida/core/languages.py
++++ b/pida/core/languages.py
+@@ -15,8 +15,8 @@ from pida.core.document import Document
+ from pida.core.projects import Project
+ from pida.core.service import Service
+ from pida.core.features import FeaturesConfig
+-from pida.utils.languages import (LANG_COMPLETER_TYPES,
+-    LANG_VALIDATOR_TYPES, LANG_VALIDATOR_SUBTYPES, LANG_PRIO,
++from pida.utils.languages import (
++    LANG_COMPLETER_TYPES, LANG_PRIO,
+     Suggestion, Definition, ValidationError, Documentation)
+ from pida.utils.path import get_relative_path
+ # locale
+diff --git a/pida/utils/languages.py b/pida/utils/languages.py
+--- a/pida/utils/languages.py
++++ b/pida/utils/languages.py
+@@ -117,8 +117,8 @@ class ValidationError(InitObject):
+     """Message a Validator should return"""
+     message = ''
+     message_args = None
+-    type_ = LANG_VALIDATOR_TYPES.UNKNOWN
+-    subtype = LANG_VALIDATOR_SUBTYPES.UNKNOWN
++    type_ = 'unknown'
++    subtype = 'unknown'
+     filename = None
+     lineno = None
+ 
+@@ -135,11 +135,11 @@ class ValidationError(InitObject):
+         pass
+ 
+     def get_markup(self):
+-        if self.type_ == LANG_VALIDATOR_TYPES.ERROR:
++        if self.type_ == 'error':
+             typec = self.lookup_color('pida-val-error')
+-        elif self.type_ == LANG_VALIDATOR_TYPES.INFO:
++        elif self.type_ == 'info':
+             typec = self.lookup_color('pida-val-info')
+-        elif self.type_ == LANG_VALIDATOR_TYPES.WARNING:
++        elif self.type_ == 'warning':
+             typec = self.lookup_color('pida-val-warning')
+         else:
+             typec = self.lookup_color('pida-val-def')
+@@ -148,7 +148,7 @@ class ValidationError(InitObject):
+     """<span foreground="%(typec)s" style="italic" weight="bold">%(type)s</span"""
+     """>:<span style="italic">%(subtype)s</span>\n%(message)s""" % 
+                       {'lineno':self.lineno, 
+-                      'type':_(LANG_VALIDATOR_TYPES.whatis(self.type_).capitalize()),
++                      'type':_(self.type_.capitalize()),
+                       'subtype':_(LANG_VALIDATOR_SUBTYPES.whatis(
+                                     self.subtype).capitalize()),
+                       'message':self.message,
 kill-completer-types-enum
+kill-validator-types-subtypes-enums
+kill-outliner-types-enum
+kill-most-language-enum-definitions
 pypath-for-options
 core-pdbus-pyxml-introspect #+dbus
 pida-remote-cleanup