Commits

Ronny Pfannschmidt committed 44065ec

finish most of the symbol translation

  • Participants
  • Parent commits 07c3cca

Comments (0)

Files changed (3)

cleanup-validator-markup

 # HG changeset patch
 # Parent 24ccd4947bee2bb0bf9cbf74b2460b55a9bf6b1d
+
 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
 -                      'type': self.level.capitalize(),
 -                      'subtype': self.kind.capitalize(),
 -                      'message':self.message,
-+        return self.markup_string.format(**{
-+                      'lineno': self.lineno,
-+                      'level': self.level.capitalize(),
-+                      'level_color': color_to_string(typec),
-+                      'kind': self.kind.capitalize(),
-+                      'message': self.message,
-                       'linecolor': color_to_string(self.lookup_color('pida-lineno')),
+-                      'linecolor': color_to_string(self.lookup_color('pida-lineno')),
 -                      'typec': color_to_string(typec),
-                       })
+-                      })
 -        return markup
 -    markup = property(get_markup)
++        return {
++            'lineno': self.lineno,
++            'level': self.level.capitalize(),
++            'level_color': color_to_string(typec),
++            'kind': self.kind.capitalize(),
++            'message': self.message,
++            'linecolor': color_to_string(self.lookup_color('pida-lineno')),
++        }
  
  
  

kill-lang-types-enum

+# HG changeset patch
+# Parent 87515d1256a4a1513bcf37c06ff3720d1fa8d156
+diff --git a/pida/utils/languages.py b/pida/utils/languages.py
+--- a/pida/utils/languages.py
++++ b/pida/utils/languages.py
+@@ -51,14 +51,13 @@ VALIDATOR_LEVEL = Symbols('validation le
+ 
+ # 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'))
++OUTLINER = Symbols('outline',
++ ('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
+ 
+ LANG_PRIO = Enumeration('LANG_PRIORITIES',
+ (
+@@ -72,29 +71,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',
++    OUTLINER.ATTRIBUTE: 'source-attribute',
++    OUTLINER.BUILTIN: 'source-attribute',
++    OUTLINER.CLASS: 'source-class',
++    OUTLINER.DEFINE: 'source-define',
++    OUTLINER.ENUMERATION: 'source-enum',
++    OUTLINER.ENUMERATION_NAME: 'source-enumarator',
++    OUTLINER.FUNCTION: 'source-function',
++    OUTLINER.IMPORT: 'source-import',
++    OUTLINER.MEMBER: 'source-member',
++    OUTLINER.METHOD: 'source-method',
++    OUTLINER.PROTOTYPE: 'source-interface',
++    OUTLINER.PROPERTY: 'source-property',
++    OUTLINER.METHOD: 'source-method',
++    OUTLINER.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',
++    OUTLINER.SUPERPROPERTY: 'source-property',
++    OUTLINER.TYPEDEF: 'source-typedef',
++    OUTLINER.UNION: 'source-union',
++    OUTLINER.VARIABLE: 'source-variable',
++    OUTLINER.SECTION: 'source-section',
++    OUTLINER.PARAGRAPH: 'source-paragraph',
++    OUTLINER.NAMESPACE: 'source-namespace',
++    OUTLINER.ELEMENT: 'source-element',
+ }
+ 
+ 
+@@ -169,7 +168,7 @@ class OutlineItem(InitObject):
+     """
+     Outlines are returned by an Outliner class
+     """
+-    type = LANG_TYPES.UNKNOWN
++    type = OUTLINER.UNKNOWN
+     name = ''
+     parent = None
+     id = None
+@@ -206,7 +205,7 @@ class OutlineItem(InitObject):
+ 
+ class Definition(InitObject):
+     """Returned by a Definer instance"""
+-    type = LANG_TYPES.UNKNOWN
++    type = OUTLINER.UNKNOWN
+     file_name = None
+     offset = None
+     length = None
 kill-outliner-types-enum
 pylint-kill-skeleton
 cleanup-validator-markup
+kill-lang-types-enum
 core-pdbus-pyxml-introspect #+dbus
 pida-remote-cleanup
 non-optional-core-pdbus #+dbus #-stable