Commits

Ronny Pfannschmidt committed 59778ef

more upgrades

  • Participants
  • Parent commits 44065ec

Comments (0)

Files changed (7)

File cleanup-validator-markup

 # HG changeset patch
-# Parent 24ccd4947bee2bb0bf9cbf74b2460b55a9bf6b1d
+# Parent a90abeb0ee35dabdf3cf47f07451c79adb10bf55
+clean up how ValidationError renders to markup
 
 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
-@@ -63,7 +63,7 @@ class PythonError(ValidationError, Log):
+@@ -62,7 +62,7 @@ class PythonError(ValidationError, Log):
      """
      Validator class for PyLint errrors
      """
          if self.message_args:
              try:
                  if isinstance(self.message_args, (list, tuple)):
-@@ -78,38 +78,9 @@ class PythonError(ValidationError, Log):
+@@ -77,38 +77,9 @@ class PythonError(ValidationError, Log):
                  message_string = self.message
          else:
              message_string = self.message
 diff --git a/pida/utils/languages.py b/pida/utils/languages.py
 --- a/pida/utils/languages.py
 +++ b/pida/utils/languages.py
-@@ -120,6 +120,15 @@ class ValidationError(InitObject):
+@@ -119,6 +119,15 @@ class ValidationError(InitObject):
      filename = None
      lineno = None
  
      def __str__(self):
          return '%s:%s: %s' % (self.filename, self.lineno, self.message)
  
-@@ -132,7 +141,12 @@ class ValidationError(InitObject):
+@@ -131,7 +140,12 @@ class ValidationError(InitObject):
          # FIXME
          pass
  
 +
 +    def markup_args(self):
          mapping = {
-             'error': 'pida-val-error',
-             'info': 'pida-val-info',
-@@ -140,18 +154,14 @@ class ValidationError(InitObject):
+             VALIDATOR_LEVEL.ERROR: 'pida-val-error',
+             VALIDATOR_LEVEL.INFO: 'pida-val-info',
+@@ -139,18 +153,14 @@ class ValidationError(InitObject):
          }
          typec = mapping.get(self.kind, 'pida-val-def')
  

File kill-completer-types-enum

 # User Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
 # Date 1280876358 -7200
 # Node ID dc2797856c153b649049583ebef79122fcfe43fd
-# Parent aabde088e793c433aefdcd3576681d60c79b63cf
-imported patch kill-completer-types-enum
+# Parent 70668252cb974184036347b7f8736aea8f152251
+replace LANG_COMPLETER_TYPES with a symbol bag
 
 diff --git a/pida-plugins/python/python.py b/pida-plugins/python/python.py
 --- a/pida-plugins/python/python.py
 -    LANG_COMPLETER_TYPES.PARAMETER:   _load_pix('source-attribute.png'), # FIXME
 -    LANG_COMPLETER_TYPES.BUILTIN:     _load_pix('source-attribute.png'), # FIXME
 -    LANG_COMPLETER_TYPES.KEYWORD:     _load_pix('source-attribute.png'), # FIXME
-+    'unknown':     _load_pix('element-event-16.png'),
-+    'attribute':   _load_pix('source-attribute.png'),
-+    'class':       _load_pix('source-class.png'),
-+    'function':    _load_pix('source-attribute.png'), # FIXME
-+    'method':      _load_pix('source-attribute.png'),
-+    'module':      _load_pix('source-method.png'),
-+    'property':    _load_pix('source-property.png'),
-+    'extramethod': _load_pix('source-extramethod.png'),
-+    'variable':    _load_pix('source-attribute.png'), # FIXME
-+    'import':      _load_pix('source-import.png'),
-+    'parameter':   _load_pix('source-attribute.png'), # FIXME
-+    'builtin':     _load_pix('source-attribute.png'), # FIXME
-+    'keyword':     _load_pix('source-attribute.png'), # FIXME
++    COMPLETER.UNKNOWN:     _load_pix('element-event-16.png'),
++    COMPLETER.ATTRIBUTE:   _load_pix('source-attribute.png'),
++    COMPLETER.CLASS:       _load_pix('source-class.png'),
++    COMPLETER.FUNCTION:    _load_pix('source-attribute.png'), # FIXME
++    COMPLETER.METHOD:      _load_pix('source-attribute.png'),
++    COMPLETER.MODULE:      _load_pix('source-method.png'),
++    COMPLETER.PROPERTY:    _load_pix('source-property.png'),
++    COMPLETER.EXTRAMETHOD: _load_pix('source-extramethod.png'),
++    COMPLETER.VARIABLE:    _load_pix('source-attribute.png'), # FIXME
++    COMPLETER.IMPORT:      _load_pix('source-import.png'),
++    COMPLETER.PARAMETER:   _load_pix('source-attribute.png'), # FIXME
++    COMPLETER.BUILTIN:     _load_pix('source-attribute.png'), # FIXME
++    COMPLETER.KEYWORD:     _load_pix('source-attribute.png'), # FIXME
  }
  
  
 -            rv[0] = _PIXMAPS[args[0]]
 -        else:
 -            rv[0] = _PIXMAPS[LANG_COMPLETER_TYPES.UNKNOWN]
-+        rv[0] = _PIXMAPS.get(args[0], _PIXMAPS['unknown'])
++        rv[0] = _PIXMAPS.get(args[0], _PIXMAPS[COMPLETER.UNKNOWN])
          return rv
  
  class PidaCompleterWindow(gtk.Window):

File 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

File kill-outliner-types-enum

 # User Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
 # Date 1280876358 -7200
 # Node ID d2deb6f3af308ed68f2952d00e9a6c533cf5c978
-# Parent 893c14aa765d20c78af4b2a47aef3bbf992b8f42
-imported patch kill-outliner-types-enum
+# Parent 67c254c58f20267d279479e02de51171cfe7b0d0
+replace the LANG_TYPES enum with the OUTLINER symbol bag
 
 diff --git a/pida-plugins/ctags/ctags.py b/pida-plugins/ctags/ctags.py
 --- a/pida-plugins/ctags/ctags.py
 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 @@
+@@ -1,56 +1,56 @@
 -from pida.utils.languages import LANG_OUTLINER_TYPES
--
++from pida.utils.languages import OUTLINER
+ 
  FILTERMAP = {
 -    LANG_OUTLINER_TYPES.IMPORT: {
-+    'import': {
++    OUTLINER.IMPORT: {
          "name": "import",
          "alias": "include",
          "display": "Imports",
          "default": True 
      },
 -    LANG_OUTLINER_TYPES.BUILTIN: {
-+    'builtin': {
++    OUTLINER.BUILTIN: {
          "name": "builtin",
          "alias": "",
          "display": "Builtins",
          "default": True
      },
 -    LANG_OUTLINER_TYPES.ATTRIBUTE: {
-+    'attribute': {
++    OUTLINER.ATTRIBUTE: {
          "name": "attribute",
          "alias": "",
          "display": "Attributes",
          "default": True
      },
 -    LANG_OUTLINER_TYPES.METHOD: {
-+    'method': {
++    OUTLINER.METHOD: {
          "name": "method",
          "alias": "",
          "display": "Methods",
          "default": True
      },
 -    LANG_OUTLINER_TYPES.PROPERTY: {
-+    'property': {
++    OUTLINER.PROPERTY: {
          "name": "property",
          "alias": "",
          "display": "Properties",
          "default": True
      },
 -    LANG_OUTLINER_TYPES.FUNCTION: {
-+    'function': {
++    OUTLINER.FUNCTION: {
          "name": "function",
          "alias": "",
          "display": "Functions",
          "default": True
      },
 -    LANG_OUTLINER_TYPES.SUPERMETHOD: {
-+    'supermethod': {
++    OUTLINER.SUPERMETHOD: {
          "name": "import",
          "alias": "include",
          "display": "Super methods",
          "default": True 
      },
 -    LANG_OUTLINER_TYPES.SUPERPROPERTY: {
-+    'superproperty': {
++    OUTLINER.SUPERPROPERTY: {
          "name": "import",
          "alias": "include",
          "display": "Super properties",
              for f in self.filter_map:
                  tool_button = gtk.ToggleToolButton()
 -                tool_button.set_name(str(f))
-+                tool_button.set_name(f)
++                tool_button.set_data('pida/outliner', f)
                  tool_button.set_active(self.filter_map[f])
                  #FIXME no tooltip on win32
                  if not on_windows:
-@@ -539,7 +539,7 @@ class BrowserView(PidaView):
+@@ -539,7 +539,8 @@ class BrowserView(PidaView):
          self.options_vbox.show_all()
  
      def on_filter_toggled(self, but, outliner):
 -        self.filter_map[int(but.get_name())] = not self.filter_map[int(but.get_name())]
-+        self.filter_map[but.get_name()] = not self.filter_map[but.get_name()]
++        name = but.get_data('pida/outliner')
++        self.filter_map[name] = not self.filter_map[name]
          #self.set_outliner(outliner, self.document)
          self.filter_model.refilter()
  
+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',
+ }
+ 
+ 
+@@ -159,7 +158,7 @@ class OutlineItem(InitObject):
+     """
+     Outlines are returned by an Outliner class
+     """
+-    type = LANG_TYPES.UNKNOWN
++    type = OUTLINER.UNKNOWN
+     name = ''
+     parent = None
+     id = None
+@@ -196,7 +195,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

File kill-validator-types-subtypes-enums

 # User Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
 # Date 1280876358 -7200
 # Node ID 15126c8358813d60d0a73d3e5965774bf14a2de0
-# Parent 203f60a88ffbbe3effabcc0350c40b0d638f97fc
-imported patch kill-validator-types-subtypes-enums
+# Parent ee8ff69d6892f053e2ca214ed0811a055be8fbc7
+switch the validator enums for VALIDATOR_LEVEL and VALIDATOR_KIND symbol bags
 
 diff --git a/pida-plugins/python/python.py b/pida-plugins/python/python.py
 --- a/pida-plugins/python/python.py
     Definition, Suggestion, Documentation, ValidationError)
  
  # locale
-@@ -33,6 +32,7 @@ _ = locale.gettext
- # log
- import logging
- log = logging.getLogger('python_lint')
-+from pida.utils.languages import (LANG_PRIO,
- 
- try:
-     #import pylint
-@@ -90,16 +90,15 @@ except ImportError:
+@@ -90,16 +89,15 @@ except ImportError:
  #         pass
  
  SUBTYPE_MAPPING = {
  }
  
  
-@@ -122,11 +121,11 @@ class PythonError(ValidationError, Log):
+@@ -122,11 +120,11 @@ class PythonError(ValidationError, Log):
                  message_string = self.message
          else:
              message_string = self.message
              typec = self.lookup_color('pida-val-warning')
          else:
              typec = self.lookup_color('pida-val-def')
-@@ -144,10 +143,9 @@ class PythonError(ValidationError, Log):
+@@ -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,
                        'linecolor': linecolor,
                        'typec': typec,
                        'msg_id': self.msg_id
-@@ -225,26 +223,26 @@ class PidaLinter(PyLinter, Log):
+@@ -225,26 +222,26 @@ class PidaLinter(PyLinter, Log):
              return        
          # update stats
          if msg_id[0] == 'I':
  
          #msg_cat = MSG_TYPES[msg_id[0]]
          #self.stats[msg_cat] += 1
-@@ -269,8 +267,8 @@ class PidaLinter(PyLinter, Log):
+@@ -269,8 +266,8 @@ class PidaLinter(PyLinter, Log):
              path = node.root().file
          # add the message
          cmsg = PythonError( message = msg,
 -            typec = self.lookup_color('pida-val-def')
 -        
 +        mapping = {
-+            'error': 'pida-val-error',
-+            'info': 'pida-val-info',
-+            'warning': 'pida-val-warning',
++            VALIDATOR_LEVEL.ERROR: 'pida-val-error',
++            VALIDATOR_LEVEL.INFO: 'pida-val-info',
++            VALIDATOR_LEVEL.WARNING: 'pida-val-warning',
 +        }
 +        typec = mapping.get(self.kind, 'pida-val-def')
 +

File pylint-kill-skeleton

 # HG changeset patch
-# Parent d7d48be4e1ca1ccec946c992a43a0c6cbe14eae4
+# Parent 9710722280a755991ffd49dbad4e1592629f80ea
+kill some skeleton code from pylint
+
 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
-@@ -45,49 +45,6 @@ except ImportError:
+@@ -44,49 +44,6 @@ except ImportError:
      pylint = None
      BaseReporter = object
  
 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